Question
Problem Description Use what we have learned so far from chapters 1, 2, and 3 to build a program that performs some simple calculator operations.
Problem Description
Use what we have learned so far from chapters 1, 2, and 3 to build a program that performs some simple calculator operations.
Required Reading
Chapters 1, 2, and 3
You are expected to use only the material we have covered in the course so far. Even if you know of another way to solve this programming problem, please stick to the approach we are using in this class.
Learning Goals
Learn to work with
- input / output
- variables
- data types
- arithmetic operators
Prerequisites
- Complete all lab assignments up to this point
Task
Write a program that prompts a user for input, performs calculations, and outputs the results. Your program should prompt, calculate, and output 10 calculations. Use the scanner class to collect user input. Use arithmetic operators to perform calculations. Use meaningful variable names and appropriate data types. Include introductory comments and inline comments that explain what the code is doing. Use prompts and output messages that communicate clearly.
Sample User Interaction and Output for this Project
(User input is shown in bold)
Addition: Please enter a whole number
5
Please enter another whole number
23
The sum of 5 and 23 is 28.
Preparing for the next calculation...
Multiplication: Please enter a number with a decimal point
2.357
Please enter another number with a decimal point
1.38
The product of 2.357 and 1.38 is 3.25266
<<<<< END SAMPLE >>>>>>
Prompts, user input, and program output should continue as illustrated above until the program has completed 10 calculations. You can choose which calculations you would like your program to do. Include some variety.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started