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%
Loop:
- Ask the user how many students to process.
- Then, for each student, use the code you have already written to ask for two names and two grades and print out a neatly formatted record.
- Hint: what kind of a loop will you use? Why?
Letter grade:
- If a student's average grade is equal to or above 18, they should get an A. Print that out.
- If it's >= 16 and < 18 they should get a B.
- If it's >= 14 and < 16 they should get a C
- If it's >= 12 and < 14 they should get a D
- if it's < 12 they should get an F
- Hint: can you use a switch statement to do this? Why or why not?
Average score over all students:
- Keep a running tally of the total score, and a count of how many students. At the very end, print out a single line that says
- Average score for XX students is YY
- (where XX and YY are values you calculate).
- Hint: what type should the average score be?
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
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.Similar questions
- Given num_rows and num_cols, output the label for each seat of a theater. Each seat is followed by a space, and each row is followed by a newline. Define the outer for loop, initialize curr_col_let with the starting row letter, and define the inner for loop. If the input is: 23 1A 1B 1C 2A 2B 2C Notes: • Rows are in ascending order. Seats in the first row all start with the integer 1. • Columns are in alphabetical order. Seats in the first column all start with the letter 'A'. print(x, end="), where " are two single quotes, outputs x without ending with a default newline. chr(ord(letter) + 1) can be used to increment letters. ● ● Learn how our autograder works 487180.3542414.qx3zqy7 1 num_rows = int(input()) 2 num_cols int(input()) 123456 = print (f'{curr_row}{curr_col_let}', end=' ') curr_col_let = chr(ord(curr_col_let) + 1) 7 8 print()arrow_forwardThe average amount Sold function is not run as expect. Please fix it. The input file: sales.txt header in picture. It is over 5000 char. I can't copy. 13492785 2017 Jane North; 1000 78534520 2012 Tim South; 95020192756 2017 Linda East; 15000 19273458 2012 Paul West; 500078520192 2017 Mary Jane Doe; 5001 32278520 2012 Victor Smith; 799514278520 2012 Mary Johnson; 12056192785 2017 Tom Baker; 1300 88278529 2012 Diana Newman; 150089278527 2012 William Peterson; 1420098278528 2012 Jim Gaddis; 120099192785 2017 Laura King; 1000 43278524 2012 Ann McDonald; 2000 The output expect: in picture. #include "Sales.h"#include <iostream>#include <sstream>#include <iomanip>#include <fstream>#include <string>using namespace std; const int MAX_SIZE = 30; void readData(string fileName, Sales salesArr[], int n);double calcSalesAvg(Sales salesArr[], int n);void displayOverAvg(Sales salesArr[], int n, double avg);void writeReport(Sales salesArr[], int n, string…arrow_forwardThe class I'm taking is assembly programming. I am completely stuck. I have attached the problem. Please view attachment before answering. Thank you so much for your help! Any help is greatly appreciated.arrow_forward
- This is to be done using Visual Studio and the information input needs to be stored in an array of records.arrow_forward// This pseudocode should create a list that describes annual profit // statistics for a retail store. Input records contain a department // name (for example, ìCosmeticsî) and profits for each quarter for // the last two years. The program should determine whether // the profit is higher, lower, or the same // for this full year compared to the last full year. start Declarations string department num salesQuarter1ThisYear num salesQuarter2ThisYear num salesQuarter3ThisYear num salesQuarter3ThisYear num salesQuarter1LastYear num salesQuarter2LastYear num salesQuarter3ThisYear num salesQuarter4LastYear num totalThisYear num totalLastYear string status num QUIT = "ZZZZ" housekeeping() while department <> QUIT compareProfit() endwhile finishUp() stop housekeeping()DEBUG04-02.txt output "Enter department name or ", QUIT, " to quit " input dept return compareProfit()…arrow_forwardWhich of the following statements regarding sentinel loop is NOT correct? Sentinel has to be able to stand out from the data in order for this to work. O The user does not need to enter a decision each time to determine whether or not to continue with the process. Sentinel is always an empty string in this case. O It is not necessary for it to have any prior knowledge regarding the number of times it will carry out the operation.arrow_forward
- Please put these for loop steps in the right order. Answers Code following the body of the loop is executed The counter is compared to some value to see if the necessary condition is met The counter's value is updated A counter is initialized to some starting value The code in the body of the loop gets executedarrow_forwardTrue or False: When asking user for data, we can always turn an algorithm that uses a user-confirmation loop into one that uses a sentinel loop. Select one: a. False b. Truearrow_forwardSummary In this lab, you write a while loop that uses a sentinel value to control a loop in a Python program. You also write the statements that make up the body of the loop. Each theater patron enters a value from 0 to 4 indicating the number of stars that the patron awards to the Guide’s featured movie of the week. The program executes continuously until the theater manager enters a negative number to quit. Instructions Make sure the file MovieGuide.py is selected and open. Write thewhile loop using a sentinel value to control the loop, and also write the statements that make up the body of the loop. Execute the program by clicking the Run button at the bottom of the screen. Input the following as star ratings: 0, 3, 4, 4, 1, 1, 2, -1 must be written with this code: """ MovieGuide.py This program allows each theater patron to enter a value from 0 to 4 indicating the number of stars that the patron awards to the Guide's featured movie of the week. The program executes…arrow_forward
- What is the name of a condition that is always true through multiple iterations of a looparrow_forwardTurn the following code into a procedure. Pass the input file and the amount of PM 10 to the procedure. It will print the city name and the pollution values for all cities that have that much PM 10 pollution or more.arrow_forwardThe Springfork Amateur Golf Club has a tournament every weekend. The club president has asked you to write a program that will read each player's name and score as keyboard input, and then save these as records in a file named golf.txt . First, the program should ask the user for the number of players. Then, it should ask the user for each name and score individually. The file golf.txt should be structured so that there is a line with the player's name, followed by their score on the next line. Here is an example: Emily 30 Mike 20 Jonathan 23 Look carefully at the following sample run of the program. In particular, notice the wording of the messages and the placement of spaces and colons. Your program's output must match this. Sample Run (User input shown in bold) Enter number of players :4↵ Enter name of player number 1 : Jimmy↵ Enter score of player number 1 : 30↵ Enter name of player number 2 : Carly↵ Enter score…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_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