If your submitted code can not be compiled you will

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

If your submitted code can not be compiled, you will get 0 points from that question. No partial credit will be given to non-working programs. 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 : ……………………. Q1 (25 Points) Write a program which calculates the circumference of some circles or some squares. The program reads one integer, one character, and one float as input. The integer is the number of circles or squares, the character represents the square or circle ('S' for square and 'C' for circle) and lastly the float is the side length for square or radius for circle. The program will calculate the circumference of the input shape type and print number of squares or circles, type of the shape calculated ('S' for square and 'C' for circle) and the result with three digit precision. If the user enters invalid input (unknown type of
Image of page 1

Subscribe to view the full document.

Image of page 2
  • Spring '09
  • TT
  • supervisor, Input/output, time slot

{[ 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