Please enter starting number: -2 Please enter ending number: 2 Negative values are not accepted. Please enter starting number: 4 Please enter ending number: 2 Ending value should be greater than the starting value. Please enter starting number: 0 Please enter ending number: 3 Series of numbers based on the user input: 0 1

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question
Practice Activity #1 (PA1): Displaying a Series of Numbers Based on the User Inputs
Compro1
USER REQUIREMENTS:
1. Create a new project and name it pa1_<section>-<lastname>
2. Use the for() loop control structures that we have discussed in writing this
program.
3. Let us modify the first problem presented in the Sample Program section of the
for() loop discussion. Recall that the program displays a series of number based
on the starting and ending numbers that will be supplied by the user.
4. Modify the code in such a way that it will not accept any negative numbers and
that the ending value will always be greater than the starting value.
5. If the user violates the conditions in #4, the program will ask new set of inputs
until he entered valid values.
6. Also, after successful run, the program asks the user if he wants to try and run
the program again.
7. See sample output below.
Transcribed Image Text:Practice Activity #1 (PA1): Displaying a Series of Numbers Based on the User Inputs Compro1 USER REQUIREMENTS: 1. Create a new project and name it pa1_<section>-<lastname> 2. Use the for() loop control structures that we have discussed in writing this program. 3. Let us modify the first problem presented in the Sample Program section of the for() loop discussion. Recall that the program displays a series of number based on the starting and ending numbers that will be supplied by the user. 4. Modify the code in such a way that it will not accept any negative numbers and that the ending value will always be greater than the starting value. 5. If the user violates the conditions in #4, the program will ask new set of inputs until he entered valid values. 6. Also, after successful run, the program asks the user if he wants to try and run the program again. 7. See sample output below.
SAMPLE OUTPUT:
Please enter starting number: -2
Please enter ending number: 2
Negative values are not accepted.
Please enter starting number: 4
Please enter ending number: 2
Ending value should be greater than the starting value.
Please enter starting number: 0
Please enter ending number: 3
Series of numbers based on the user input:
0
1
2
Transcribed Image Text:SAMPLE OUTPUT: Please enter starting number: -2 Please enter ending number: 2 Negative values are not accepted. Please enter starting number: 4 Please enter ending number: 2 Ending value should be greater than the starting value. Please enter starting number: 0 Please enter ending number: 3 Series of numbers based on the user input: 0 1 2
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY