

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Part A: Write an algorithm (in English) for this problem definition: You want to convert the number of days until Christmas to the number of hours until Christmas, the number of minutes until Christmas, the number of seconds until Christmas and finally the number of months until Christmas. The number of days should be provided by the user. Have the TA check your algorithm. Part B: Convert your algorithm to C++ code using integer variables. Your program should then output the number of hours until Christmas, the number of minutes until Christmas, the number of seconds until Christmas, and the number of months until Christmas (assume 1 month = 30 days) each on a separate line. Your output should look something like this: Enter the number of days until Christmas: 10 There are 240 hours until Christmas. There are 14400 minutes until Christmas. There are 864000 seconds until Christmas. There are 0 months until Christmas. Now change the integer variables to double variables and rerun your program. Demonstrate your program to the TA. Part C: Find a partner that has completed Part A and B. Each partner should deliberately change their partner’s code to cause a syntax error. Each time, you should recompile your own code, find the error and correct it. Keep a log of all errors and their corrections. Some examples to use are: Omit a semi-colon Add a space just before “iostream” in the Include Directive Omit any symbol Omit and/or misspell a keyword Etc. Be creative!! Show your error/correction log to the TA. NOTES: Every submission in this course (including this program, all assignments, lab work, quizzes & exams) must include the following details at the top: Name in the format Last name, first name Last 4 digits of your student ID
Lecture section / Lab section (e.g. section 001/025) In addition, for all lab-related submissions, include your lab id (in the form cs10xx)
After the first week you will lose points for failing to observe these instructions – in fact, if enough of this information is missing or illegible, we may not be able to assign you a grade, so double check every assignment before you turn it in.