Unit 4 Programming

In: Computers and Technology

Submitted By ohmjones
Words 1029
Pages 5
Unit 4

Short Answers 1-7 1. How do modules help you to reuse code in a program? A. It reduces the duplication of code within a program by reusing the module that was written once.
2. Name and describe the two parts that a module definition has in most languages. A. Header and a body, header indicates starting point, and the body is a list of statements.
3. When a module is executing, what happens when the end of the module is reached? A. It’s executed and returned back to the point in main program where it was sidetracked from.
4. What is a local variable? What statement is able to access a local variable? A. A variable declared inside a local module, only statement within a module
5. In most languages, where does a local variable’s scope begin and end? A. Begins at the variables declaration within a module and ends at the end of the module in which the variable is declared.
6. What is the difference between passing an argument by value and passing it by reference? A. By value only a copy of the argument’s value is passed. By reference its passed into a special modification parameter.
7. Why do global variables make a program difficult to debug? A. Because global is used throughout all modules and hard to track.

Algorithm Workbench Review 1, 5, 6, 7
1. Design a module named timesTen. The module should accept an Integer argument. When the module is called, it should display the product of its argument multiplied times 10.
Module main()
Call timesTen
Module timesTen (Integer value)
Declare Integer result
Set result = value * 10
Display result
End Module
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.
Module getNumber (Integer Ref value)…...

Similar Documents

Unit 4 Programming

...Unit 4 Short Answers 1-7 1. How do modules help you to reuse code in a program? A. It reduces the duplication of code within a program by reusing the module that was written once. 2. Name and describe the two parts that a module definition has in most languages. A. Header and a body, header indicates starting point, and the body is a list of statements. 3. When a module is executing, what happens when the end of the module is reached? A. It’s executed and returned back to the point in main program where it was sidetracked from. 4. What is a local variable? What statement is able to access a local variable? A. A variable declared inside a local module, only statement within a module 5. In most languages, where does a local variable’s scope begin and end? A. Begins at the variables declaration within a module and ends at the end of the module in which the variable is declared. 6. What is the difference between passing an argument by value and passing it by reference? A. By value only a copy of the argument’s value is passed. By reference its passed into a special modification parameter. 7. Why do global variables make a program difficult to debug? A. Because global is used throughout all modules and hard to track. Algorithm Workbench Review 1, 5, 6, 7 1. Design a module named timesTen. The module should accept an Integer argument. When the module is called, it should display the product of its argument multiplied times......

Words: 1029 - Pages: 5

Unit 4

...William Findley Unit 4 Short answer 1. How do modules help you reuse code in a program? MODULES ALSO REDUCE THE DUPLICATION OF CODE WITHIN A PROGRAM..THIS BENEFIT OF USING MODULES IS KNOWN AS code reuse BECAUSE YOU ARE WRITING THE CODE TO PERFORM A TASK ONCE AND THEN REUSING IT EACH TIME YOU NEED TO PERFORM A TASK. 2. Name and describe the two parts that a module definition has in most languags. A header and a body. Header indicates starting point, and the body is a list of statements. 3. When a module is executing, what happens when the end of the module is reached? It’s executed and returned back to the point in main program where it was sidetracked from. 4. What is a local variable? What statement are able to access a local variable? A variable declared inside a local module, only statement within a module 5. In most languages, where does a local variable’s scope begin and end? Begins at the variables declaration within a module and ends at the end of the module in which the variable is declared. 6. What is the difference between passing an argument by value and passing it by reference? By value only a copy of the argument’s value is passed. By reference its passed into a special modification parameter. 7. Why do global variables make a program difficult to debug? Because global is used throughout all modules and hard to track. Algorithm Workbench Review 1, 5, 6, 7 #1 Design a module named timesTen. The module should accept an Integer...

Words: 707 - Pages: 3

Unit 4

...Unit 4 Assignment 1 1. Read the following article Agans, R., & Shaffer, L. (1994). The hindsight bias: The role of the availability heuristic and perceived risk. Basic and Applied Social Psychology, 15(4), 439-449. “ This article can be located by using the Kaplan Online Library article search feature. Click here to access the Kaplan Library. You may also access the Kaplan Library by following these instructions: 1. Click the Academic Tools tab 2. Click Online Library. 3. Log in to your account 2. Read the narrative for Exercise 11-38 – found on page 459 in your textbook. Assume that you are a business consultant hired to advise Earth Baby, Inc. (EBI) on the proposed venture from Great Deal, Inc. (GDI). Your task is to analyze the proposal and make a recommendation to either accept or reject it. Your analysis must include critical thinking and analysis supported by evidence using independent references. Your analysis must also include any biases that might be relevant to the proposal. The analysis must be Word document, 2 to 2 and ½ pages long, not including the Title Page and Reference List. The analysis must be presented in proper APA, 6th Edition formatting, including a Title Page with properly formatted Running head. A “Conclusion” section is also 11-38 Special Order Earth Baby Inc. (EBI) recently celebrated its tenth anniversary. The company produces organic baby products for health-conscious parents. These products......

Words: 969 - Pages: 4

Programming Logic and Design Unit 4

...Unit 4 Programming Unit 4 Short Answers 1-7 1. How do modules help you to reuse code in a program? A. It reduces the duplication of code within a program by reusing the module that was written once. 2. Name and describe the two parts that a module definition has in most languages. A. Header and a body, header indicates starting point, and the body is a list of statements. 3. When a module is executing, what happens when the end of the module is reached? A. It’s executed and returned back to the point in main program where it was sidetracked from. 4. What is a local variable? What statement is able to access a local variable? A. A variable declared inside a local module, only statement within a module 5. In most languages, where does a local variable’s scope begin and end? A. Begins at the variables declaration within a module and ends at the end of the module in which the variable is declared. 6. What is the difference between passing an argument by value and passing it by reference? A. By value only a copy of the argument’s value is passed. By reference its passed into a special modification parameter. 7. Why do global variables make a program difficult to debug? A. Because global is used throughout all modules and hard to track. Algorithm Workbench Review 1, 5, 6, 7 1. Design a module named timesTen. The module should accept an Integer argument. When the module is called, it should display the......

Words: 1032 - Pages: 5

Unit 4

...BTEC NATIONAL DIPLOMA IN BUSINESS Marketing Principles Report: marketing process introduction: Marketing process The process of (1) analyzing marketing opportunities; (2) selecting target markets; (3) developing the marketing mix; and (4) managing the marketing effort. Marketing strategy The marketing logic by which the business unit hopes to achieve its marketing objectives. Marketing research The systematic design, collection, analysis, and reporting of data relevant to a specific marketing situation facing an organization. Introduction This discusses the details of marketing principles and this assignment has considered Coca cola, a company which is in the soft drinks industry as the base. This includes evaluation of benefits and costs of a company being market oriented and the deviation from its core activities. Further this discusses the micro and macro factors that affect Coca cola and how the marketing decisions should be taken considering these factors. The segmentation aspect which is adopted in Coca cola is discussed here. And effective strategies adopted in a company lead the company to achieve competitive advantage is been highlighted in this assignment. Further Targeting strategies, buyer behaviours that impact Coca cola is been discussed along with proposition for new positioning of the beverages of Coca cola. The distribution also plays a major part in a company’s marketing activities.......

Words: 369 - Pages: 2

Unit 4

...Unit 4 Assignment: Problem 1 & 2 Name: - Sydney Gerald Course Number: - AB224 Section Number: - 04 Unit Number: - 4 Date: - March 21st 2014 Problem 1 Suppose that the U.S. Department of Agriculture (USDA) administers the price floor for cheese, set at $0.17 per pound of cheese. (In real life, the actual price floor was officially set at $16.10 per hundredweight of cheese. One hundredweight is 100 pounds.) At that price, according to data from the USDA, the quantity of cheese produced in 2009 by U.S. producers was 212.5 billion pounds, and the quantity demanded was 211 billion pounds. To support the price of cheese at the price floor, the USDA had to buy up 1.5 billion pounds of cheese. The accompanying diagram shows supply and demand curves illustrating the market for cheese. [pic] a. In the absence of a price floor, the maximum price that a few of the consumers are willing to pay is $0.20 for a pound of cheese whereas the market equilibrium price is $0.13 per pound. The graph also shows that the minimum price at which a few of the producers are willing to sell is $0.06 per pound. In the absence of a price floor, how much consumer surplus is created? b. How much producer surplus? c. What is the total surplus d. The maximum price that a few of the consumers are willing to pay is $0.20 per pound of cheese, and the price floor is set at $0.17 per pound. With the price floor at $0.17 per pound of cheese, consumers......

Words: 881 - Pages: 4

Unit 4 Programming

...Unit 2 Assignment 1 Short Answer 1. What does a professional programmer usually do first to gain an understanding of a problem? a. A professional programmer gains this understanding by working directly with the customer. 2. What is pseudocode? b. Pseudocode is a fake code. It is an informal language that has no syntax rules, and is not meant to be compiled or executed. 3. Computer programs typically perform what three steps? c. Three steps are: 1. Input is received 2. Some process is performed on the input. 3. Output is produced 4. What does the term “user-friendly” mean? d. The term user-friendly is commonly used in the software business to describe programs that are easy to use. Algorithm Workbench 1. Design an algorithm that prompts the user to enter his or her height and stores the user’s input in a variable named height. * Display “Height” * Input Height * Display “here is the height that you entered:” , height 2. Design an algorithm that prompts the user to enter his or her favorite color and stores the user’s input in a variable named color. * Display “Favorite color” * Input favorite color * Display “Here is your favorite color you entered:” , color Programming Exercises 1. Personal Information A. Design a program that displays the following information: * Your name * Your address, with city, state, and......

Words: 303 - Pages: 2

Unit 4 Programming

...###Short Answer 1) How do modules help you to reuse code in a program? It reduces the duplication of code within a program by reusing the module that was written once. 2) Name and describe the two parts that a module definition has in most languages. A header and a body. Header indicates starting point, and the body is a list of statements. 3) When a module is executing, what happens when the end of the module is reached? It’s executed and returned back to the point in main program where it was sidetracked from. 4) What is a local variable? What statements are able to access a local variable? A variable declared inside a local module, only statement within a module 5) In most languages, where does a local variable’s scope being and end? Begins at the variables declaration within a module and ends at the end of the module in which the variable is declared. 6) What is the difference between passing an argument by value and passing it by reference? By value only a copy of the argument’s value is passed. By reference its passed into a special modification parameter. 7) Why do global variables make a program difficult to debug? The term variables imply that those things may be changed or assigned with new value (at numerous places). This make the program harder to debug because it will be difficult to know when and where a global variable being changed and what was the consequence of that value changed. ###Algorithm Workbench 1) Design a module......

Words: 450 - Pages: 2

Unit 4

...Deborah Rodriguez April 22, 2014 Social Security & Disability Seminar Assignment Unit 4 In unit four, we learned about the attorney fees that came up with our assignment. There are two main sources of attorney’s fees in Social Security cases. Most awards by far are paid by the claimant, usually out of past-due benefits. Another source of fees is the Equal Access to Justice Act (EAJA), a federal fee-shifting statute. For the most part, attorney’s fees for OASDI and SSI claims are governed by the same or similar rules. Many of the same rules apply also to non-attorney representatives. Attorney’s fees paid out of the claimant’s benefits are regulated by statute and regulations. Fees for claims resolved within SSA are authorized at the administrative level where the final decision is reached. Thus, administrative law judges approve fees in cases where a favorable hearing decision was issued, and the Appeals Council authorizes fees in cases decided finally only by the Appeals Council. The representative must file a request for fees in writing, which must include a list of services performed, the amount of the fee, and any expenses incurred. SSA considers a number of factors when evaluating a representative’s request for fees, including the type and amount of services performed, the difficulty of the case (including the skill required of the representative), and the results achieved. Although the amount of benefits received is taken into consideration, it does...

Words: 344 - Pages: 2

Unit 4

...Unit 1 - Task 4 Assessment Criteria: P6 - describe how political, legal and social factors are impacting upon the business activities of the selected organisations and their stakeholders. M3 - analyse how political, legal and social factors have impacted on the two contrasting organisations. This task will require some research. Apply to both organisations What to include: Political – explain 2 of the following and their impact on a business activity (i.e. recruitment, transport of goods, product design, promotion of products, etc.) and 2 stakeholders: Examples can be:  VAT increase 17.5% to 20%  changes to the minimum wage  improvement in infrastructure  apprenticeship programs and other training programs  political stability  government support for different types of organisations e.g. private, voluntary, public  level and types of taxation  government grants  improving transport links  improving education and skills of the population  membership of the EU  support from organisations set up to support businesses e.g. Business Link Legal – explain 2 of the following and their impact on a business activity and 2 stakeholders: Examples can be:  Trade Description Act  Equality Act  Equal Pay Act  dishonest advertising competition law  Company Law – ensure fair and honest trading  Protection for consumers and employees ...

Words: 267 - Pages: 2

Unit 4 Programming

...BGP: Border Gateway Protocol CATV: Cable Television CIDR: Classless Interdomain Routing CMTS: Cable Modem Termination System DSL: Digital Subscriber Line DSLAM: DSL Access Multiplexer HFC: Hybrid Fiber Coaxial IANA: Internet Assigned Number Authority IPS: Intrusion Prevention Systems ISP: Internet Service Providers NAT: Network Address Translation POP: Point of Presence RIR: Regional Internet Registries RJ-11: Registered Type Jack 11 SOHO: Small Office/Home Office Internet Service Provider: A company that provides Internet services, typically with two major parts: the ability for customers to access the Internet through the ISP, and the commitment by the ISP to maintain connections to all possible destinations in the Internet, either directly or indirectly. Internet Core: The part of the Internet created through network links between ISPs that creates the ability of the ISPs to send IP packets to the customers of the ISPs that connect to the core. Firewall: A networking function, implemented either as a standalone device or as part of an integrated device, that performs network security functions at the edge of a network. DMZ: A networking term borrowed from the real world, a demilitarized zone (DMZ) in a network is a part of a company’s TCP/IP network that hosts outside the company can access, with less restrictive security rules as compared to other hosts inside the company. Tier 1 ISP: A general category for an ISP in......

Words: 838 - Pages: 4

Unit 4 Programming Exercise

...Short Answers 1-7 1. How do modules help you to reuse code in a program? A. It reduces the duplication of code within a program by reusing the module that was written once. 2. Name and describe the two parts that a module definition has in most languages. A. Header and a body, header indicates starting point, and the body is a list of statements. 3. When a module is executing, what happens when the end of the module is reached? A. It’s executed and returned back to the point in main program where it was sidetracked from. 4. What is a local variable? What statement is able to access a local variable? A. A variable declared inside a local module, only statement within a module 5. In most languages, where does a local variable’s scope begin and end? A. Begins at the variables declaration within a module and ends at the end of the module in which the variable is declared. 6. What is the difference between passing an argument by value and passing it by reference? A. By value only a copy of the argument’s value is passed. By reference its passed into a special modification parameter. 7. Why do global variables make a program difficult to debug? A. Because global is used throughout all modules and hard to track. Algorithm Workbench Review 1, 5, 6, 7 1. Design a module named timesTen. The module should accept an Integer argument. When the module is called, it should display the product of its argument multiplied times 10. ......

Words: 335 - Pages: 2

Unit 4

...Unit 4 Homework 1. What are the five advantages and disadvantages of using global variables? Advantages * It is accessible to all modules in a program * You only have to declare it once outside the modules * It is good to use it for constants you want to keep consistent * It simplifies maintenance, avoids duplication of local constants * It can make a program easier to read in reference to constants Disadvantages * It makes debugging difficult * If modules use global variables it is dependent upon the module and if other modules are presented you have to redesign all over each time. * Any statement in a program can change the variable * It makes a program hard to understand since it can be modified and have to be aware of all other parts of the program that access it. * Global variables are not willing direct into flowcharts 2. How can you declare global and local variables in flowcharts? * Global variables are displayed in pseudo code but not in flowcharts directly In order to declare global variables in a flowchart, you’d put that variable in the main part of the program (the main box where other functions will branch off from) for local variables, you’d put those variables in the box where each separate functions executed. 3. What is the main difference between global and local variables? * A global variable applies to the entire application you are writing as for a local variable it could only apply for the section you are......

Words: 292 - Pages: 2

Unit 4

...Unit 16: Human Resource Management in Business (10 Credits) Assessment Sheet Name: ……………………………………………………………………………… | | | | | |Assessment Criteria |Achieved | | | | | |Pass 1 |Describe the internal and external factors to consider when planning the human resource | | | |requirements of an organisation | | | | | | |Pass 2 |Describe how the skills that employees require to carry out jobs in an organisation are | | | |identified | | | | | | |Pass 3 |Outline how an organisation motivates it’s employees | | | | ...

Words: 1556 - Pages: 7

Programming Unit 10 Homework

...Unit 10 Assignment 1: Homework Short Answer Ch10 #1 Describe the three steps that must be taken when a file is used by a program. Open the file, Process the file, Close the file #2 Why should a program close a file when it’s finished using it? By closing a file, any unsaved data that is held in the buffer is saved to its file. Also, when a program closes files that are no longer being used, the files will not take up more of the operating system's resources than necessary. #4 If an existing file is opened in append mode, what happens to the file’s existing contents? In most languages, when you open an output file and that file already exists on the disk, the contents of the existing file will be erased. #5 In most languages, if a file does not exist and a program attempts to open it in append mode, what happens? The Program will create a new file Algorithm Workbench Ch10 #1 Design a program that opens an output file with the external name my_ name. dat, writes your name to the file, and then closes the file. Declare an internal name for an output file. Declare outputFile myFile // Declare the variable to hold values // that will be read from the file Declare String name // Open a file named my_name.dat on // the disk Open myFile “my_name.dat” // Write your name to the file Write myFile “Your Name” // Close the file Close myFile #2 Design a program that opens the my_ name. dat file that was created by the algo-rithm in question......

Words: 651 - Pages: 3

Türkisch für Anfänger | Twoje gwiezdne imię | واقي الشاشة