Answered step by step
Verified Expert Solution
Question
1 Approved Answer
BIT 2 4 0 0 Assignment A 0 1 Painting a room 2 . 0 A friend of yours created a program in C language
BIT
Assignment A
Painting a room
A friend of yours created a program in C language for calculating amount of paint needed for
painting a room and how much it would cost to apply multiple coats of paint to that room. Your
friend didnt use any functions in their code. In this assignment, you will encapsulate the code into a
class and methods as needed.
The Problem
The main goal of this assignment is to test your understanding of the basics of C that are covered
up to this point of the semester classes access specifiers and methods
a You have to update the provided code BITAstart.cpp file to use classes and
methods. To do so you update the provided solution from C language to use C
elements instead.
b Use the following class as your starting point. You are not allowed to change the access
specifiers of any these variables. However, you can add methods and other members as
needed.
The reason for this restriction is to test your understanding of how to useaccess public
and private member variables outside the class, ie in main
If you create any functions, they have to be member methods of the provided class.
c Create a class constructor that will set the values of Height Width and Length based on
user input. It will also calculate and set the rooms area based on these values. points
d Create a class destructor that will be used to reset the values of all member variables to
zeros point
e In the original assignment, the price of a can of paint is fixed $ in this assignment you
have to prompt the user to enter the price of a can of paint. point
f Create a method member function that will be used to calculate the price of a coat of
paint based on the number of coats or coats and the price of a can of paint.
points
Below is the marking
scheme that the TA will
follow while marking
A
Commented RS: If they modify the access specifiers of
any of the provided members, they will receive a zero
Commented RS: If they create all their methods as
regular functions that are not methods of the class, they will
get of the final grade
Dr Rami Sabouni BITITEC Summer
g Since we have private members of the class, you cannot access them directly, therefore,
you need to use setters and getters. points
h For outputting the amount of paint needed, number of cans and price of each coat of
paint, use a loop to show the results for and coats of paint. point
i Since we didnt cover cin and cout at this point, you must use printf for outputting to the
console and scanf for retrieving user input point
No calls to printf or scanf should be used in any of the methods. All calls have to
be made in the main
Sample output:
Commented RS: If they use cin or cout, then they will get
of the final grade
Commented RS: They will receive a deduction if
they use scanf or printf in methods
Dr Rami Sabouni BITITEC Summer
Assignment requirements
Name your project firstnamelastnameA
Divide your solution into multiple files maincpp PaintJob.cpp and PaintJob.h
Move the cpp and h files into the folder create above.
Dont use any global variables
You have to properly assign data types based on what is needed example unsigned char if
you variables maximum value is and minimum is
This assignment is to test your understanding of classes, methods, access specifiers, setters and
getters
o You have to use the provided class
o You have to use setters and getters
o You have to use methods
You should add comments to your code
Dont use anything that we havent discussed up to this point in the material.
You must use CLion to implement your solution.
There might be similar ideas available online: if you use any code that is available online
you will receive a zero.
You have to solve the assignment on your own without the help of others.
Make sure to submit only cpp and h files and nothing else. Submitting other files can result in
a zero on the tutorial.
Only accepted extension is zip"
Once you are done solving the assignment Follow these instructions to prepare you solution to
be submitted. Failure to follow the instructions will result in a deduction regardless of
whether your solution works or not:
No email submissions are allowed. You will receive a zero if you miss the deadline or submit
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started