{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CSE202Lab4 - numbers For example if a user enters 45 and 51...

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

View Full Document Right Arrow Icon
CSE 202 Lab Assignment 4 NOTE: No need to submit anything electronically. Write the following short program and turn in the hard copy. If your programs ever get stuck in an infinite loop, press control + C to kill the program. Before beginning, from the terminal, create a new directory called lab4, and change your working directory to lab4. Instructions: 1. Write a program that prompts a user for two numbers and then computes and outputs the sum of all of the consecutive numbers between the two
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: numbers. For example, if a user enters 45 and 51, your program will compute (45 + 46 + 47 + 48 + 49 + 50 + 51) then output the result to the screen. You may have to check whether the first number is less or greater than the second number and accordingly compute the values. Please answer the following questions and submit it along with a print-out of your code: a) Which type of Repetitive Structure did you use? Why? b) Which type of Selection Structure did you use? Why?...
View Full Document

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