Write a program for computing the amount of money in a bank account at the end of each quarter for a period of one year. A quarter is equivalent to 3 months. Assume that the account is created at the beginning of a year (i.e. January 1). The year will be entered at run time through the keyboard. The account has an initial principal that is entered at run time through the keyboard. No deposit or withdrawal is made within the one-year period. The interest is compounded quarterly which means that the interest earned for the first quarter will form part of the principal for the second quarter, the interest earned for the second quarter will form part of the principal for the third quarter and so on. The annual interest rate is 5%. The interest rate for a quarter is computed by dividing the annual interest rate by 4 since there are four quarters in a year. The computational procedure (see algorithm) and the output of the program (see sample run) are shown below. The output includes a table showing the year, quarter number, interest earned and the new principal. The new principal is the amount at the end of the quarter.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Display the column headings for the table.
Compute the interest rate for a quarter.
Let quarter be 1.
Compute the interest earned for the first quarter
Compute the new amount (amount at the end of the first quarter)
Display the year, quarter, interest earned and balance at the end of 1st quarter
Let quarter be 2
Compute the interest earned for the second quarter
Compute the new amount (amount at the end of the second quarter)
Display the year, quarter, interest earned and balance at the end of 2nd quarter
Let quarter be 3.
Compute the interest earned for the third quarter
Compute the new amount (amount at the end of the third quarter)
Display the year, quarter, interest earned and balance at the end of 3rd quarter
Let quarter be 4.
Compute the interest earned for the fourth quarter
Compute the new amount (amount at the end of the fourth quarter)
Display the year, quarter, interest earned and balance at the end of 4th quarter
SAMPLE RUN:
Enter the year: 2005
Enter the initial principal: 10000.e0
Principal: 100eo.ee
Annual Interest Rate: 5.00%
Quarter
Year
Interest Earned
Amount at end of quarter
10125.00
2005
125.00
2005
126.56
128.14
10251.56
2005
3
10379.70
2005
129.75
10509.45
IN34
Transcribed Image Text:Display the column headings for the table. Compute the interest rate for a quarter. Let quarter be 1. Compute the interest earned for the first quarter Compute the new amount (amount at the end of the first quarter) Display the year, quarter, interest earned and balance at the end of 1st quarter Let quarter be 2 Compute the interest earned for the second quarter Compute the new amount (amount at the end of the second quarter) Display the year, quarter, interest earned and balance at the end of 2nd quarter Let quarter be 3. Compute the interest earned for the third quarter Compute the new amount (amount at the end of the third quarter) Display the year, quarter, interest earned and balance at the end of 3rd quarter Let quarter be 4. Compute the interest earned for the fourth quarter Compute the new amount (amount at the end of the fourth quarter) Display the year, quarter, interest earned and balance at the end of 4th quarter SAMPLE RUN: Enter the year: 2005 Enter the initial principal: 10000.e0 Principal: 100eo.ee Annual Interest Rate: 5.00% Quarter Year Interest Earned Amount at end of quarter 10125.00 2005 125.00 2005 126.56 128.14 10251.56 2005 3 10379.70 2005 129.75 10509.45 IN34
Problem:
Write a program for computing the amount of money in a bank account at the end of each quarter for a period of
one year. A quarter is equivalent to 3 months. Assume that the account is created at the beginning of a year (i.e.
January 1). The year will be entered at run time through the keyboard. The account has an initial principal that is
entered at run time through the keyboard. No deposit or withdrawal is made within the one-year period. The
interest is compounded quarterly which means that the interest earned for the first quarter will form part of the
principal for the second quarter, the interest earned for the second quarter will form part of the principal for the
third quarter and so on. The annual interest rate is 5%. The interest rate for a quarter is computed by dividing the
annual interest rate by 4 since there are four quarters in a year. The computational procedure (see algorithm) and
the output of the program (see sample run) are shown below. The output includes a table showing the year, quarter
number, interest earned and the new principal. The new principal is the amount at the end of the quarter.
ALGORITHM:
Declare the necessary variables.
Let annual interest rate be set to 0.05. (Note 5.00% = 0.05).
Accept the year.
Accept the initial principal.
Display principal formatted with two digits after decimal point.
Display annual interest rate in percent form.
Transcribed Image Text:Problem: Write a program for computing the amount of money in a bank account at the end of each quarter for a period of one year. A quarter is equivalent to 3 months. Assume that the account is created at the beginning of a year (i.e. January 1). The year will be entered at run time through the keyboard. The account has an initial principal that is entered at run time through the keyboard. No deposit or withdrawal is made within the one-year period. The interest is compounded quarterly which means that the interest earned for the first quarter will form part of the principal for the second quarter, the interest earned for the second quarter will form part of the principal for the third quarter and so on. The annual interest rate is 5%. The interest rate for a quarter is computed by dividing the annual interest rate by 4 since there are four quarters in a year. The computational procedure (see algorithm) and the output of the program (see sample run) are shown below. The output includes a table showing the year, quarter number, interest earned and the new principal. The new principal is the amount at the end of the quarter. ALGORITHM: Declare the necessary variables. Let annual interest rate be set to 0.05. (Note 5.00% = 0.05). Accept the year. Accept the initial principal. Display principal formatted with two digits after decimal point. Display annual interest rate in percent form.
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education