This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Page 1 of 11 University of Toronto Faculty of Applied Science and Engineering CSC 180S INTRODUCTION TO PROGRAMMING Fall 2007 Midterm Test Solutions Instructions If you are in CSC180 and have just written this exam , please make sure that you have read over all of the solutions and understand them thoroughly before approaching your instructor about your marks. If you feel that there are issues you want to address, here are some general rules that you should be aware of before approaching any instructor: 1. I am glad to correct mathematical errors. If something was added badly, let me know and I will be happy to fix it. 2. I am less kind towards people who question the fairness of me or my TAs. If there are egregious errors that you feel compelled to bring up, keep in mind the following: a. Be nice when raising the issue. If you think that you deserve more marks, the best way to get them back is to leave your frustration and feelings of entitlement at the door. Tread carefully, and remember that a little humility goes a long way. b. Don’t nitpick. If the marker made a significant error with one of your questions, then bring it up. Don’t make a huge deal over a single mark, and definitely don’t try to haggle in the hopes of getting more marks. c. The TAs were instructed to give the class the benefit of the doubt whenever possible. Although you may be able to find little marks here and there that you could get back, we could probably find little marks to take off as well. Don’t attempt the former unless you’re willing to risk the latter. d. Wait a few days, and try to bring up all your issues at the same time. If you have not a Fall 2007 student , do NOT read these solutions until after you have attempted the original midterm . I cannot stress this enough. No matter how little time you have left to study, solutions are only meaningful if you have attempted the questions on your own first. It is with some reluctance that I make these solutions available to the public, and only with the understanding that you will not look at them until after having completed the final exam. Do not betray this trust, or I will call upon the gods of computer science to smite you. Page 2 of 11 Question 1. (25 marks) . Fundamentals . Answer the following questions by providing a very brief and direct answer. 1. (1 mark) . Write your favorite professor’s name as a string literal. 2. (1 mark) . Declare a variable that can store the length of a song in minutes. 3. (1 mark) . Declare and initialize a constant variable with the number of days in a week. 4. (1 mark) . Declare a variable that can store 100 double values. 5. (1 mark) . Assume that an integer variable called price and float variables called tax and percentage have been already declared and initialized. Write a single expression that adds price to tax , and multiplies the total by percentage ....
View Full Document
- Fall '01
- C Programming, Array, Madrid Metro, Metropolitana di Napoli, Osaka Municipal Subway, Montreal Metro