Trusted by 2+ million users, 1000+ happy students everyday
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 extra undercoat 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 the cost 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 function returns 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 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*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 luxur being 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 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 do2) if the user wants to know the difference in cost when he chooses undercoat paint he can press 2 for thisAgain 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 codeScreenshot of running program with help system :
Found this document preview useful?
You are reading a preview Upload your documents to download or Become a Desklib member to get accesss