SYSC_2006_F13_Lab_3

Exercise1

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: defined for you in main.c. le_n ● Build the project. It should build without any compilation or linking errors. ● Execute the project. The test harness will run. Read the console output carefully. The output shows when s e p i is about to be called, the values that are being passed as arguments, le_n the result we expect the function to return, the actual value returned by the function, and a summary of how many tests passed and failed. ● The harness will report several errors while it tests the functions you'll complete for Exercises 1 through 7, which is what we'd expect: you haven't started working on these functions. Exercise 1 We have a loud talking parrot. Write a function named p r o _ r u l that has two parameters: arttobe _olpro_rul(Bo tlig ithu) Bo arttobe_ol akn, n or; Parameter t l i g s t u if the parrot is talking, and parameter h u is the current hour in the a k n i r e or range 0..23. We are in trouble if the parrot is talking and the hour is before 7 or after 20. The function should return t u if we are in trouble; otherwise it should return f l e re as. Exercise 2 Write a function named m x 0 0 hat has two parameters: a 1 2 t itmx00ita itb; n a12(n , n ) Parameters a nd b re positive integers values. The function should return the larger value that is in the a a range 10..20 inclusive, or return 0 if neither value is in that range. Exercise 3 Write a function named i t m x hat has three parameters: n _ a t itmxita itb itc; n_a(n , n , n ) Parameters a b nd c re integers values. The function should return the largest of the three values. , a a Exercise 4 The squirrels in Palo Alto spend most of the day playing. In particular, they play if the temperature is 3 between 60 and 90 (inclusive). But, if it is summer, the upper limit is 100 instead of 90. Write a function named s u r e _ l y hat has two parameters: q i r l p a t _olsure_lyittm,_o...
View Full Document

This lab report was uploaded on 03/28/2014 for the course SYSC 2006 taught by Professor Schram during the Spring '12 term at Carleton CA.

Ask a homework question - tutors are online