Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
thumb_up100%
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.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 1 images
Knowledge Booster
Similar questions
- Problem Statement for High and Low Design a program that lets the user enter a series of numbers. The user should enter -99 to signal the end of the series. After all the numbers have been entered, the program should display the highest and lowest number in the series. Part 1. Understand the Problem The program will use a while loop to get the numbers from the user. It is not necessary for the individual numbers to be saved;each number can be evaluated as it is read in. To find the highest and lowest number in the series, use two variables. The variables are initialized by getting the first number from the user and assigning it to both the highest and lowest variables. The assumption is, that if there is only one number in the series it is both the highest and lowest numbers. Inside the loop, each number should be compared to the value stored in the highest variable and its value should replace the value in highest variable if it is greater than the number already there. The same can…arrow_forwardQuestion 6 The following loop will: while('a' <= 'y') cout<arrow_forwardprogram3_3.py A legally qualified automobile driver is at least sixteen and has a license. Write a program that prompts the user for his/her age and licensed status. Then, use nested loops to determine if the user can legally drive. If the user cannot legally drive, the program should report why not.arrow_forwardC programming: 11. Which type(s) of loop (for/do-while/while) would you use in each of the following situations? a)Asking the user if the program has guessed their number or not. b)Printing the name of each of the 36 students in the class. c)Asking the user for an unknown number of class grades. d)Counting how many times it takes the user toguess the program’s number. 12. How are the loops controlled (event or counter) in the following situations? a)Asking the user if the song is over. b)Counting how many times it takes the user to guess the program’s number. c)Asking the user to enter all 6 of their classwork grades to date. d)Printing the 16 steps of the Cupid Shuffle.arrow_forwardThis program requires the student to create a programming loop. The program's loop with loop between 5 and 50 times. Each loop will represent one week of the user eating and buying food. Each week the user will input the amount he or she spent on food. If the person spends more than $250 then the program will output "You are going to get fat." If the person spends less than $50.55 then the program will output "You are going to starve." After the final loop the program will display the lowest amount spent on any one week along with the most spent on any one week.arrow_forwardTrue or False When a variable is declared in the initialization expression of a for loop, the scope of the variable is limited to the loop.arrow_forwardWhich of the following can you nest within one another? A. for loop within an if statement B. while loop within a for loop C. if statement in a for loop D. for loop within a for looparrow_forwardCreate a function using a "while" loop. The function asks the user to input a number between 10 and 20. If the number is not within the specified limits, the user must change his/her input until he/she enters the correct value.arrow_forward1. Prompt the user for first number 2. Prompt the user for second number. 3. Determine the larger of the two numbers (hint: need conditional statement to compare and determinewhich is larger) 4. Utilizing a while loop (for each conditional) print the numbers in descending order 5. Loop stops after printing the smaller numberEx: If the integers are 45 and 40The output will be:454443424140arrow_forwardarrow_back_iosarrow_forward_ios
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY
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 Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
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
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY