Question

Write a program with a loop that lets the user enter a series of positive integers. The user should enter -99 to signal the end of the series. Any negative number other than -99 must be rejected with a message “ERROR: no negative values other than -99 accepted!”. After all the numbers have been entered, the program should display the largest and the smallest numbers entered. If no numbers were entered (user entered -99 right away) a message “No numbers were entered” must appear.

          Write a program with a loop that lets the user enter a series of positive integers. The user should enter -99 to signal the end of the series. Any negative number other than -99 must be rejected with a message “ERROR: no negative values other than -99 accepted!”. After all the numbers have been entered, the program should display the largest and the smallest numbers entered. If no numbers were entered (user entered -99 right away) a message “No numbers were entered” must appear.
        
Show more…

Added by Catalina B.

Computer Science and Information Technology
Computer Science and Information Technology
Trishna Knowledge Systems 2018 Edition
AceChat toggle button
Close icon
Ace pointing down

Please give Ace some feedback

Your feedback will help us improve your experience

Thumb up icon Thumb down icon
Thanks for your feedback!
Profile picture
Write a program with a loop that lets the user enter a series of positive integers. The user should enter -99 to signal the end of the series. Any negative number other than -99 must be rejected with a message “ERROR: no negative values other than -99 accepted!”. After all the numbers have been entered, the program should display the largest and the smallest numbers entered. If no numbers were entered (user entered -99 right away) a message “No numbers were entered” must appear.
Close icon
Play audio
Feedback
Powered by NumerAI
Kathleen Carty David Collins
Jennifer Stoner verified

Shelayah Robinson and 69 other subject AP CS educators are ready to help you.

Ask a new question

*

Labs

-

Want to see this concept in action?

NEW

Explore this concept interactively to see how it behaves as you change inputs.

View Labs

*

Key Concepts

-
Key Concept
Premium Feature
Explore the core concept behind this problem.
Play button
Key Concept
Premium Feature
Explore the core concept behind this problem.
Your browser does not support the video tag.

*

Recommended Videos

-
design-a-program-with-a-loop-that-asks-the-user-to-enter-a-series-of-positive-numbers-the-user-should-enter-a-negative-number-to-signal-the-end-of-the-series-after-all-the-positive-numbers-h-22027

Design a program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display the sum of all EVEN numbers.

Shelayah R.

write-a-program-to-enter-the-numbers-till-the-user-wants-and-at-the-end-the-program-should-display-the-largest-and-smallest-numbers-entered-loop-should-terminate-when-user-enter-999-41222

Write a program to enter the numbers till the user wants and at the end the program should display the largest and smallest numbers entered. loop should terminate when user enter -999.

Vandit T.

write-a-program-with-a-loop-that-asks-the-user-to-enter-a-series-of-positive-numbers-the-user-should-enter-a-negative-number-to-signal-the-end-of-the-series-after-all-the-positive-numbers-ha-55112

Write a program with a loop that asks the user to enter a series of positive numbers. The user should enter a negative number to signal the end of the series. After all the positive numbers have been entered, the program should display their sum. Note: Don't include the negative number in the sum. Pay attention to the fact that, as a programmer, you have no idea how many positive numbers the user is going to enter. Pick your loop wisely. Design your code your way!!

Akash M.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

Trishna Knowledge Systems 2018 Edition
achievement 1,117 solutions
Introduction to Programming Using Python

Introduction to Programming Using Python

Y. Daniel Liang 1st Edition
achievement 1,083 solutions
Computer Science - An Overview

Computer Science - An Overview

Glenn Brookshear, Dennis Brylow 12th Edition
achievement 1,202 solutions

*

Transcript

-
00:01 Be creating a python program that calculates the amount of even numbers inputted and the program will terminate once a negative number is in.
00:16 So if you do this, we need to create an array or less in python.
00:23 So we'll say even array is equal to the brackets.
00:33 So we're going to create a model statement.
00:36 So while this is less than zero, all right, we also want to create a number, a variable for the number.
00:52 So number even equals, and we're going to say enter the number.
01:10 All right.
01:13 So we're going to put this in here.
01:20 All right.
01:20 So now we're basically going to copy and paste this message.
01:27 So this will also want to adjust it...
Need help? Use Ace
Ace is your personal tutor. It breaks down any question with clear steps so you can learn.
Start Using Ace
Ace is your personal tutor for learning
Step-by-step explanations
Instant summaries
Summarize YouTube videos
Understand textbook images or PDFs
Study tools like quizzes and flashcards
Listen to your notes as a podcast
Continue solving this problem
Create a free account to:
  • View full step-by-step solution
  • Ask follow-up questions with Ace AI
  • Save progress and study later
Continue Free
Join the community

18,000,000+

Students on Numerade


Trusted by students at 8,000+ universities

Numerade

Get step-by-step video solution
from top educators

Continue with Clever
or



By creating an account, you agree to the Terms of Service and Privacy Policy
Already have an account? Log In

A free answer
just for you

Watch the video solution with this free unlock.

Numerade

Log in to watch this video
...and 100,000,000 more!


EMAIL

PASSWORD

OR
Continue with Clever