Transtheoretical Model of change
May 10, 2020
A Thousand Splendid Suns
May 10, 2020

COMPUTER PROGRAMMING

COMPUTER PROGRAMMING

Computer science
Paper instructions:
QUESTION 1

Write a C program to enter an initial number of population and its projected population. Assume the population will increase in the same percentage annually. Write a loop that displays the annual population and determines how many years it will take for the population to surpass the projected population.

 

QUESTION 2

You have saved RM10,000 to use as a down payment on a car. Before beginning your car shopping, you decide to write a program to help you figure out what your monthly payment will be, given the car’s purchase price, the monthly interest rate, and the time period over which you will pay back the loan. The formula for calculating your payment is

where
P = principal (the amount you borrow)
i = monthly interest rate ( of the annual rate)
n = total number of payments

Your program should prompt the user for the purchase price, the down payment, the annual interest rate and the total number of payments (number of months). It should then display the amount borrowed and the monthly payment including a ringgit sign and two decimal places.