Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You can use the following template / Lab 2: MyCalculatel.java /I Compilation: javac MyCalculate1.java // Execution: java MyCalculatel // Asks for three integers and outputs

image text in transcribed

You can use the following template / Lab 2: MyCalculatel.java /I Compilation: javac MyCalculate1.java // Execution: java MyCalculatel // Asks for three integers and outputs the sum, product and average / Example Execution: // %java MyCalculatel // Enter first integer: 10 // Enter second integer: 20 // Enter third integer: 30 /I For the numbers 10, 20 and 30 Sum is 60 // Average is 20 import java.util.Scanner public class MyCalculatel Product is 6000 public static void main( String args) Scanner input - new Scanner( System.in ; int numberl: // first number int number2; / second number int number3: // third number int sum; // sum of numbers int product; // product of numbers int average: // average of numbers /* write a series of statements to read in three numbers and assign them to numberl, number2, and number3 / // perform calculations sum-number1 number2 + number3: /* write statements to calculate the product and the average / /* write statements that display the results/ ) // end main end class MyCalculatel Problem 2. Create a new class called MyCalculate2, that does what MyCalculatel class does, but also outputs the largest and smallest of the three integers, outputting a respective messages. Hint: You will need to use multiple if statements and device a strategy to make the comparison

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

More Books

Students also viewed these Databases questions