Quality of Paint Assignment

Added on - 16 Sep 2019

Trusted by 2+ million users,
1000+ happy students everyday
Showing pages 1 to 4 of 15 pages
TASK3:
Input: length of room,height of room, quality of paint,needed undercoat or not
output:cost of painting
user need:user should know what quality of paint he/she needs and whether he wants
extra undercoat or not,also he should know height and length of the room
processes: we first calcualte the area using height and length and then multiply the
area with the cost of paint and add the cost of undercoat if it is to be applied
purpose: purpose is to know the cost of paint needed to paint the room
Pseudo Code
Input->length
Input-> height
Input->choice of paint quality(1,2 or 3)
Input->undercoat paint choice(1 for yes , 0 for no)
call function find_cost(length,height,choice of paint quality,undercoat paint
choice) //thsi function returns the cost of painting
print->cost
end
Pseudo Code for function
find_cost(ength,height,choice of paint quality,undercoat paint choice)
calculate area->2*length*length+4*height*length
//choose paint quality cost
if choice of paint quality=1
then cost=1.75 per sq metre
if choice of paint quality=2
then cost=1.00 per sq metre
if choice of paint quality=3
then cost=1.45 per sq metre
// undercoat paint choice
total cost= cost*area;
if undercoat paint choice=1
then total cost=total cost+0.50*area
return total cost
User Interface :
user interface is included in code to make the program more user friendly
1) user is first asked about the length of the room he/she intend to paint
2) then he is asked to enter the height of the room
3) there are 3 types of quality of paint which can be chosen
from :luxury,standard,economic ,luxury being the costliest and economic being the
least quality
4)also user has the freedom to choose whether he wants an undercoating or not
5) the output cost is displayed to the user based on his choice of inputs above
Screenshots of running program:
Code Print :
With Help System Included
Explanation :
In the code the user is given choice whether he wants help or not.
The help system provides help to user in two ways:
1) if the user wants to know the cost of different qualities of paint he can press 1 to do
2) if the user wants to know the difference in cost when he chooses undercoat paint
he can press 2 for this
Again the user is asked if he wants to exit help system , the user can choose to exit. If
he doesn’t exit then again he is taken to the same procedure described above. If he
exists the help system, the final cost of painting will be calcualted and shown to him
as output as done in previous code
Screenshot of running program with help system :
Code print with help system included
Desklib Logo
You are reading a preview
Upload your documents to download or

Become a Desklib member to get access