Things You Should Know Before Painting a Room

Added on - 13 Sep 2019

  • 8


  • 1070


  • 311


  • 0


Trusted by +2 million users,
1000+ happy students everyday
Showing pages 1 to 3 of 8 pages
TASK 3:Input:length of room,height of room, quality of paint,needed undercoat or notoutput:cost of paintinguser need:user should know what quality of paint he/she needs and whether he wants extraundercoat or not,also he should know height and length of the roomprocesses: we first calcualte the area using height and length and then multiply the area with thecost of paint and add the cost of undercoat if it is to be appliedpurpose: purpose is to know the cost of paint needed to paint the roomPseudo CodeInput->lengthInput-> heightInput->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 functionreturns the cost of paintingprint->costendPseudo Code for functionfind_cost(ength,height,choice of paint quality,undercoat paint choice)calculate area->2*length*length+4*height*length//choose paint quality costif choice of paint quality=1then cost=1.75 per sq metreif choice of paint quality=2then cost=1.00 per sq metreif choice of paint quality=3then cost=1.45 per sq metre// undercoat paint choicetotal cost= cost*area;if undercoat paint choice=1then total cost=total cost+0.50*areareturn total costUser Interface :user interface is included in code to make the program more user friendly1) user is first asked about the length of the room he/she intend to paint2) then he is asked to enter the height of the room3) there are 3 types of quality of paint which can be chosen from :luxury,standar,economic luxurbeing the costliest and economic being the least quality4)also user has the freedom to choose whether he wants an undercoating or not5) the output cost is displayed to the user based on his choice of inputs aboveScreenshots of running program:
Code Print :
With Help System IncludedExplanation :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 do2) if the user wants to know the difference in cost when he chooses undercoat paint he can press 2for thisAgain the user is asked if he wants to exit help system , the user can choose to exit. If he doesn’texit then again he is taken to the same procedure described above. If he exists the help system, thefinal cost of painting will be calcualted and shown to him as output as done in previous codeScreenshot of running program with help system :
You’re reading a preview
Preview Documents

To View Complete Document

Click the button to download
Subscribe to our plans

Download This Document