
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

Transcribed Image Text:3
34
56
7 6
3
2 3 4
6 7
*5.20
(Display four patterns using loops) Use nested loops that display the following
patterns in four separate programs:
Pattern A
Pattern B
Pattern C
Pattern D
1 2 3 4 5 6
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1 2 3 4 56
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
1 2
1 2 3
1 2 3 4
1 2 3 45
1 2 3 4 5 6
2 1
3 2 1
4 321
5 4 3 2 1
6 5 4 3 2 1
1
**5.21 (Display numbers in a pyramid pattern) Write a nested for loop that displays the
following output:
N2
44

Transcribed Image Text:V buppuSG Llat uiC tulioN Ior a uni-
versity is $10,000 this year and increases 5% every year. Write a program that
computes the tuition in ten years and the total cost of four years' worth of tuition
starting ten years from now.
5.10 (Find the highest score) Write a program that prompts the user to enter the number
of students and each student's score, and displays the highest score. Assume that
the input is stored in a file named score.txt, and the program obtains the input from
the file.
*5.11
(Find the two highest scores) Write a program that prompts the user to enter the
number of students and each student's score, and displays the highest and second-
highest scores.
5.12
(Find numbers divisible by 5 and 6) Write a program that displays, ten numbers
per line, all the numbers from 100 to 1,000 that are divisible by 5 and 6. The num-
bers are separated by exactly one space.
5.13
(Find numbers divisible by 5 or 6, but not both) Write a program that displays, ten
numbers per line, all the numbers from 100 to 200 that are divisible by 5 or 6, but
not both. The numbers are separated by exactly one space.
5.14
(Find the smallest n such that n> 12,000) Use a while loop to find the smallest
integer n such that n2 is greater than 12,000.
(Find the largest n such that n' < 12,000) Use a while loop to find the largest
integer n such that n is less than 12,000.
5.15
*S 16
Fon Lieting 5 8 onothor solution to find
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 8 steps with 3 images

Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
That is not Python. We are currently using Python 3 IDE.
Solution
by Bartleby Expert
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
That is not Python. We are currently using Python 3 IDE.
Solution
by Bartleby Expert
Knowledge Booster
Similar questions
- 6.13 (Rounding Numbers) An application of function floor is rounding a value to the nearest integer. The statement y = floor( x + 0.5 ); rounds the number x to the nearest integer and assigns the result to y. use c++ to Write a program that reads several numbers and uses the preceding statement to round each of these numbers to the nearest integer. For each number processed, print both the original number and the rounded number.arrow_forward8.19 LAB: Flip a coin Define a function named coin_flip that returns "Heads" or "Tails" according to a random value 1 or 0. Assume the value 1 represents "Heads" and 0 represents "Tails". Then, write a main program that reads the desired number of coin flips as an input, calls function coin_flip() repeatedly according to the number of coin flips, and outputs the results. Assume the input is a value greater than 0. Ex: If the random seed value is 5 and the input is: 3 the output is: Heads Heads Tails Note: For testing purposes, a pseudo-random number generator with a fixed seed value is used in the program. The program uses a seed value of 5 during development, but when submitted, a different seed value may be used for each test case. The program must define and call the following function: def coin_flip()arrow_forwardSections 7.2-7.5 *7.1 (Assign grades) Write a program that reads student scores, gets the best score, and then assigns grades based on the following scheme: Grade is A if score is > best – 10 - Grade is B if score is > best – 20; Grade is C if score is > best – 30; Grade is D if score is > best – 40; Grade is F otherwise. The program prompts the user to enter the total number of students, then prompts the user to enter all of the scores, and concludes by displaying the grades. Here is a sample run: Enter the number of students: 4 - Enter Enter 4 scores: 40 55 70 58 - Enter Student 0 score is 40 and grade is C Student 1 score is 55 and grade is B Student 2 score is 70 and grade is A Student 3 score is 58 and grade is Barrow_forward
- 1.18 LAB: Input and formatted output: House real estate summary Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (currentPrice* 0.051) / 12. End the last output with a newline. Ex: If the input is: 200000 210000 the output is: This house is $200000. The change is $-10000 since last month. The estimated monthly mortgage is $850. Note: Getting the precise spacing, punctuation, and newlines exactly right is a key point of this assignment. Such precision is an important part of programming. 472578.3337676.qx3zqy7arrow_forwardPlease guide mearrow_forward5.23 LAB: Contains the character C++ Write a program that reads an integer, a list of words, and a character. The integer signifies how many words are in the list. The output of the program is every word in the list that contains the character at least once. Assume at least one word in the list will contain the given character. Ex: If the input is: 4 hello zoo sleep drizzle z then the output is: zoo drizzle To achieve the above, first read the list into a vector. Keep in mind that the character 'a' is not equal to the character 'A'.arrow_forward
- 8.28 LAB: Check if list is sorted Write the in_order() function, which has a list of integers as a parameter, and returns True if the integers are sorted (in order from low to high) or False otherwise. The program outputs "In order" if the list is sorted, or "Not in order" if the list is not sorted. Ex: If the list passed to the in_order() function is [5, 6, 7, 8, 3], then the function returns False and the program outputs: Not in order Ex: If the list passed to the in_order() function is [5, 6, 7, 8, 10], then the function returns True and the program outputs: In order Note: Use a for loop. DO NOT use sorted() or sort(). this is the code im supposed to use def in_order(nums): # Type your code here. if __name__ == '__main__': # Test out-of-order example nums1 = [5, 6, 7, 8, 3] if in_order(nums1): print('In order') else: print('Not in order') # Test in-order example nums2 = [5, 6, 7, 8, 10] if in_order(nums2): print('In…arrow_forward6.47 IDE LAB: Word frequencies Write a program that reads a list of words. Then, the program outputs those words and their frequencies. The input begins with an integer indicating the number of words that follow. Assume that the list will always contain fewer than 20 words. Ex: If the input is: 5 hey hi Mark hi mark the output is: hey - 1 hi - 2 Mark - 1 hi - 2 mark - 1arrow_forwardPleased helparrow_forward
- 21.4 LAB: Parsing dates (Use Python) Write a program to read dates from input, one date per line. Each date's format must be as follows: March 1, 1990. Any date not following that format is incorrect and should be ignored. The input ends with -1 on a line alone. Output each correct date as: 3/1/1990. Hint: Use string[start:end] to get a substring when parsing the string and extracting the date. Use the split() method to break the input into tokens. Ex: If the input is: March 1, 1990 April 2 1995 7/15/20 December 13, 2003 -1 then the output is: 3/1/1990 12/13/2003arrow_forward5.17 LAB: Print string in reverse Write a program that takes in a line of text as input, and outputs that line of text in reverse. The program repeats, ending when the user enters "Done", "done", or "d" for the line of text. Ex: If the input is: Hello there Hey done then the output is: ereht olleH yeHarrow_forward*58( 念.ll.ll g Me A:1E docs.google.com/forms/d/e/1FAIlpQLS 4 نقطتان )2( What would be the value of y after the execution of the * :following VBA code Dim x, y as Integer x-5 Select Case x Case 0 y = 10 Case 1 y=20 Case 2 y=30 Case Else y=100 End Select 10 20 30 100 O Oarrow_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