Question

You are writing a program that takes in a number from a user and then prints out a line of '*'s that size. What is the BEST type of loop to use? Do-While For-Loop While-Loop

          You are writing a program that takes in a number from a user and then prints out a line of '*'s that size. What is the BEST type of loop to use?
Do-While
For-Loop
While-Loop
        

Added by Michael J.

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
You are writing a program that takes in a number from a user and then prints out a line of '*'s that size. What is the BEST type of loop to use? Do-While For-Loop While-Loop
Close icon
Play audio
Feedback
Powered by NumerAI
David Collins Kathleen Carty
Danielle Fairburn verified

Vandit Tyagi and 66 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

-
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.

starting-with-a-variable-text-containing-an-empty-string-write-a-loop-that-prompts-the-user-to-type-a-word-add-the-users-input-to-the-end-of-text-and-then-print-the-variable-the-loop-should-52306

Starting with a variable text containing an empty string, write a loop that prompts the user to type a word. Add the user's input to the end of text and then print the variable. The loop should repeat while the length of text is less than 10 characters.

Akash M.

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.


*

Recommended Textbooks

-
Computer Science and Information Technology

Computer Science and Information Technology

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

Introduction to Programming Using Python

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

Computer Science - An Overview

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

*

Transcript

-
0:00 Hi everyone.
00:01 So in this given question you have asked to write a program which will enter the number from the user until he wants.
00:09 And when the user enter a number minus 999, the program should terminate.
00:15 After that in the output, the program should display the largest and the smallest numbers which were entered by the user.
00:24 So i have developed a program.
00:26 So let's see how it is looking.
00:27 So i have developed in c language okay so i have used c language okay so after that i have created few integer first is n what is an and will take the input from user okay, so n is the input from user okay and then i also created a okay, okay? a is an array that will store the value okay entered by user okay after that i have also created a j represent that length of our array okay until which the user have entered the values okay and that's all initially i is zero that is represented by here okay so let's see what is happening actually it is i it's not j it is i so after that what i am being i am saying keep doing this loop until user enter a number of minus 99.
01:42 Here you can see that i am also storing the value of n in my array as well...
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