Be careful that you must take the input in the order

This preview shows page 1 - 2 out of 2 pages.

A program that just compiles need not get more than 0 points. Be careful that you must take the input in the order as indicated in the question and examples, and you must give the output as shown in the examples ( DO NOT write anything on the screen other than the output. DO NOT write any string like “The output is…” . Also DO NOT take any extra input (e.g. DO NOT put a scanf function at the end of your program). For input and output, always use scanf and printf functions, DO NOT use getchar and putchar or getch, putch. Also DO NOT use fflush() function. By signing below, I admit that I have read and understood the explanations above. Signature : ……………………. Question 1 (25 points): A program is given that gets a number of temperature values and outputs the total of these temperatures. Some of the functions are omitted, complete these functions so that the program works as it should be. There are several rules in the system; 1) Each temperature input is given with a number code, the codes have different meanings: Code 1 : Use the temperature as it is Code 2 : The temperature is given in Fahrenheit, so convert it to Celcius before calculation Code 3 : Use the temperature as it is, but do not read any more values from the user 2) Only accept the temperature value if it is between (and including) -20 and 40 degrees (after conversion to Celcius if the code is 2). HINT: Relation between Fahrenheit to Celcius degree values is as follows 100 180 32 C F = - Input: 1-10 1-90 1-3 3-15 Output: 28 Input: 2-50 1-87 1-34 3-10 Output: 54 Input: 1—4 2-10 3-15 Output: -1 Question 2 (25 pts.)
Image of page 1

Subscribe to view the full document.

Image of page 2
You've reached the end of this preview.
  • Spring '09
  • TT
  • supervisor, Natural number

{[ snackBarMessage ]}

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