icon

Usetutoringspotscode to get 8% OFF on your first order!

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.

 

You can leave a response, or trackback from your own site.

Leave a Reply

Computer programming

Computer programming

<<Note to instructor: Please make sure you customize the area shaded in red each time you teach this class, and remove comments in red before publishing>>

Write a program that can be used by a small theater to sell tickets for performances. The theater’s auditorium has <<Put in number of digits, for example – 10>> rows of seats, with <<Put in number of digits, for example – 9>> seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the theater. Seats that are taken are represented by an * symbol, and seats that are available are represented by a # symbol:

1 2 3 4 5 6 7 8 9
R 1 * * * # # * # # *
R 2 # * * * * * * * *
R 3 * # # * * * * * *
R 4 * * * # * * # # #
R 5 * * # * * * * * #
R 6 * * * # # # # * *
R 7 # # # * * * # # *
R 8 * * * * # # # * *
R 9 * * # # # * * * *
R 10 # # # * * * * * *

Every time a ticket or group of tickets is purchased, the program should display the total ticket prices and update the seating chart.

The program should keep a total of all ticket sales.

Assignment: <<Note to instructor: Please make sure you customize the area shaded in red each time you teach this class, and remove comments in red before publishing>>

Write a console-based procedural C++ program that generates a random number and prompts the user to guess it.

Allow the user to guess the number for << put in number of times, for example – 10 >> times. Each time the user guesses, tell the user if the guess matches. If the guess does not match, tell the user if the guess was too high or too low.

Use an integer to store the random number obtained from a built-in function, another integer to store the guess, and a constant for the maximum random number the computer can choose.

Include the proper header and make sure you properly comment your program. Also, make sure you use proper coding conventions

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Computer programming

Computer programming

<<Note to instructor: Please make sure you customize the area shaded in red each time you teach this class, and remove comments in red before publishing>>

Write a program that can be used by a small theater to sell tickets for performances. The theater’s auditorium has <<Put in number of digits, for example – 10>> rows of seats, with <<Put in number of digits, for example – 9>> seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the theater. Seats that are taken are represented by an * symbol, and seats that are available are represented by a # symbol:

1 2 3 4 5 6 7 8 9
R 1 * * * # # * # # *
R 2 # * * * * * * * *
R 3 * # # * * * * * *
R 4 * * * # * * # # #
R 5 * * # * * * * * #
R 6 * * * # # # # * *
R 7 # # # * * * # # *
R 8 * * * * # # # * *
R 9 * * # # # * * * *
R 10 # # # * * * * * *

Every time a ticket or group of tickets is purchased, the program should display the total ticket prices and update the seating chart.

The program should keep a total of all ticket sales.

Assignment: <<Note to instructor: Please make sure you customize the area shaded in red each time you teach this class, and remove comments in red before publishing>>

Write a console-based procedural C++ program that generates a random number and prompts the user to guess it.

Allow the user to guess the number for << put in number of times, for example – 10 >> times. Each time the user guesses, tell the user if the guess matches. If the guess does not match, tell the user if the guess was too high or too low.

Use an integer to store the random number obtained from a built-in function, another integer to store the guess, and a constant for the maximum random number the computer can choose.

Include the proper header and make sure you properly comment your program. Also, make sure you use proper coding conventions

Responses are currently closed, but you can trackback from your own site.

Comments are closed.

Powered by WordPress | Designed by: Premium WordPress Themes | Thanks to Themes Gallery, Bromoney and Wordpress Themes