View the step-by-step solution to:

ITCS 1212 Programming Assignment 5 Spring 2010 All work MUST be your own. This means do not give your code to anyone else to look at and do not look...

Could you look at the attached document and write the code for me in C++?
ITCS 1212 Programming Assignment 5 Spring 2010 All work MUST be your own. You may not share your code or receive any code pertaining to this assignment from any other student or Internet sources. This means do not give your code to anyone else to look at and do not look at anyone else’s code. Any violation is a violation of the Academic Integrity Policy of UNCC. Due: Sunday May 2 by 11:59 pm to your lab BB site Carpet Purchase You are to write a program that calculates the cost of a carpet purchase and installation. The input to the program is the length and width of the room in linear feet, and the type of carpet. The output of the program is the total cost. Break this program up into functions, each of which performs one well-defined task. The job of main( ) will be to call all of these functions, sending the correct actual parameters. Funtions: getInput( ) – this function has three alias formal parameters. This function’s purpose is to read and validate input from the user. The input is the length and width of the room in linear FEET. These values must be greater than zero and no greater than 30 feet. The next input is the type of carpet, either B (Berber), S (Shag), P (Pile), and L (Luxury). This function does not return a value. (hence the use of alias parameters) calculateArea( )- this function takes in the length and width and returns the area of the room in square yards . determineUnitPrice( )- this function takes in the type of carpet and returns the unit price for carpet and installation according to the type of carpet. Berber is $15 per square yard, Shag is $11 per square yard, Pile is $13 per square yard, and Luxury is $20 per square yard. (hint- use a switch statement) calculatePrice( )- this function takes in as parameters the area of the room in square yards and the unit price per square yard for the carpet. This function returns the total cost for carpet and installation. main( )calls each of the functions and prints the final cost . Use a loop in main( ) so the user can run through this process as many times as he or she wants to test different carpet types and room sizes. The user will enter a ‘Q’ when he or she is finished. This should be the only input in the main function . Do not use any global variables , only variables you declare in main and local variables you may declare in the functions. (a global variable is a variable declared above main( ) ) Document the top of each function, stating the function purpose. Use meaningful identifiers and inline comments. All usual documentation standards apply.
Background image of page 1

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question