BCS 1213- ASSIGNMENT 1 SEM1 2012/13 Instructions

advertisement
BCS 1213- ASSIGNMENT 1 SEM1 2012/13
Instructions - Complete the following before the start of class:
INSTRUCTION- Complete the following before presenting to your lecturer.
1. Code, debug, comment and print the source code for all programs. All programs should
attach together with algorithm (flowchart and pseudocode).
2. You may solve this problem in group (2 in group).
DATELINE: 1/11/12
QUESTION 1
It seems Syawal was the most exciting month of the year and Ramadhan has to say good bye.
Due to Eid Mubarak Festival, changing cash among Muslims is a must.
Specifications:Therefore you have to create a money exchange program. The program allows
user to enter the cash and then display the number of RM10, RM5, RM1 and coins in cents.
Due to the purpose, the program will be installed to the Money Exchange Machine at
Imagination Public Bank. The MEM able to display the appropriate output on Figure 1.0:
WELCOME TO E-SMART MONEY CHANGER
YOUR CASH WILL BE CHANGED ONLY IN RM10, RM5, RM 1 AND COINS. YOUR
MAXIMUM AMOUNT IS RM3000
KEY IN YOUR AMOUNT:
RM 1233.45
YOUR CASH WILL BE CHANGED INTO :
RM10 = 123 notes
RM5 = 0 notes
RM 1 = 3 notes
Coins= 45 cents
******THANK YOU*****
QUESTION 2
Paint is ubiquitous. It's everywhere. And it's applied by highly paid professionals called
"painters". One of the tasks they are required to perform before they start painting is to calculate
the amount of paint they will need for the job. This calculation usually includes false
assumptions, overestimations, underestimations, misinterpretations, disambiguation, and
miscalculations. As a result, either too much or too little paint is mixed and purchased, costing
the client or painter (depending on who takes on the risk) valuable money, useful for lunch.
Specifications: You are to write a simple program to help a painter decide how much paint to
buy for a job dependent on certain relevant and irrelevant input data. Here's how it works:
BCS 1213- ASSIGNMENT 1 SEM1 2012/13
N = ((P * nc * S) + W)* (1 + 1 / nd)
where:
N is the number of gallons of paint to purchase
P is 0.004, the International Painter's constant
nc is the number of children in the vicinity of the structure to be painted
S is the surface area to be painted
W is 1.2, the expected waste for any job
nd is the expected number of days to complete the job
QUESTION 3
Car promotion is everywhere, any price and multiple models.
Specification: Write a C++ program that asks the user to enter the price of a car (real), the
down payment (real) and the number of years for the loan (integer). Calculate and output the
monthly payment (real) of that car. Assume the sales tax rate is 7% and an interest rate is 9%.
Use constant declarations for these rates.
The following formula to perform the calculations:
tax amount = price of car * sales tax rate
total cost of car = price of car + tax amount
borrowed amount = total cost of car - down payment
interest amount = borrowed amount * interest rate
loan amount = borrowed amount + interest amount
monthly payment = loan amount / number of months of loan
Note:


When displaying results to the screen, include detailed explanations so that the user
understands what he/she sees - Include the tax amount, borrowed amount, interest
amount, and loan amount in your output in addition to the calculated monthly payments,
the down payment and loan time.
Display dollar amounts as currency using $ and two decimal places.
Use the following instruction at the start of your output to display real numbers with two
decimal places.
cout << setiosflags (ios::fixed | ios::showpoint) << setprecision (2);
QUESTION 4
An electricity board charge following rate for domestic user to discharge last concession of
For first 100 units 60 per unit
For next 200 units 80 per unit
Beyond 300 unit 90 per unit
BCS 1213- ASSIGNMENT 1 SEM1 2012/13
All users are charge minimum 0.50 for all total amount if more than RM 300 than additional
charge 15% is added. Write a program to read a name of user and number of unit consume and
print out the charge with name
Download