Lab4 - Winter 2013 WSU CSC 2000 Introduction to C Programming Language Lab 4(100 points Due before next Lab at 07:30PM(No late submission is accepted Do

Lab4 - Winter 2013 WSU CSC 2000 Introduction to C...

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

Winter 2013 WSU 01/30/2013 CSC 2000 Introduction to C++ Programming Language Lab 4 ( 100 points) Due before next Lab at 07:30PM (No late submission is accepted!) Do the following three problems. Make sure you comment your code. Problem 1 (35 points) Write a program that uses while loop to perform the following steps: a. Prompt the user to input two integers: firstNum and secondNum , such that the former one is less than the later. b. Output all odd numbers between firstNum and secondNum (Inclusive). c. Output all even numbers between firstNum and secondNum (Inclusive). d. Output the sum of all odd numbers between firstNum and secondNum (Inclusive). e. Output the sum of all even numbers between firstNum and secondNum (Inclusive). Note : You have the choice to use either a single while loop for all above tasks or a separate while loop for each required task. Problem 2 (35 points) Write a program that mimics a calculator. The program should take as input two integers and the operation to be performed. It should then output the numbers, the operator, and the result. (For
Image of page 1

Subscribe to view the full document.

Image of page 2

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

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes