Register your course Web page account and configure your profile information. You can do this by selecting the `registration' section of www.cburch.com and using the registration ticket handed out in class via page 99 of your textbook.
Also, complete Poll 1, accessible through the `polls' section after you log into the Web page. You must register your account before doing this.
The written portion is due 2:30 pm, Monday, July 5. Your submission must be uniquely yours, but you may certainly brainstorm with students and staff. Prominently list all such collaborators on what you submit. You may submit your written work either on paper via the dorm's mail room or electronically via the Web page.
Problem Missing-Card:We saw a silly algorithm for this in class; for this problem, you should think of two significantly different, more serious alternatives for Missing-Card.
- Input: 51 cards, each labeled uniquely between 1 and 52.
- Output: the number missing from the deck.
Describe and write pseudocode for each of these two algorithms, and compare their merits. Page 18 of the textbook (``Design the program...'') lists several criteria that you could consider, but for this real-world scenario you may think of others too. The comparison should be at most 3-4 sentences.
Program 1 is for you to get acquainted with CMU's system; it won't be evaluated and so it has no due date. But Program 2 is due 2:30 pm, Monday, July 5.
You may work in teams of up to three people on programming assignments. Your team's submission must be uniquely its own work, but you may brainstorm with other students and staff. Prominently list all such collaborators on what you submit. You must submit the program electronically via the Web page. Only one person per team should submit the program.
The user should be able to type as many entries as desired; but when the user types zero, the program exits. (Using zero this way allows you to read the user-typed value into a double instead of doing something more complicated.)To add? 30.25 + 30.25 = 30.25 To add? -20.30 - 20.3 = 9.95 To add? 998.23 + 998.23 = 1008.18 To add? -447.88 - 447.88 = 560.3 To add? 0.0
A completely correct program will work exactly as the example demonstrates (down to the last character). Notice that this means you should not worry about printing exactly two decimal places for the pennies.
We will also evaluate your program on neatness and readability. Page 18 of the textbook (``Make your program readable'') describes some of the more important elements of writing a readable program.