Okhunjon Gaibullayev's blog

Learning how to prompt a user for input in a Java program!

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

  1. 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

  1. 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
  2. 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= 126=72 PERIMETER=2(12+6)=36
  3. 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= PIRR=27
    LENGTH=2PIR=18
  4. 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
Рейтинг
( 1 assessment, average 5 from 5 )
Oxunjon G'aybullayev/ author of the article
Понравился этот пост? Поделись с друзьями:
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: