Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 2 . 4 ( LAB ) Simple Arithmetic Program For this lab, you will write a Java program to prompt the user to enter

12.4(LAB) Simple Arithmetic Program
For this lab, you will write a Java program to prompt the user to enter two integers. Your program will display a series of arithmetic operations using those two integers.
Sample Output: This is a sample transcript of what your program should do. Items in bold are user input and should not be put on the screen by your program. Make sure your output looks EXACTLY like the output below, including spacing. Items in bold are elements input by the user, not hard-coded into the program.
Enter the first number: 12
Enter the second number: 3
12+3=15
12-3=9
12**3=36
123=4
12 & 3=0
The average of your two numbers is: 7
A second run of your program with different inputs might look like this:
Enter the first number: -4
Enter the second number: 3
-4+3=-1
-4-3=-7
-4**3=-12
-43=-1
-4??& 3=-1
The average of your two numbers is: 0
HINT: You can start by retyping the code that was given to you in Exercise 3 of ClosedLab01. That code takes in a single number and performs a few arithmetic operations on it. How can you modify that code to take in two numbers? How can you modify it to display "number * number =" instead of "Your number squared is: "? Take it step by step and change one thing at a time.
image text in transcribed

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

Generative Artificial Intelligence For Project Management With Aws

Authors: Timothy Krimmel

1st Edition

B0CQV9KWB8, 979-8872627197

More Books

Students also viewed these Databases questions