Room Painting Cost Calculator: Estimate Painting Costs Easily

Verified

Added on  2019/09/13

|8
|1070
|428
Project
AI Summary
The assignment is to create a program that calculates the cost of painting a room. The program takes input from the user including the length and height of the room, the quality of paint, and whether an undercoat is needed or not. It then uses this information to calculate the total cost of painting the room. The program includes a help system that provides additional assistance to the user if needed.

Contribute Materials

Your contribution can guide someone’s learning journey. Share your documents today.
Document Page
TASK 3:
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,standar,economic luxur
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:

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Code Print :
Document Page
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 :
Document Page
Code print with help system included

Secure Best Marks with AI Grader

Need help grading? Try our AI Grader for instant feedback on your assignments.
Document Page
Tools:
1)Ubuntu 16.04
2)For compiling and running tool used :Ubuntu terminal
->g++ task3.cpp
->./a.out
3)IDE used : Geany in Ubuntu
4)language : c++
Reasons for the tools and techniques used:
Using ubuntu it was easier to directly see the output in terminal without using any IDE though i
used Geany for code print .The screenshots of running code is of the terminal.The choice of
language was done based on ease of writing code and proper documentation which can be done.
TASK 4
Testing plan :
The program takes user choices many times and so there are different paths through which program
can proceed which is described in flowchart below :
Enter length
Document Page
Help system
The test plan will include taking all the corner cases and paths.Some test cases are:
1)
length=2
height=3
paint quality=1
Enter height
Enter choice of paint quality
Undercoat paint
Luxury EconomicStandard
Cost Cost Cost
Calculate area
Help needed
Yes No
Enter 1 or 2 depending on your help choice
1 2
Display difference in cost withundercoat paintDisplay the cost of different qulity of paint
Help needed
exit
Document Page
undercoat=0
output:
cost=£56
2)
length=4
height=3
paint quality=2
undercoat=1
output:
cost=£120
3) with help included
length=2
height=3
paint quality=1
undercoat=1
help=1
help choice=1
exit help or not=0
help choice=2
exit help or not=1
output:
cost=£72
We can calculate manually to verify the results obtained in the test cases.
Data dictionary -
length : length of room,
height : height of room,
type: quality of paint (1, 2, 3)
extra : needed undercoat or not (1 ,0)
help :help needed or not(1, 0)
exit : if user wants to exit help system or not (1,0)
helpchoice : to choose between two help choices (1 , 2)
cost : cost of painting
area : area of room to be painted
Feedback from other users -
User1 feedback : The help system is really interactive and covers all sort of choice of help a user
may need in this program
User 2 feedback : The Program is simple and easy to use.
User 3 feedback : the progrm is easy to understand with functions properly defined
Checks against the original specifications - This is done considered using corner cases and
various tests cases

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Evaluation of the program -
Good features:
1) the program is properly documented
2) it considers all the corner cases
3) help system is really interactive
4) the progrm is easy to understand
5) separate function is made to calcualte the cost which makes the code look clean
Bad features:
1) The help system could have been separated in function like the find_cost function
2) The help system can be modified to cover other sorts of choices to help a user
1 out of 8
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]

Your All-in-One AI-Powered Toolkit for Academic Success.

Available 24*7 on WhatsApp / Email

[object Object]