Answered step by step
Verified Expert Solution
Link Copied!

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

BIT2400
Assignment A01
Painting a room 2.0
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 BIT2400_A01_start.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 use/access public
and private member variables outside the class, i.e. 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. (2 points)
d) Create a class destructor that will be used to reset the values of all member variables to
zeros (1 point)
e) In the original assignment, the price of a can of paint is fixed (35$), in this assignment you
have to prompt the user to enter the price of a can of paint. (1 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 (1,2, or 3 coats) and the price of a can of paint. (2
points)
Below is the marking
scheme that the TA will
follow while marking
A01
Commented [RS1]: If they modify the access specifiers of
any of the provided members, they will receive a zero
Commented [RS2]: If they create all their methods as
regular functions that are not methods of the class, they will
get 50% of the final grade
Dr. Rami Sabouni BIT2400/ITEC2400 Summer 2024
g) Since we have private members of the class, you cannot access them directly, therefore,
you need to use setters and getters. (2 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 1,2, and 3 coats of paint. (1 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 (1 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 [RS3]: If they use cin or cout, then they will get
50% of the final grade
Commented [RS4]: They will receive a 25% deduction if
they use scanf() or printf() in methods
Dr. Rami Sabouni BIT2400/ITEC2400 Summer 2024
Assignment requirements
Name your project firstname_lastname_A01
Divide your solution into multiple files (main.cpp, 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 230 and minimum is 0)
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 25% deduction regardless of
whether your solution works 100% 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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Sham Navathe

4th Edition

0321122267, 978-0321122261

More Books

Students also viewed these Databases questions

Question

List the different categories of international employees. page 642

Answered: 1 week ago

Question

Explain the legal environments impact on labor relations. page 590

Answered: 1 week ago