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
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