Blog Oxunjon Gaybullayeva

What are variables? How is it used with arithmetic operations?

Our second lesson will be about variables and their use. This lesson is explained with the help of a video. Watch the video below and find out!

With the knowledge you have learned in the lesson, you will be able to write the code for the following problems. Do all this before the next lesson (note: the next lesson will be sent to your inbox) and you will increase your knowledge of the topic. If you have problems with the issues, leave them in the comments!

  1. “Hello! Write a program code that outputs the message “This is my first Java program”!
  2. Write a Java program that calculates the sum of two numbers and displays it on the screen!

Example:
54+ 31=?
Expected result:
85

  1. Write a Java program that divides two numbers!
    Example:
    50/3=?
    Expected result
    16
  2. Write a program that displays the results of the following!
    Examples:
    a. -5 + 8 * 6=?
    b. (55+9) % 9=?
    c. 20 + -3*5 / 8=?
    d. 5 + 15 / 3 * 2 – 8 % 3=?
    Expected result:
    43
    1
    19
    13
  3. Write an application that displays the following pattern on the screen!
    J          а            в
    J       a    a            v        v      a
    J                            
    A
  4. Write the program code that displays the face and perimeter of a rectangle on the screen!
    Width = 5.6
    Height = 8.5
    Expected result:
    Face 5.68.5 = 47.60 Perimeter 2(5.6 + 8.5) = 28.20

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:

Рейтинг
( No ratings yet )
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: :???: :?: :!: