Concept explainers
Savings Account Balance
Write a
A) Ask the user for the total amount deposited into the account during that month and add it to the balance. Do not accept negative numbers.
B) Ask the user for the total amount withdrawn from the account during that month and subtract it from the balance. Do not accept negative numbers or numbers greater than the balance after the deposits for the month have been added in.
C) Calculate the interest for that month. The monthly interest rate is the annual interest rate divided by 12. Multiply the monthly interest rate by the average of that month’s starting and ending balance to get the interest amount for the month. This amount should be added to the balance.
After the last iteration, the program should display a nicely formatted report that includes the following information:
• Starting balance at the beginning of the three-month period
• Total deposits made during the three months
• Total withdrawals made during the three months
• Total interest posted to the account during the three months
• Final balance
Want to see the full answer?
Check out a sample textbook solutionChapter 5 Solutions
STARTING OUT WITH C++ MPL
Additional Engineering Textbook Solutions
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
C++ How to Program (10th Edition)
Absolute Java (6th Edition)
Database Concepts (7th Edition)
Starting Out with Java: Early Objects (6th Edition)
- (Misc. application) a. Write a program that continuously requests a grade to be entered. If the grade is less than 0 or greater than 100, your program should print an appropriate message informing the user that an invalid grade has been entered; else, the grade should be added to a total. When a grade of 999 is entered, the program should exit the repetition loop and compute and display the average of the valid grades entered. b. Run the program written in Exercise 2a and verify the program by using appropriate test data.arrow_forwardLap Timer Tool Write a program ON PYTHON that asks the user to enter the number of times that they have run around a racetrack, and then uses a loop to prompt them to enter the lap time for each of their laps. When the loop finishes, the program should display the time of their fastest lap, the time of their slowest lap, and their average lap time.arrow_forwardRandom Number Guessing Game Write a program that generates a random number between 1 and 100 and asks the user to guess what the number is. If the user’s guess is higher than the random number, the program should display “Too high. Try again.” If the user’s guess is lower than the random number, the program should display “Too low. Try again.” The program should use a loop that repeats until the user correctly guesses the random number. Then the program should display “Congratulations. You figured out my number.”arrow_forward
- /*random number guessing game with while loopscreate a program (or adapt the guessing game program that's posted in moodlea couple of weeks ago) that asks the user to guess a random number between one and sixteen,and compares their guess with the computer's number.save this program as guessLoops.cppThe program should display one of four messages:if your guess is higher than the computer's number: "Your guess is too high."if your guess is lower than the computer's number: "Your guess is too low."if your guess is the same as the computer's number: "That is correct!"if your guess is less than one or greater than sixteen: "Invalid guess."If it's the last one, invalid guess, prompt the user, by using a loop, to guess again.If your guess is too high or too low, ask the user if they'd like to guess again (if theanswer is 'y' for yes, repeat the statements that asks for a guess.Then, repeat statement on line #6-#9 above.If the answer is 'n' for no (meaning the user doesn't want to guess…arrow_forwardmystery_value = 5 #You may modify the lines of code above, but don't move them!#When you Submit your code, we'll change these lines to#assign different values to the variables. #Write a program that divides mystery_value by mystery_value#and prints the result. If that operation results in an#error, divide mystery_value by (mystery_value + 5) and then#print the result. If that still fails, multiply mystery_value#by 5 and print the result. You may assume one of those three#things will work.##You may not use any conditionals.# #Add your code here!arrow_forwardPls do flowchart for this // This pseudocode is intended to determine whether students have // passed or failed a course; student needs to average 60 or // more on two tests. start Declarations num firstTest num secondTest num average num PASSING = 60 // input of first test score output "Enter first score or 0 to quit " input firstTest // loop that continues until the user enters 0 as first test score while firstTest not equal to 0 // input of second test score output "Enter second score or 0 to quit" input secondTest // if second test score is not 0 then calculate and display average and display if the student passed or failed if secondTest is not equal to 0 // calculate and display average average = (firstTest + secondTest) / 2 output "Average is ", average misspelled "t" for the word output // determine if the student passed or failed…arrow_forward
- COM Random Number Guessing Game Write a program that generates a random number and asks the user to guess what the number is. If the user's guess is higher than the random number, the program should display «Too high, try again." If the user's guess is lower than the random number, the program should display "Too low, try again." The program should use a loop that repeats until the user correctly guesses the random number.arrow_forwardSum of Numbers Problem Design a program in Python with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum.arrow_forward17. Math Tutor Write a program that can be used as a math tutor for a young student. The program should display two random numbers to be added, such as 247 +129 The program should then pause while the student works on the problem. When the student is ready to check the answer, he or she can press a key and the program will display the correct solution: 247 +129 376arrow_forward
- Bug Collector - MUST BE WRITTEN IN PSEUDOCODE A bug collector collects bugs every day for seven days. Design a program that keeps a running total of the number of bugs collected during the seven days. The loop should ask for the number of bugs collected for each day, and when the loop is finished, the program should display the total number of bugs collected.arrow_forwardExercise # 8 – Student Number Password Description of the Problem Write a program that inputs your student number and printout your Biography when the student number is correct. Use a Do While / While loop to repeat the process when an incorrect student number is placed. Sample Output Enter your student no. : 29766512 Name : Lastname, Firstname MI Course : [your course here] Favorite [write something here]: [your favorite 1] Favorite [write something here] : [your favorite 2] Favorite quotation : "quotation here" Enter your student no. : 88888888 "Incorrect Student No.!!" Note : Template will not be available for this one. As the code is very short to finish the exercise.arrow_forwardHELP NEEDED ASAP! Language: JAVA Write a program that prompts the user for a value greater than 10 as an input (you should loop until the user enters a valid value) and finds the square root of that number and the square root of the result, and continues to find the square root of the result until you reach a number that is smaller than 1.01. The program should output how many times the square root operation was performed.arrow_forward
- C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage