Project 1 - Quinn's Quartzite Quarry

Part 1: Project Design due September 20th, through Blackboard
Part 2: Project Code due September 27th, before class, through Blackboard.

With a whole 3 weeks of computer programming experience, a desperate quartzite quarry owner named Quinn has asked you to develop a program for her that will help determine how much a particular countertop piece order will cost. Currently, she is doing it all by hand which is error prone and slow. Fortunately, your skills are up to this task.

Each countertop piece is cut from stone blocks that allow for counter pieces that are, at most, 10 feet by 4 feet. Quinn carries several types of stone, as shown below:

  • Marble, at $92.99/sq ft installed
  • Granite, at $78.99/sq ft installed
  • Quartz, at $56.99/sq ft installed
  • Soapstone, at $39.99/sq ft installed

Each countertop priced by its finished size, which is a rectangle with a depth (from front to back) and length (along the face) measured in inches. The amount of material required, in sq ft, is 20% higher than the finished piece due to wastage as the piece is cut.

Additional finishing is possible for each countertop. Exposed edges can be finished (by smoothing and polishing) for $4.99 a linear foot. The entire slab can be polished for an additional 15% over the base square foot material charge.

What Quinn is asking that you write a program that takes as input:

  • The length and depth of the countertop
  • The type of stone
  • How many edges are finished
  • and if the piece should be polished

As output, she needs the following information:

  • The cost of the stone
  • The cost of the edging
  • The cost of the polishing
  • The total cost of the above
  • The integer number of square feet of material needed for starting fabrication
  • The length and depth of the countertop
  • If it is to be polished

Here is some sample output from a program that implements the algorithm required for this project:
Welcome to Quinn's Quartzite Quarry Countertop Quoter. This program computes the cost of a single finished rectangular countertop piece. Before running this program you will need the depth and length of the counter, which edges are to be finished and the edge style, as well as the grade of stone to be used and the stone finish. Please enter the depth of the countertop in inches: 25.5 Please enter the length of the countertop in inches: 61 Number of long edges to be finished: 1 Number of short edges to be finished: 1 Please choose a grade of stone: A) Marble B) Granite C) Quartz D) Soapstone Selected grade: D Would you like a polished surface (y/n)? n Cost Information Stone Cost: 431.98 Polishing Cost: 0.00 Edge Cost: 35.97 Total: 467.94 Fabrication Information Square Feet of Stone needed: 13 Length: 61.00 Depth: 25.50 Polishing: No Finished edges: long: 1 short: 1 Please note the neat alignment of the output.

You will be able to experiment with the program above to test your own against it. To do so, run the following commands on cs-class. cp ~clay/qqq.exe . ./qqq.exe This will copy the working binary program to your directory where you can run it to test against. If you can turn the binary back into source code, then you should be in a different CS class, a much more advanced one..

Part 1 - Design Document

For the first part you are to submit a design document showing the algorithm you plan to implement. DO NOT GIVE SUBMIT A FLOWCHART. Instead, write it out neatly using a language which is similar to that from Homework 1 and has the following terms:
  • start
  • input
  • output
  • calculate
  • if condition, then statement
  • if condition, then statement; otherwise, statement
  • stop
If you need to group multiple statements together, say in an if statement, use
    begin
       statement
       ...
       statement
    end
A copy of your algorithm is due before class on the 20th through Blackboard.

Part 2 - Program Source Code

Important: Your output and input should be very similar to that shown in the example program. Please ask for the input in exactly the same order shown and only request the same items shown - do not ask for any other input. This will assist in grading your program.

I expect your program to have the following features, similar to the one that you can run to compare your program to:

  • All input must be checked to make sure that the values are reasonable. For now, if you detect unreasonable input, the program can just print an error message and halt. You do not have to detect type errors, such as people entering letters where the program expects numbers.
  • You should declare values that are fixed as const and use the declared constants in your calculations.
  • Your output should be neat and aligned similarly to that of the example above and of the example program.

Include the following header in your source code. // // Project 1 // Name: <your name> // Netid: <your netid> // COSC 051 // Section: // In accordance with the class policies and Georgetown's Honor Code, // I certify that I have neither given nor received any assistance // on this project with the exceptions of the lecture notes and those // items noted below. // // Any help items: // // Description: <Describe your program> //

You will submit your source code through Blackboard. This is the .cc file. Do not submit the compiled version! I don't speak binary very well.