Sunteți pe pagina 1din 3

CSC128: Fundamentals of Computer Problem Solving

ASSIGNMENT 1
Name :_______________________________________________________
Matric No :_______________________________________________________
Group :_______________________________________________________
Form a group (maximum 4 students) and answer all the questions.
(Date of submission: 8 January 2012)
1) Write a problem analysis and the algorithm design for each of the
following:
a) program which will input the price and number of items
purchased b! a customer and displa! the total amount that he"she
has to pa!# ssume onl! one t!pe of item is being purchased b! the
customers#
b) $nput a person%s name and age from &e!board and output them#
'(ample : )ame : li *in
ge : 18
c) program which will displa! a new salar! based on an increase
of 1+,-
d) Write a complete C.. program that prompts the user to enter
the following input data:
/ength and width of room#
0he si1e and unit price of a tile#
2our program should be able to generate a report as follow
CSC128: Fundamentals of Computer Problem Solving
Hello, Welcome!!
This program calculates the cost to tile a house.
- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Enter length of room in feet: 8
Enter width of room in feet: 10
Enter sie of tile in inches s!uare: "#
Enter unit price of tile: $.$0
The area of the house to tile: 80 s!uare feet
Total of tile needed to tile the room: 181 pieces
Total price of tiles used to tile the room is %& '(8.$0
)ote:
- 1 feet 3 12 inches
- Formula to calculate total of tile needed:
Tiles)eeded * room+rea , 1$ , -1$ . sieTile/ 0 1
e) 4iven the following formula:
side1 * m
$
0 n
$
side$ * $mn
5sing these formula- write a program that accepts the value m and n
input b! the user the calculate and displa! the value of side1 and
side2#
CSC128: Fundamentals of Computer Problem Solving

S-ar putea să vă placă și