Homework: Coding

1. How do modules help you to reuse code in a program?
If a operation needs to be performed in several places, the same module can be called and re-used cutting down on unnecessary code.

2. Name and describe the two parts that a module definition has in most languages. The two parts are a header and a body

3. When a module is executing, what happens when the end of the module is reached? It jumps back to the part of the program that called it.

This is known as the return point

4. What is a local variable? What statements are able to access a local variable? A local variable is declared inside a module and cannot be accessed by statements that are outside the module.

5. In most languages, where does a local variable’s scope begin and end? Usually begins at the variables declaration and ends at the end of the module

6. What is the difference between passing an argument by value and passing it by reference? Passing an argument by value copies the data from the variable but does not change the original data.

Passing a variable by reference will overwrite the existing data at that reference point in memory.

7. Why do global variables make a program difficult ot debug? If there is a debug issue, you have to step through ALL modules looking for the module that is incorrectly accessing that variable. Most programs have many many modules. This makes global variables very time consuming to debug.

Algorithm Workbench Review Questions 1,5,6, and 7 from page 111

1. Design a module named timesTen. The module should accept an Integer argument. When this module is called, it should display the product of its argument multiplied by 10

1. Declare a variable called number and set the value of it 2. Call the module timesTen passing as an argument the variable number by reference 3. In the module named timesTen create a parameter named number that the argument will be passed into 4. Calculate and set the variable number * 10

5. Display the variable number

5. Design a module named getNumber, which uses a reference parameter variable to accept an Integer argument. The module should prompt the user to enter a number and then store the input in the reference parameter variable

Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Boom Grades
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Medicine
Great content.
Customer 452549, February 8th, 2022
Gerontology
Thank you so much this looks great !!!!
Customer 452585, November 4th, 2023
world civilization
Thank you for the quick response
Customer 452509, June 27th, 2021
Exercise Science
Thank you so much for your time.
Customer 452545, December 5th, 2021
Classic English Literature
Awesome Job... you are the best!
Customer 452531, November 27th, 2021
Public Health
Thank you so much !!
Customer 452589, November 28th, 2023
english comp
Great paper and done before the deadline. Thank you
Customer 452509, June 15th, 2021
English 101
perfect! thanks!
Customer 452543, December 1st, 2021
English comp
Got a 94% thank you!
Customer 452509, June 27th, 2021
english comp
Thank you for all your hard time.
Customer 452509, June 27th, 2021
Classic English Literature
Great Work as Usual. Thank you . I received an A on the paper!
Customer 452531, November 9th, 2021
Literature
Absolutely LOVE having help especially from the person who wrote this last one. THANK YOU
Customer 452529, November 19th, 2021
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat