Project 2 - Arithmetic Calculations Due on Sunday, 1/29/2023, by 11:59pm Lab Objectives This project was designed to reinforce programming concepts from Chapter 2 of Java How to Program: 11/e. In this lab you will practice: • Using the Scanner class to obtain input from the user Using printf to output information to the user Using arithmetic operators to perform calculations Using if statements to make decisions based on the truth or falsity of a condition Using relational operators to compare variable values The follow-up questions and activities also will give you practice: Understanding a common programming error with if statements Problem Description 1. Choose whatever compiler you like to work on programming for this project a. If you decide to use the GDB online Java compiler, i. here is the URL: https://www.onlinegdb.com/online java compiler ii. delete all existing code in the editor if there is any iii. edit your code into the blank editor 2. Create a Java application that a. requests three integers from the user b. calculates the sum, average, & product of these three numbers c. compares them to get the smallest and largest of the numbers d. displays the sum, average, product, smallest and largest of the numbers 3. Run your program after correcting all errors in the code a. Your output should be like the sample output shown below 4. Save you program as Project2_Arithmetic_YourName.java 5. Take a screenshot of your whole compiler window and save the image as Project2_Arithmetic_YourName.png a. Make sure that all output lines are displayed 6. Answer the follow-up questions in a separated Word document and name it Project2_Answers_YourName.docx

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Can you help me do this Java Program

CS140-02, TSU
Project 2 Arithmetic Calculations
Due on Sunday, 1/29/2023, by 11:59pm
Lab Objectives
This project was designed to reinforce programming concepts from Chapter 2 of Java How to
Program: 11/e. In this lab you will practice:
• Using the Scanner class to obtain input from the user
Using printf to output information to the user
Using arithmetic operators to perform calculations
Using if statements to make decisions based on the truth or falsity of a condition
Using relational operators to compare variable values
The follow-up questions and activities also will give you practice:
• Understanding a common programming error with if statements
Created by Li Ma
Problem Description
1. Choose whatever compiler you like to work on programming for this project
a. If you decide to use the GDB online Java compiler,
2. Crea
i. here is the URL: https://www.onlinegdb.com/online java compiler
ii. delete all existing code in the editor if there is any
iii. edit your code into the blank editor
a Java application that
a. requests three integers from the user
b. calculates the sum, average, & product of these three numbers
c. compares them to get the smallest and largest of the numbers
d. displays the sum, average, product, smallest and largest of the numbers
3. Run your program after correcting all errors in the code
a. Your output should be like the sample output shown below
4. Save you program as Project2_Arithmetic_Your Name.java
5. Take a screenshot of your whole compiler window and save the image as
Project2_Arithmetic_YourName.png
a. Make sure that all output lines are displayed
6. Answer the follow-up questions in a separated Word document and name it
Project2_Answers_YourName.docx
Transcribed Image Text:CS140-02, TSU Project 2 Arithmetic Calculations Due on Sunday, 1/29/2023, by 11:59pm Lab Objectives This project was designed to reinforce programming concepts from Chapter 2 of Java How to Program: 11/e. In this lab you will practice: • Using the Scanner class to obtain input from the user Using printf to output information to the user Using arithmetic operators to perform calculations Using if statements to make decisions based on the truth or falsity of a condition Using relational operators to compare variable values The follow-up questions and activities also will give you practice: • Understanding a common programming error with if statements Created by Li Ma Problem Description 1. Choose whatever compiler you like to work on programming for this project a. If you decide to use the GDB online Java compiler, 2. Crea i. here is the URL: https://www.onlinegdb.com/online java compiler ii. delete all existing code in the editor if there is any iii. edit your code into the blank editor a Java application that a. requests three integers from the user b. calculates the sum, average, & product of these three numbers c. compares them to get the smallest and largest of the numbers d. displays the sum, average, product, smallest and largest of the numbers 3. Run your program after correcting all errors in the code a. Your output should be like the sample output shown below 4. Save you program as Project2_Arithmetic_Your Name.java 5. Take a screenshot of your whole compiler window and save the image as Project2_Arithmetic_YourName.png a. Make sure that all output lines are displayed 6. Answer the follow-up questions in a separated Word document and name it Project2_Answers_YourName.docx
Sample Output
Enter first integer: 10
Enter second integer: 201
Enter third integer: 30
For the numbers 10, 20 and 30
Largest is 30
Smallest is 10
Sum is 60
Product is 6000
Average is 20
Problem-solving Tips
1. Prompt the user for three integer values and use Scanner method nextInt to read
them into their respective int variables
2. Use a series of if statements to determine the smallest and largest numbers. You must
use relational operators in the if conditions to compare two numbers at a time
3. The calculation of the average in this exercise should result in an integer representation
of the average. So, if the sum of the values is 7, the average should be 2, not 2.3333...
4. You should declare the variables for three inputs, three calculation results, and two
comparison results before use them
5. Test your program thoroughly using different test inputs and determine whether your
program produces the correct results
a. Try entering 10, 20, and 30 to see if your results match the sample output above
Make sure the class name is same as the file name
6.
7. Be sure to follow the spacing and indentation conventions shown in the class example
8. If you have any questions as you proceed, ask your instructor for assistance
Follow-Up Questions and Activities
1. Place a semicolon at the end of the condition of an if statement in your solution that is
used to help determine the largest and smallest values. What happens? Explain.
Submission
Submit all three files: the Java program Project2_Arithmetic_YourName.java (70%), the
screenshot image Project2_Arithmetic_YourName.png (20%), and the answer to the follow-up
questions Project2_Answers_YourName.docx (10 %) to Blackboard via the link Project2 in
Assignments section on the course page.
Transcribed Image Text:Sample Output Enter first integer: 10 Enter second integer: 201 Enter third integer: 30 For the numbers 10, 20 and 30 Largest is 30 Smallest is 10 Sum is 60 Product is 6000 Average is 20 Problem-solving Tips 1. Prompt the user for three integer values and use Scanner method nextInt to read them into their respective int variables 2. Use a series of if statements to determine the smallest and largest numbers. You must use relational operators in the if conditions to compare two numbers at a time 3. The calculation of the average in this exercise should result in an integer representation of the average. So, if the sum of the values is 7, the average should be 2, not 2.3333... 4. You should declare the variables for three inputs, three calculation results, and two comparison results before use them 5. Test your program thoroughly using different test inputs and determine whether your program produces the correct results a. Try entering 10, 20, and 30 to see if your results match the sample output above Make sure the class name is same as the file name 6. 7. Be sure to follow the spacing and indentation conventions shown in the class example 8. If you have any questions as you proceed, ask your instructor for assistance Follow-Up Questions and Activities 1. Place a semicolon at the end of the condition of an if statement in your solution that is used to help determine the largest and smallest values. What happens? Explain. Submission Submit all three files: the Java program Project2_Arithmetic_YourName.java (70%), the screenshot image Project2_Arithmetic_YourName.png (20%), and the answer to the follow-up questions Project2_Answers_YourName.docx (10 %) to Blackboard via the link Project2 in Assignments section on the course page.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education