CBCP2101 - Assignment Answers PDF

Title CBCP2101 - Assignment Answers
Author Francis Bernard
Course Computer Programming 1
Institution Open University Malaysia
Pages 9
File Size 275.5 KB
File Type PDF
Total Downloads 69
Total Views 992

Summary

< Bachelors in Information Technology >< 1192 / 2019 >< CBCP2101 >< COMPUTER PROGRAMMING 1 >MATRICULATION NO: < 92102410659501 >IDENTITY CARD NO. : < 921024 – 10 – 6595 >TELEPHONE NO. : < 012 – 358 1092 >E-MAIL : < bernie9210@gmail > LEARNING CENTRE : ...


Description

< Bachelors in Information Technology >

< 1192 / 2019 >

< CBCP2101 >

< COMPUTER PROGRAMMING 1 >

MATRICULATION NO:

< 92102410659501 >

IDENTITY CARD NO.

:

< 921024 – 10 – 6595 >

TELEPHONE NO.

:

< 012 – 358 1092 >

E-MAIL

:

< [email protected] >

LEARNING CENTRE

:

< Bangi Learning Centre >

1

INDEX TITLE INTRODUCTION ANALYZE THE PROBLEM ALGORITHM IN A PSEUDOCODE FLOWCHART BASED ON PSEUDOCODE TRACING TABLE TO SHOW THE PROJECTED VALUES CONCLUSION REFERENCES

PAGES 3 3–5 5–6 7 8 9 9

INTRODUCTION

2

I am required to design a program to calculate and display detail information of a car loan and its table of repayment. The program requires user to input purchase price of the car, down payment, interest rate and repayment period. This program must be able to calculate and display the total amount of the loan, total interest to be paid, total amount of repayment, monthly payment, and table of repayment. ANALYZE THE PROBLEM The value entered for the data should not be in negative value. Identify the required input and output for the car loan system. Initial value needed: Sum = 0 : To calculate adding amount, subtracting amount, calculating accumulated payment, and adding or subtracting balance Input data required for the car loan system as below: I.

Purchase_price: Data type = float

II.

Down_payment: Data type = float

III.

Interest_rate: Data type = float

IV.

Year (Repayment period): Data type = integer Process Formula to be used:

I.

Total_loan_amount = Purchase_price – Down_payment  The total loan amount is calculated by subtracting the down payment from the purchase price.

II.

Total_interest = (Loan_amount * Interest_rate * Year) / 100  Total interest is calculated by multiplying the loan amount by the interest rate and multiplied by the year.

III.

Total_repayment_amount = Total loan_amount + Total_interest  Total repayment amount is calculated by adding the total loan amount with total interest.

IV.

Monthly_repayment = Total repayment_amount / (Year*12)

3

 Monthly repayment is calculated by total repayment amount divide by the repayment period and divide by 12. The value is for one month of repayment amount. V.

Month = 0  This is to enable the calculation for Table of Repayment made easier when user enter the value in the variable Year at the beginning of the Calculator

VI.

Month = Month + 1  Once user has entered value in Year, the month counter will automatically increase by 1 till it reaches the maximum number of months that is need for the particular Year user has entered.

VII.

Accumulated_payment = Accumulated_payment + Monthly_repayment  The accumulated payment is calculated by adding the sum of each monthly repayment.

VIII.

Balance = Total_loan_repayment – Accumulated_payment  The balance is calculated by subtracting the total loan repayment from the accumulated payment.

Constant value: month = 12 Structure used: 

Repetition – The month(s), payment, accumulated payment, and balance will be displayed repeatedly depending on the total number of months that is required for the loan repayment.

Output data required for the car loan system as below: I.

Purchase_price: Data type = float

II.

Down_payment: Data type = float

III.

Interest_rate: Data type = float

IV.

Repayment_period: Data type = int

V. VI. VII. VIII.

Total loan_amount: Data type = float Total interest: Data type = float Total repayment_amount: Data type = float Monthly_repayment: Data type = float

4

IX. X. XI. XII.

Month: Data type = int Payment: Data type = float Accumulated_payment: Data type = float Balance = Data type = float

ALGORITHM IN A PSEUDOCODE. I.0

Start

II.0

Initialize sum = 0

III.0

Input purchase_price

IV.0

Input down_payment

5.0

Input interest_rate

6.0

Input repayment_period

7.0

Print purchase_price

8.0

Print down_payment

9.0

Print interest_rate

10.0

Print repayment_period

11.0

Calculate Total_loan_amount as Total_loan_amount = purchase_price – down_payment /* calculation */

12.0

Calculate Total_interest as Total_interest = (Loan_amount * Interest_rate * Year) / 100 /* calculation */

13.0

Calculate

Total_repayment_amount

as

Total_repayment_amount

=

Total

loan_amount + Total interest /* calculation */ 14.0

Calculate Monthly_repayment as Monthly_repayment = Total_repayment_amount / (Year * 12) /* calculation */

15.0

Print Total_loan_amount

16.0

Print Total_interest

17.0

Print Total_repayment_amount

18.0

Print monthly_repayment

19.0

Month = 0

20.0

Do { 20.1

Start_do

5

20.1.1 for (int i = 1; i...


Similar Free PDFs