This lesson consists of learning how to perform a task on the input of the user by asking the user to enter some information into the Java program. This lesson is explained with the following video. Watch the video and complete the following questions until the next lesson!

You can find additional information about data entry in the following link entitled “DATA ENTRY”:

ATTENTION ADVERTISEMENT! A video course on Java programming languages is ready. You can read information about the video course by clicking on the image below:

EXERCISES TO DO

- Write a Java program that asks the user to enter two numbers and calculates the product of the entered numbers!

Issue:

Enter the first number: 25

Enter the second number: 5

Expected result:

25*5=125

- Write a Java program that asks the user to enter two numbers and find the sum, multiplication, subtraction, division and remainder of these numbers!

Issue:

Enter the first number: 125

Enter the second number: 24

Expected result:

125+24= 149

125*24=3000

125-24=101

125/24=5

125%24=5 - Create a Java program that asks the user to enter the width and height of a rectangle and calculates the area and perimeter of this rectangle!

Issue:

Enter the length of the width: 12

Enter the height: 6

Expected result:

AREA= 12*6=72 PERIMETER=2*(12+6)=36 - Write a Java program that asks the user to enter the length of the radius (R=) of a circle and calculates the area and length of that circle!

Issue:

R = 3

Expected result (assuming PI is 3):

AREA= PI*R*R=27

LENGTH=2*PI*R=18 - Write a Java program that asks the user to enter an int number (n) and displays (n+nn+nnn) on the screen!

Example:

n=: 5

Expected result:

5+55+555