CSE 142 Homework 1



introduction

In this homework, you'll be applying your programming skills to write a program to help a computer store, CompuSell. CompuSell has a discount pricing scheme that is a little too complicated for their sales staff to estimate order prices quickly for prospective customers. CompuSell has contracted you to write a program to assist their sales staff by automating discount pricing computations.

key concepts

In this section, for most homeworks, we'll provide a list some of the relevant concepts. Don't forget, however, that CS is a lot like math in that you can never afford to forget concepts you learned earlier in the course; every new homework and programming concept builds on previously learned ones. In addition, later in the quarter, determining which concepts you should apply might well be part of your homework.

In this homework, keep an eye out for...

task description

Your program will be used by CompuSell sales representatives to quickly compute price estimates for prospective customer's orders and determine whether the order price is within the customer's budget.

CompuSell's pricing scheme

CompuSell's pricing scheme favors customers who buy many computers:

example price computation

For instance, if the customer wants 15 computers, the order consists of 2 Super Sixpacks plus 3 more computers. For a customer whose Super Sixpack discount is $350, each Super Sixpack costs $8399.94 minus $350, yielding a per-Sixpack cost of $8049.94. The total price would be twice this plus three times $1399.99: $20299.85.

specifications

Your program should start by reading the Super Sixpack discount for the current customer. This and all other monetary figures should be read and stored as floating-point numbers (type double).

Next, the program should compute and display the cost of a Super Sixpack of computers and the discount which was just read for this customer.

Your program should then read the number of computers the customer wishes to buy. (It should be clear that only an integer value makes sense here.)

Next, it should read the customer's budget, i.e. how much money the customer has available to spend on this order.

Finally, the program should then compute and display the following:

Your program should run just like the sample executable provided below. The computed numbers should be exactly the same. Just as important, the order of the inputs should be exactly the same, i.e. in this case, (1) discount first, (2) number of computers, (3) budget. The wording in the text doesn't have to be identical, but the order of the inputs and outputs and your computed numbers must match exactly.

programming guidelines

Use #define macros for the following constant values:

submission guidelines

Be sure to read the homework submission guidelines, linked on the course home page in the Announcements section. As usual, you will have to submit your work (1) via the web using the page linked below and (2) on paper.

The due date for this assignment is at the top of this page. See the homework submission guidelines page for the exact times for the deadlines. Be especially respectful of the web submission deadline, as submission times are tracked extremely precisely by computer. We cannot accept late submissions.

files


a few bits of advice

announcements

If any clarifications or changes need to be made for this homework, they will be posted to the cse142-announce email list and linked here.


Return to main Homework page...
Last modified: Wed Oct 20 17:54:38 PDT 1999