Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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_2

Step: 3

blur-text-image_3

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

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

How does defect detection improve the production yield?

Answered: 1 week ago