Monkey Bananas

3
 Dr. Tolga Soyata. © U of R, Electrical and Computer Engineering, [email protected] ECE114 Exam0 Exam Period : 2PM - 3:15PM Submission Period : 3:10PM - 3:15PM. No exceptions SUBMIT THROUGH BLACKBOARD  You are required to submit your p rogram(s) within the f ive minu tes after th e exam through Blackboard. You may not work on your programs after 3:10PM.  Your su bmission will be time stamped by Black board. A ny submis sion after the allowed period will be graded as zero. In this exam, you will be required to write two programs within 70 minutes. You are not allowed to text anyone, talk to anyone, call anyone, or access the internet during the exam. You can use the calculator in Windows (calc.exe). Your computers will be unplugged from the internet during the exam and plugged back in at the end of the exam. Once you are back on the internet after the exam, you will have 5 minutes to submit your code through Blackboard. ECE114 Exam0 10 points MINI CHEAT SHEET: Example for() loop syntax: Example do{} loop syntax: Example while() loop syntax: for  (a=0; a<10; a++){ do{ while(t<45){    } } while(a>5); } Example scanf() syntax for user input: scanf ("%lf",&f) // use %lf for double scanf ("%f",&f) // use %f for float scanf ("%d",&x) // use %d for int 

Transcript of Monkey Bananas

8/11/2019 Monkey Bananas

http://slidepdf.com/reader/full/monkey-bananas 1/3

8/11/2019 Monkey Bananas

http://slidepdf.com/reader/full/monkey-bananas 2/3

Dr. Tolga Soyata. © U of R, Electrical and Computer Engineering, [email protected]

Program 1 (5 points): listnum.c

Write a program that displays numbers from -10 to +9 , their squares, and square roots in a nicelyformatted fashion. If the number is negative, it should write Complex in the square root column. You

have to use a for() loop, while() loop, or a do{} loop. Any one of these is acceptable.Program 1 grading tips : Nice formatting is 1 point, functionality is 3 points , careful “casting” andtechnical quality as well as careful bracketing the statements is 1 point. Using a bunch of printf()statements to create this output will get you zero points !!! You have to do it with a loop !!!

Program 1 Expected Output:

8/11/2019 Monkey Bananas

http://slidepdf.com/reader/full/monkey-bananas 3/3