Question
Write the necessary program in C++ that does the following: 1. Asks the user to input two decimal numbers by using the prompt Enter a
Write the necessary program in C++ that does the following:
1. Asks the user to input two decimal numbers by using the prompt "Enter a decimal number: " on the screen for each number
2. Reads the user's inputted decimal values from the keyboard and stores it in the variables called number1 and number2
3. Calculates the sum of those two numbers and stores it in a variable called total
4. Displays the two inputted values and the sum with proper labels to the values on the screen
e.g., if the user entered 3.2 and 7.1 as the inputs on the keyboard, then the output should be:
The first number is: 3.2
The second number is: 7.1
The total of the two numbers is: 10.3
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