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
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 4 steps with 2 images
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
Custom Test incomplete
Delete the wages.csv file
Custom TestIncomplete
The program writes to the wages.csv file
Test OutputJohn Henry's payrate was not found in the wages.csv file. Traceback (most recent call last): File "/home/nt-user/workspace/nt-test-76ce7b1d", line 23, in <module> raise AssertionError() AssertionError
Test Contentsimport csv import main with open('/home/nt-user/workspace/wages.csv') as f: # Read in the CSV file csvfile = csv.reader(f) csvout = list() all_lines = list() for row in csvfile: csvout.append(row) # Create a single list of file contents for lyst in csvout: all_lines.append(lyst[0]) all_lines.append(lyst[1]) # Check the aggregated file contents for the employee information if 'John Henry' not in all_lines: print('John Henry was not found in the wages.csv file.') raise AssertionError() elif '570' not in all_lines: print('John Henry\'s payrate was not found in the wages.csv file.') raise AssertionError() elif 'Maria Gray' not in all_lines: print('Maria Gray was not found in the wages.csv file.') raise AssertionError() elif '645' not in all_lines: print('Maria Gray\'s payrate was not found in the wages.csv file.') raise AssertionError() elif 'Larry Simon' not in all_lines: print('Larry Simon was not found in the wages.csv file.') raise AssertionError() elif '525' not in all_lines: print('Larry Simon\'s payrate was not found in the wages.csv file.') raise AssertionError() f.close()
Solution
by Bartleby Expert
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
Custom Test incomplete
Delete the wages.csv file
Custom TestIncomplete
The program writes to the wages.csv file
Test OutputJohn Henry's payrate was not found in the wages.csv file. Traceback (most recent call last): File "/home/nt-user/workspace/nt-test-76ce7b1d", line 23, in <module> raise AssertionError() AssertionError
Test Contentsimport csv import main with open('/home/nt-user/workspace/wages.csv') as f: # Read in the CSV file csvfile = csv.reader(f) csvout = list() all_lines = list() for row in csvfile: csvout.append(row) # Create a single list of file contents for lyst in csvout: all_lines.append(lyst[0]) all_lines.append(lyst[1]) # Check the aggregated file contents for the employee information if 'John Henry' not in all_lines: print('John Henry was not found in the wages.csv file.') raise AssertionError() elif '570' not in all_lines: print('John Henry\'s payrate was not found in the wages.csv file.') raise AssertionError() elif 'Maria Gray' not in all_lines: print('Maria Gray was not found in the wages.csv file.') raise AssertionError() elif '645' not in all_lines: print('Maria Gray\'s payrate was not found in the wages.csv file.') raise AssertionError() elif 'Larry Simon' not in all_lines: print('Larry Simon was not found in the wages.csv file.') raise AssertionError() elif '525' not in all_lines: print('Larry Simon\'s payrate was not found in the wages.csv file.') raise AssertionError() f.close()
Solution
by Bartleby Expert
Knowledge Booster
Similar questions
- In pythonarrow_forwardExercise 2: A vehicle inspection station keeps records of its checking services in a text file (called "inspection.txt"). Each line corresponds to a checking visit and contains the following information separated by slashes (*/"). The vehicle's registration number (serial number and series), the inspection performed (Assuming that there are four kind of services: Periodic, Pre- Sale, Emission, Other), and the service duration in minutes. The figure below shows a few lines of input file. Write a python program that asks the user to enter a vehicle registration number, then reads the input file and displays for each provided service on that vehicle, the total duration and the number of visits. Display an error using the proper exception if the file does not open/exist. Use exception to count and display the number of records having incorrect format of the data in the file (such as, serial number is not digit, unknown service category). Enter vehicle's registration number: 7203 RS…arrow_forwardThis project involves generating a boarding pass ticket and storing it in a file. The application should take the passenger details as input. The details of the boarding pass are to be stored in a file. The details should include valid data such as: name, email, phone number, gender, age, boarding pass number, date, origin, destination, estimated time of arrival (ETA), departure time. The application should generate a boarding pass ticket using the boarding pass details. The generated ticket should contain the following information: Boarding Pass Number, Date, Origin, Destination, Estimated time of arrival (ETA), Departure Time Name, Email, Phone Number, Gender, Age Total Ticket Price The user will be required to enter their Name, Email, Phone Number, Gender, Age, Date, Destination, and Departure Time into the console or GUI. From the input the computer must generate the ETA and Ticket Price. The computer must generate the boarding pass number ensuring the number is unique. All…arrow_forward
- Design an application for the ABC Company that will process inventory from a file called ABC_Inventory.txt (attached to this assignment). The file contains Item ID, Description and list price stored on a separate line in the file. The program should display the contents of each record and then calculate and display the average list price. it is important that this is done in Thonny for python warrow_forwardWrite a program that uses a structure to store the following information on a company division: Division name (such as East, West, North, or South) Quarter (1, 2, 3, or 4)Quarterly salesThe user should be asked for the four quarters’ sales figures for the East, West, North, and South divisions. The information for each quarter for each division should be written to a file.arrow_forwardYou are given 2 text files named drywet.txt and wetwet.txt. wetwet.txt data file refers to the probability of next day being a wet day if the current day is wet. drywet.txt data file refers to the probability of next day being a wet day if the current day is dry. NOTE: the data for the same location in wetwet.txt and drywet.txt will have the same line number. These files are in the format of: (excerpt from wetwet.txt)-97.58 26.02 0.76 0.75 0.77 0.74 0.80 0.86 0.94 0.97 0.89 0.77 0.74 0.77 -97.19 26.03 0.73 0.76 0.75 0.71 0.79 0.85 0.92 0.95 0.90 0.81 0.76 0.75 -98.75 26.35 0.74 0.76 0.76 0.73 0.67 0.84 0.83 0.85 0.80 0.71 0.71 0.76 … In each line, the first and second numbers represent the location’s longitude and latitude. The following 12 numbers represent the probability of the next day being a wet day of the month. For example, on the first line of the excerpt above 0.75 means that in February (4th column), there is a 75% of chance that the next day is a wet day if today is a wet…arrow_forward
- The given text files represent a list of account numbers and associated balances. Balances change over time. If a balance is later in the file, then this implies the balance for that customer is more recent. Ask the user for a file name then display the most recent balance along with the high and low balance. balances-0.txt customer id balance1 $93.831 $805.242 $866.454 $943.283 $764.121 $798.004 $395.595 $644.264 $18.314 $814.97arrow_forwardThis part of the quiz will contain 4 parts. A function called grade, a function called pgrade, a prototype file called grade.h and a main function. In this part you will create the main function which will do the following: main This main function will use the functions grade and pgrade to produce the grades for the following students and display the appropriate grade with the appropriate message. The semester grade will be based on the fact that the quiz average is 25% of the grade, the final is 20% of the grade, assignments is 20% of the grade and programs are 35% of the grade. The student grades are as follows: Student Name Assignments Programs Quiz Ave Final Tom 63 Francis Maria Jan 75 90 95 85 sample of output Harry Grade B Good 85 75 95 90 93 92 71 69 87 91 73 Aarrow_forwardplease help fix the following Scenario: Your team is working with data where dates are caputred as a string, "9/15/2019". You are tasked to create a python function named 'mdy_date' that will accept a string input, convert it to a python datetime object, and return the datetime object. Create the function in the cell below.arrow_forward
- Open the project or solution named mpg in this folder: ex_starts\ch07_ex1_mpg Review the code and run the program to refresh your memory on how it works. Notice that, unlike the program in this chapter, this program lets the user perform more than one calculation, it stores the values the user enters in a text file, and it displays the total miles, total gallons, and average miles per gallon when the program starts and after each entry. Add a function that calculates the miles per gallon Define a function named calculate_mpg() before the main() function that calculates the miles per gallon. This function should accept two double values for the miles and gallons, round the result to two decimal places, and return the result as a double type. Modify the code in the main() function so it uses the calculate_mpg() function. Note that the miles per gallon is calculated in three different places. Move the definition for the calculate_mpg() function after the main() function. When you run…arrow_forwardCreate a php file for this task. Depending on whether "Top Scorers" or "Leaders" has been clicked, you need to display the top 10 teams sorted by their total scores or total points earned. You have to read the whole CSV file when calculating total scores and total points. Top Scorers Display a table with two columns: Team and Scores. The team that has the highest number of scores is displayed first. You have to display the top 10 teams only. Note: in the CSV file, for the first row, you will see something like Arsenal FC,4-3,Leicester City FC that means for this particular match, Arsenal FC scored 4 and Leicester City FC scored 3. This rule applies to all other rows as well. For this "Top Scorers" display, you need to calculate the total score of every team and then display the top 10 teams. Leaders Display a table with two columns: Team and Points. The team that has the highest number of points is displayed first. You have to display the top 10 teams only. Note: in the CSV file, for…arrow_forwardCreate a datafile that contains the first name, last name, gender, age, height, smoking preference, eye color and phone number. Add a variety of records to the file. A sample file looks like:  Write a program that opens the file and reads the records one by one. The program will skip any records where the gender preference is not a match. Of those records that match the gender preference, check to see if the age and height are between the maximum and minum preferences. Then check to see if the smoking preference and eye color are also a match. If at least 3 of the remaining fields match, consider the record a partial match, and print it in the report. If all 4 of the remaining fields match, the record is a perfect match and print it in the report with an asterisk next to it. At the end of the program, close the file and report how many total records there were of the specified gender, how many were a partial match, and how many were a perfect match.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