Question: Please include the answer to both questions in a single file. Ensure the file you submit has the extension .cpp. Write a complete C++ program

Please include the answer to both questions in a single file. Ensure the file you submit has the extension .cpp.

Write a complete C++ program that does the following: 

1. Declare two variables, checking and savings, of type double. Prompt the user for the amount in both accounts. If the total of both accounts is less than or equal to zero, output "Bankrupt". If the total of both accounts is greater than 250000, output "Money Bags". If neither of these is the case, simply output "Total: " followed by the total in both accounts.

2. Declare a variable of type int. Prompt the user for a positive three-digit number. Test to ensure the number is within the proper bounds. If the number is larger or less than three digits, output "Error" and terminate the program. Otherwise, calculate and print the sum of the three digits.

Examples Question 1: 

Checking: -5 Savings: 3 Bankrupt

Question 2:

Enter a positive three-digit number: 491 14

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!