[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Guys I really need help with this computer science assignment.

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 6
Thread images: 1

File: Matrix2.jpg (407KB, 1440x900px) Image search: [Google]
Matrix2.jpg
407KB, 1440x900px
Guys I really need help with this computer science assignment. I don't understand it at all.


In this assignment, you are asked to write a program for an online carpet store to process installation orders. Each order includes the following information: (1) name of the customer, (2) number of rooms, (3) size of each room, type of carpet (premium or standard), and (5) distance for delivery. The charge information on an order is as follows:

The price of a square foot of a premium carpet is $25 and a standard carpet is $10.
A 20% off discount is applied to the total charge (before adding delivery fee) when a customer orders carpet for more than 1000 square feet.
If the distance is 0 (i.e. self-pickup), no delivery fee. Otherwise, it is $2.50 per mile.
Price of installation is $5 per square foot.
In order to reduce the complexity of the program, assume each order contains no more than 5 rooms.

Customers may order different types of carpets for different rooms.

You may use the Rectangle Class as a guide.

Requirements:

Note: All variables should be defined as local variables (i.e., global variables are not allowed to use except of global constants) in the program. Otherwise, half of the points will be taken away from the following steps.
Create and define a CarpetOrder class. The class should include:
[5 points]Attributes (member variables): (1) length of each room, (2) width of each room, (3) type of carpet.
[10 points] Activities (member functions): (1) constructor(s), (2) getters and setters for each attribute, (3) method for calculating the area of a room, (4) method for computing the carpet cost for the room based on the carpet type.
[15 points] In your main function
Prompt the user to enter name. Note: use getline(cin, identifier); statement to read string type input into 'identifier'.
Prompt the user to input number of rooms.
>>
While the input is invalid, keep prompting the user to re-input (integer between 1 and 5). You should create a function to check the validity of the input information.
Prompt the user to enter delivery distance. The delivery distance must be between 0 and 50 miles.
Create an object for each room/space using an array of objects. For example, Room room_list[5]; creates an array of five Room objects.
Prompt the user to enter length, width, and carpet type for each room. While the input is read, use setters to define the length, width, and carpet type of each room.
Compute the total charge for the order. Include a function for computing the total charge (including the carpet cost, installation fee, discount if any, and delivery fee)
Print the order information. Information to be printed: customer name, number of rooms, size of each room, type of carpet, and cost of the carpet for each room.
Print total area, the distance for delivery, amount of discount, total charge (including delivery fee) at the end.


[2 points] For the CarpetOrder class, define a header file (.h file) for class declaration and a .cpp file for member function definitions/implementations.
[3 points] Add sufficient comments and make your program, especially the main function, as concise as possible.


Guidelines for programming assignment:
For your final program please add the following comments to the main function
/*

* Names of classes you defined:

* Date of creation:

* Date of modification:

* Author:

**/

Please comment your code to describe what you are doing. Your creativity is welcome.
Please choose meaningful variable names and avoid the variables such as h1, d1, etc.
You should debug and test your program to make sure your program has no syntax and logical errors. If you have any problem running your code, please document them by comments as well
>>
A sample output:

This program will calculate the cost of carpet installation.
Please enter your name: Ray Smith
Enter the number of rooms: 3
Enter distance for delivery: 30

Enter the length of the first room: 20
Enter the width of the first room: 30
Enter carpet type (p for premium carpet, s for standard carpet): p


Enter the length of the next room: 20
Enter the width of the next room: 40
Enter carpet type (p for premium carpet, s for standard carpet): s


Enter the length of the next room: 10
Enter the width of the next room: 30
Enter carpet type (p for premium carpet, s for standard carpet): s

The following is your order details:

Customer name: Ray Smith
Number of rooms: 3
Delivery distance: 30 miles
Room 1 information: Size: 20x30, Carpet type: Premium, Cost of the carpet: $15000
Room 2 information: Size: 20x40, Carpet type: Standard, Cost of the carpet: $8000
Room 3 information: Size: 10x30, Carpet type: Standard, Cost of the carpet: $3000


Total area: 1700 square feet
Cost of the Carpet: $26000
Cost of installation: $8500
Discount : $5200
Delivery charge: $75
Total amount: $29375
>>
>>8550601
>>8550603
>>8550605
Trivial
>>
>>8550610
sorry I just can't understand. I have references but I can't understand anything from them.
>>
>>8550611
What is it that you don't understand? The mathematics behind the program or the programming language itself?
Thread posts: 6
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.