you were asked to create a program that would calculate the balance of a savings account...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
you were asked to create a program that would calculate the balance of a savings account after six months. In this lab, we will revisit the monthly interest calculation program but add one additional feature. In this program you will add the ability for the user to enter the number of months they plan on saving. Write a program that asks the user the following: the amount to be deposited each month (double) the annual interest rate percentage (double) the number of months they wish to save (int) Your program must perform input validation on all three numbers entered by the user to ensure the deposited amount and annual interest are doubles and that the number of months is an integer. Print out the monthly balance over the specified savings duration. Remember to include both the first and last month of your period. After the program has finished, ask the user if they would like to try another calculation. Use input validation to ensure the user answers with a 'Y' or an 'N'. Keep the program running in an infinite loop until the user indicates they want to quit. Hint: To add commas to your formatted string, simply add a comma to your format scheme. Example: printf("Balance is: $%,.2f",balance) Example Run This program will ask the user for a monthly deposit, an annual interest rate, and the number of months the user plans on saving. It will then show the monthly balance over the period of planned savings. Please enter the amount to be deposited each month: a lot! Invalid response! Please enter a number. Please enter the amount to be deposited each month: 250.50 Please enter the annual interest rate: 3.75 Please enter the number of months you plan to save eighteen Invalid response! Please enter a whole number. Please enter the number of months you plan to save: 18 1/3 you were asked to create a program that would calculate the balance of a savings account after six months. In this lab, we will revisit the monthly interest calculation program but add one additional feature. In this program you will add the ability for the user to enter the number of months they plan on saving. Write a program that asks the user the following: the amount to be deposited each month (double) the annual interest rate percentage (double) the number of months they wish to save (int) Your program must perform input validation on all three numbers entered by the user to ensure the deposited amount and annual interest are doubles and that the number of months is an integer. Print out the monthly balance over the specified savings duration. Remember to include both the first and last month of your period. After the program has finished, ask the user if they would like to try another calculation. Use input validation to ensure the user answers with a 'Y' or an 'N'. Keep the program running in an infinite loop until the user indicates they want to quit. Hint: To add commas to your formatted string, simply add a comma to your format scheme. Example: printf("Balance is: $%,.2f",balance) Example Run This program will ask the user for a monthly deposit, an annual interest rate, and the number of months the user plans on saving. It will then show the monthly balance over the period of planned savings. Please enter the amount to be deposited each month: a lot! Invalid response! Please enter a number. Please enter the amount to be deposited each month: 250.50 Please enter the annual interest rate: 3.75 Please enter the number of months you plan to save eighteen Invalid response! Please enter a whole number. Please enter the number of months you plan to save: 18 1/3 you were asked to create a program that would calculate the balance of a savings account after six months. In this lab, we will revisit the monthly interest calculation program but add one additional feature. In this program you will add the ability for the user to enter the number of months they plan on saving. Write a program that asks the user the following: the amount to be deposited each month (double) the annual interest rate percentage (double) the number of months they wish to save (int) Your program must perform input validation on all three numbers entered by the user to ensure the deposited amount and annual interest are doubles and that the number of months is an integer. Print out the monthly balance over the specified savings duration. Remember to include both the first and last month of your period. After the program has finished, ask the user if they would like to try another calculation. Use input validation to ensure the user answers with a 'Y' or an 'N'. Keep the program running in an infinite loop until the user indicates they want to quit. Hint: To add commas to your formatted string, simply add a comma to your format scheme. Example: printf("Balance is: $%,.2f",balance) Example Run This program will ask the user for a monthly deposit, an annual interest rate, and the number of months the user plans on saving. It will then show the monthly balance over the period of planned savings. Please enter the amount to be deposited each month: a lot! Invalid response! Please enter a number. Please enter the amount to be deposited each month: 250.50 Please enter the annual interest rate: 3.75 Please enter the number of months you plan to save eighteen Invalid response! Please enter a whole number. Please enter the number of months you plan to save: 18 1/3
Expert Answer:
Answer rating: 100% (QA)
The simple program in C that fulfills the requirements youve described include int ... View the full answer
Related Book For
Intermediate Accounting IFRS
ISBN: 978-1119372936
3rd edition
Authors: Donald E. Kieso, Jerry J. Weygandt, Terry D. Warfield
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
List three specific parts of the Case Guide, Objectives and Strategy Section (See below) that you had the most difficulty understanding. Describe your current understanding of these parts. Provide...
-
The lifespans of gorillas in a particular zoo are normally distributed. The average gorilla lives 20.8 years; the standard deviation is 3.1 years. Use the empirical rule (68 - 95 - 99.7%) to estimate...
-
Research Capital, an investment banking company, has extra cash to invest. Suppose Research Capital buys 1,000 shares of Potash Corporation of Saskatchewan at $185 per share. Assume Research Capital...
-
Draw the free-body diagram for the following problems. a) The crane in Prob. 559. b) The smooth pipe in Prob. 561. c) The bar in Prob. 562. 5 m A -P O
-
For a sample of size n = 20, the following values were obtained: b0 = 1.05, b1 = 4.50, se = 0.54, (x x )2 = 10.9, x = 8.52. Construct a 95% confidence interval for the mean response when x = 10.
-
Shannons account at Commerce Bank has a balance of $1,200. Shannons account number is 1236. Requirement 1. Assuming the bank uses encryption for customer account numbers and the last digit is a check...
-
PROBLEM The problem is shown in the given figure. A pulley drive is transmitting pinion, which in turn is transmitting power to some other machine element. Pu pinion diameters are 400mm and 200mm...
-
Modern Kitchenware Co. specializes in the manufacturing and distribution of items used in the kitchen. Among its many products are microwave ovens, toasters, electric can openers, etc. Its home base...
-
All question marks in this page need to be determine. (box the answers) 4. (a) 7 sin (17) T = ? 1352 ww 970. E 16MF: E: t = ?@.208 m (time constant) We = 11:07 Kth] (cut-off anglar frequency) ?...
-
Suppose that an employee at a local company checks his watch and realizes that he has 10 minutes to get to work on time. If he leaves now and does not get stopped by any traffic lights, he will...
-
Leapfrog Lawn Service provides general lawn maintenance to customers. The company's fiscal year-end is December 31. Information necessary to prepare the year-end adjusting entries appears below. 1....
-
A trader opens a new position by writing two put option contracts. Each contract is on 100 shares of Exxon Mobil common stock. The option premium is $6.06, the strike price is $50, and the stock...
-
In an annual audit of Monty Company Limited, you find that a physical inventory count on December 31, 2023, showed merchandise of $440,000. You also discover that the following items were excluded...
-
Inflation in the United States is 2% per year and in Australia, it is 3% per year. The nominal interest rate in Australia is 6%. What does the Fisher effect predict the nominal interest rate in the...
-
Marketable securities are primarily a. Long-term equity securities. b. Long-term debt instruments. c. Short-term equity securities. d. Short-term debt instruments. The shareholders wealth can be...
-
Outline some of the major problems confronting an international advertiser.
-
Kennedy Company has the following portfolio of trading investments at December 31, 2019. On December 31, 2020, Kennedy's portfolio of trading investments consisted of the following investments. At...
-
Presented below is a list of items that could be included in the intangible assets section of the balance sheet. 1. Cost of purchasing a patent from an inventor. 2. Unrecovered costs of a successful...
-
What approaches may be employed in applying the lower-of-cost-or-market procedure? Which approach is normally used and why?
-
Give five reasons why fraudulent financial reporting is committed.
-
What type of audit report should the auditor issue if a material fraud is detected and the financial statements are not revised?
-
Which of the following statements best describes an auditor's responsibility to detect errors and fraud? a. The auditor should study and evaluate the client's internal control, and design the audit...
Study smarter with the SolutionInn App