
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
![Standard data rates
may apply.
Chapter 3
Modules E
doubleNumber module, which causes the number variable's contents to be copied into
the value parameter variable. This is shown in Figure 3-13.
Program 3-6
Module main().
Declare Integer number
Display "Enter a number and I will display"
Display "that number doubled."
Input number
Call doubleNumber (number)
End Module
3
4
dele?
6.
un meo h naW
edutafducb sh elle
7.
9 Module doubleNumber(Integer value)
Declare Integer result
Set result = value * 2
10
11
ny odi o
12
Display result
13
End Module
Program Output (with Input Shown in Bold)
Enter a number and I wi1l display
that number doubled.
20 [Enter]
40
Figure 3-13 The contents of the number variable passed as an argument
Module main ()
Declare Integer number
Display "Enter a number and I will display"
Display "that number doubled."
Input number
Call doubleNumber (number)
The contents of the number
variable are copied into the
value parameter variable.
End Module
20
Module deubleNumber (Integer value)](https://content.bartleby.com/qna-images/question/4953b7b2-2d45-45b3-be8a-b0753172ec10/e86fde8d-350a-4ab6-af72-8d9aa237dd43/m9kz9c_thumbnail.jpeg)
Transcribed Image Text:Standard data rates
may apply.
Chapter 3
Modules E
doubleNumber module, which causes the number variable's contents to be copied into
the value parameter variable. This is shown in Figure 3-13.
Program 3-6
Module main().
Declare Integer number
Display "Enter a number and I will display"
Display "that number doubled."
Input number
Call doubleNumber (number)
End Module
3
4
dele?
6.
un meo h naW
edutafducb sh elle
7.
9 Module doubleNumber(Integer value)
Declare Integer result
Set result = value * 2
10
11
ny odi o
12
Display result
13
End Module
Program Output (with Input Shown in Bold)
Enter a number and I wi1l display
that number doubled.
20 [Enter]
40
Figure 3-13 The contents of the number variable passed as an argument
Module main ()
Declare Integer number
Display "Enter a number and I will display"
Display "that number doubled."
Input number
Call doubleNumber (number)
The contents of the number
variable are copied into the
value parameter variable.
End Module
20
Module deubleNumber (Integer value)
Expert Solution

arrow_forward
Step 1
ALGORITHM:-
1. Declare a integer variable.
2. Display the initial lines.
3. Take input the number.
4. Pass it to the function.
5. Print the result.
6. Finish.
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 2 images

Knowledge Booster
Similar questions
- ne nouncements 2. Days of the Week odules • Write a program that asks the user for a number in the range of 1 through 7. The program should display the corresponding day of the week, where 1- Monday, 2 - Tuesday and so forth. If the user types in a 6 then "Saturday" should be printed on the screen. For help with Input statements see: Input Function izzes • The program should print an error message if the user enters a number that is outside the range of 1 through 7. For help with If statements and conditions see the following pages: If-Else Statements and Operators. • Name the source code file yourName_HW4 1.py. • Test and run the program. Capture the output console and save it as an image file named yourName_HW3_output4_1.jpg. • Submit the py and the image files through Canvas. rades yllabus Zoom Library Research Guides 3. Roman Numerals • Write a program that displays the Roman numeral version of a decimal number entered. The program should prompt the user to enter a number from 1 to…arrow_forwardFunction SecondsToMinutes(float totalSecs) returns float resultMins // Calculate resultMins: resultMins = 0 Function Main() returns nothing float userSecs float resultMins userSecs = Get next input resultMins = SecondsToMinutes(userSecs) Put userSecs to output Put " seconds are " to output Put resultMins to output Put " minutes." to outputarrow_forwardA and BonlyIn this program, you are asked to write a program in assembly which works as a simple calculator.The program will get two integer numbers, and based on the requested operation, the result shouldbe shown to the user.a. The program should print a meaningful phrase for each input, and the result.i. “Enter the first number”ii. “Enter the second number”iii. “Enter the operation type”iv. “The result is”b. The user should enter 0, 1, and 2 to tell the program the types of operation add, sub, andmultiply, respectively.c. How many registers do you need to implement this program?d. What system calls do you need to write this program?arrow_forward
- Python programmingarrow_forwardQ in picture **C PROGRAMMING LANGUAGE ***PROVIDE COMMENTSarrow_forwardC programming language *provide comments Write a set of statements in the main function that displays to the monitor a large letter “T” made up of the character ‘T’. Here is a sample output of how it should look when the program runsarrow_forward
- PART I: Functions – Math Test Write the Flowchart and Python code for the following programming problem based on the pseudocode below. Write a program that will allow a student to enter their name and then ask them to solve 10 mathematical equations. The program should display two random numbers that are to be added, such as: 247 + 129 The program should allow the student to enter the answer. The program should then display whether the answer was right or wrong, and accumulate the correct values. After the 10 questions are asked, calculate the average correct. Then display the student name, the number correct, and the average correct in both decimal and percentage format. In addition to any system functions you may use, you might consider the following functions: A function that allows the student to enter their name. A function that gets two random numbers, anywhere from 1 to 500. A function that displays the equation and asks the user to enter their answer. A function that…arrow_forwardPython code please help, indentation would be greatly appreciatedarrow_forwardSpeeding Violation Calculator - MUST BE WRITTEN IN PSEUDOCODE Design a program that calculates and displays the number of miles per hour over the speed limit that a speeding driver was doing. The program should ask for the speed limit and the driver’s speed. Validate the input as follows: The speed limit should be at least 20, but not greater than 70. The driver’s speed should be at least the value entered for the speed limit (otherwise the driver was not speeding). Once correct data has been entered, the program should calculate and display the number of miles per hour over the speed limit that the driver was doing.arrow_forward
arrow_back_ios
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