user100DaysOfCode
CommunityDevTermsResources|Login

Loading

Java Roadmap

Day 4: Basic Arithmetic Operations

1. Write a program that declares two integer variables and perform basic arithmetic operations (addition, subtraction, multiplication, division) on them. Print the results to the console.
2. Write a program that calculates the area of a rectangle. Prompt the user to input the length(integer) and width(integer) of the rectangle, calculate the area (length * width), and print the result.
3. Modify the above program to read decimal numbers as the length and width, and output the area to two decimal points

Reading List:
1. Learn about formatting options such as precision, alignment, and decimal places to present output in a clear and concise manner
<Prev|Next>

Learning Resources |View Complete Plan

Day 4 - Basic Arithmetic Operations

1. Write a program that declares two integer variables and perform basic arithmetic operations (addition, subtraction, multiplication, division) on them. Print the results to the console.
2. Write a program that calculates the area of a rectangle. Prompt the user to input the length(integer) and width(integer) of the rectangle, calculate the area (length * width), and print the result.
3. Modify the above program to read decimal numbers as the length and width, and output the area to two decimal points

Reading List:
1. Learn about formatting options such as precision, alignment, and decimal places to present output in a clear and concise manner
<Prev|Next>

Learning Resources |View Complete Plan

      Sponsor Us|Community|Blog|YoutubeCareersContact UsDisclaimerPrivacy PolicyTerms of Service
      Have Feedback or want to contribute? Email: hello[@]100DaysOfCode.io
      100DaysOfCode@2024