Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Description Write an application that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers. Note:

image text in transcribed
image text in transcribed
Problem Description Write an application that inputs three integers from the user and displays the sum, average, product, smallest and largest of the numbers. Note: 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.... Sample Output Enter first integer: 10 Enter second integer: 20 Enter third integer: 30 For the numbers 10, 20 and 30 Largest is 30 Smallest is 10 Product is 6000 Average is 20 Program Template pplication: Proget Performing the b alculates calculati Created by L 1/16/2020 import java. . See public class Projects Samballations puble static void main( S t age) Scaner input - S y stem.in) interit // SE IN // second ter it as a s ist product int average product age n largest number a smallest - berl: d is the last berlis t TODO all th e se the it code that the largest Pengelola - bera + number - number TODO wste s t eds play the results and was wchod end class Proce s sats. 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. Calculate the sum, product and average, and assign them to variables called sum, product and average, respectively. Then, display the results in an information message dialog 4. Test your program thoroughly using different test inputs and determine whether your program produces the correct results. Try entering 10, 20, and 30 and see if your results match the sample output above. 5. Make sure the class name is same as the file name. a. You should download the provided code and save it as Project1_NumberCalculations Your Name.java b. Make necessary change(s) in the program 6. Be sure to follow the spacing and indentation conventions shown in the template. 7. You should answer the follow-up questions in a separated Word document and name it Project1_Answers YourName.docx. 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning PostgreSQL

Authors: Salahaldin Juba, Achim Vannahme, Andrey Volkov

1st Edition

178398919X, 9781783989195

More Books

Students also viewed these Databases questions

Question

What factors shift the aggregate demand curve?

Answered: 1 week ago

Question

=+Construct a data- and research-driven SWOT analysis

Answered: 1 week ago