Study Guide 03.docx - COSC-1337 Study Guide 03 1 How many...

This preview shows page 1 out of 1 page.

01/26/2018 COSC-1337 Study Guide 03 1. How many return values may a function have? one 2. Write a header for a function named distance. The function should return a double and have two double parameters: rate and time. double distance(double rate, double time) 3. Write a header for a function named days. The function should return an int and have three int parameters: years, months, and weeks. int days(int years, int months, int weeks) 4. What is the difference between a static local variable and a global variable? A static local variable's scope is limited to the function in which it is declared. A global variable's scope is the portion of the program beginning at its declaration to the end. 5. What kinds of values may be specified as default arguments? Literals or constants 6. Write the prototype and header for a function called compute. The function should have three parameters: an int, a double, and a long (not necessarily in that order). The int parameter should have a default argument of 5, and the long parameter should have a default argument of 65536.
Image of page 1
  • Summer '16
  • Subroutine, default argument

{[ snackBarMessage ]}

Get FREE access by uploading your study materials

Upload your study materials now and get free access to over 25 million documents.

Upload now for FREE access Or pay now for instant access
Christopher Reinemann
"Before using Course Hero my grade was at 78%. By the end of the semester my grade was at 90%. I could not have done it without all the class material I found."
— Christopher R., University of Rhode Island '15, Course Hero Intern

Ask a question for free

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern