APS106H1 Midterm: APS106H1_20141_621398289205mid_2014_answers

32 views6 pages

Document Summary

Faculty of applied science and engineering. Do all work in this booklet. Do not remove the staple. An aid sheet is attached to the end of this test. Time allotted: 60 min. Question 1. (9 marks) (a - 1 mark) convert the following decimal number to binary (base 2): Answer: 4 8. What"s the output if the user enters: Answer: i%3 == 0 && i%2 == 1. Answer: 1 0. 0 2 2. 0. The fibonacci sequence is a famous number series, where each number is the sum of the prior two: For example, if the user enters n = 7, the program should output: Unfortunately, the code contains 3 errors. Carefully circle the errors, and indicate corrections beside the statements as comments (//). A file numbers. txt contains a list of integers. For example, if numbers. txt contains the following data, your program would indicate:

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers

Related Documents

Related Questions