Premium Essay

Pt 1420 Unit 4

In: Computers and Technology

Submitted By mashon01
Words 384
Pages 2
Unit 4 Research 1: Using Global Variables
Advantages of using Global Variables * Global variable belongs to every function in the program. * Avoid passing frequently-used variables between several functions. * A global variable is accessible in every scope. * A global variable can potentially be modified from anywhere. * It can be accessed from any other files using extern.
Disadvantages of using Global Variables * Non-locality -- Source code is easiest to understand when the scope of its individual elements is limited. Global variables can be read or modified by any part of the program, making it difficult to remember or reason about every possible use. * Implicit coupling -- A program with many global variables often has tight couplings between some of those variables, and couplings between variables and functions. Grouping coupled items into cohesive units usually leads to better programs. * Concurrency issues -- if globals can be accessed by multiple threads of execution, synchronization is necessary (and too-often neglected). When dynamically linking modules with globals, the composed system might not be thread-safe even if the two independent modules tested in dozens of different contexts were safe. * Namespace pollution -- Global names are available everywhere. You may unknowingly end up using a global when you think you are using a local (by misspelling or forgetting to declare the local) or vice versa. Also, if you ever have to link together modules that have the same global variable names, if you are lucky, you will get linking errors. If you are unlucky, the linker will simply treat all uses of the same name as the same object. * Memory allocation issues -- Some environments have memory allocation schemes that make allocation of globals tricky. This is especially true in languages where "constructors" have…...

Similar Documents

Premium Essay

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

Premium Essay

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

Free Essay

Pt 1420 Unit 10 Homework

...Introduction to Programming Unit 10 Assignment 1 Short Answer 1. * Open the file – Opening the file creates a connection between the file and a program; this allows the program to read data from the file. * Process the file – Data is either read from the file or written to the file * Closing the file – The file must be closed when a program is finished using it. Closing the file disconnects the file from the program. 2. The file must be closed so the program will force any unsaved data in the buffer to be written to the file. 4. The file will not be erased, and any new data will be written at the end of the file’s current contents. 5. The program will create a new file. Algorithm Workbench 1. Declare OutputFile myFile Open myFile “my_name.dat” Write myFile “fatima” Close myFile 2. Declare InputFile myFile Declare String name1 Open myFile “my_name.dat” Read myFile name1 Close myFile Display ”Hello! My name is,” 3. Declare OutputFile numberList Declare Integer counter = 1 Open numberList “number_list.dat” For counter = 1 to 100 Write numberList, counter Next counter End For Close numberList 4. Declare InputFile number_list Declare Integer myNumber Open number_list ”number_list.dat" Display "Here are the numbers: " While NOT eof (number_list) Read numberList myNumber Display myNumber End While Close myName Programming Exercise Pg. 410 1.......

Words: 291 - Pages: 2

Free Essay

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

Premium Essay

Pt 1420

...Assignment 6. A loop that has no way of stopping, and repeats until the program is interrupted. 7. A Do-While loop 8. A variable that is used to accumulate the total of a series of numbers. 9. A sentinel is a special value that marks the end of a list of items. 10. A sentinel value must be unique enough that it will not be mistaken as a regular value in the list. Algorithm 3. // Declare a counter variable. Declare Integer // Constant for the maximum value Constant Integer MAX_VALUE = 100 //Display the multiples of 10 from 0 through 100 For counter = 0 to MAX_VALUE Display counter End For   4. //Declare Integer number Declare an accumulator variable Declare Integer total = 0 Declare Integer counter For counter = 1 to 10 Display “Enter a number.” Input number Set total = total + number End For Display “The total is”, total 9. Declare Integer count For count < 50 Display “The count is “, count Set count = 1 To 50 End For 10. //Declare integer count While count   Research List three examples that show when a count-controlled loop is better than condition-controlled loop in programming? 1. It keeps a count of the number of times you want to use the program to input data 2. It only runs as many times as you have instructed the program to run 3. It will stop after the allotted time it has been instructed to 2.List three examples that show when a condition-controlled is better than......

Words: 297 - Pages: 2

Premium Essay

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

Premium Essay

Pt 1420 Unit 2 Homework

...Unit 2 Homework Short Answer Pg. 71 (1-4) 1.) Work directly with and interview the customer. 2.) Pseudocode is an informal language that has no syntax rules, and is not meant to be compiled or executed. 3.) Input is received, some process is performed on the input, output is produced. 4.) User-friendly means that something is easy for anyone, regardless of their level of experience, to use. Algorithim Workbench Pg. 71 (1-2) 1.) Declare Height as Integer Display “ Enter Height “ Input “ Height “ 2.) Declare Color as String Display “ Enter Color” Input “ Color “ Please view Visio Attachments for flow charts Programming Exercises Pg. 72 (1&4) 1.) Sub Main() Console.WriteLine("Mark Gutierrez") Console.WriteLine("123 Bonehead Lane") Console.WriteLine("702-555-555") Console.WriteLine("NSA") Console.ReadLine() End Sub End Module 4.) Module Module1 Sub Main() Dim gtotal As Double Dim taxamount As Double Dim subtotal As Double Dim tax As Double = 0.06 Dim item1 As Double Dim item2 As Double Dim item3 As Double Dim item4 As Double Dim item5 As Double Console.WriteLine("enter item #1 price") item1 = Console.ReadLine() Console.WriteLine("enter item #2 price") item2 = Console.ReadLine() Console.WriteLine("enter item #3 price") item3 =......

Words: 270 - Pages: 2

Free Essay

Nt 1420 Unit 3 Answers

...Short Answers Unit 3 1. WHAT TWO THINGS MUST YOU NORMALLY SPECIFY IN A VARIABLE DECLARATION? The variable’s name The variable’s data type 2. WHAT VALUE IS STORED IN UNINITIALIZED VARIABLES? =0 Research Unit 3 1. WHAT IS REVERSE ENGINEERING? The process of taking a piece of software or hardware an analyzing its functions an information flow and then translating those processes. 2. WHAT ARE THE ADVANTAGES AND DISADVANTAGES TO USE REVERSE ENGINEERING TO DISCOVER THE LOGICS OF A SOFTWARE PROGRAM? Advantages- one can repair certain bugs, see how a program operates, and improve the operation of the program. Disadvantages- certain other bugs may be introduced during the process 3. FIND ANY ONE TOOL AVAILABLE TO PERFORM REVERSE ENGINEERING OF SOFTWARE PROGRAMS. LIST AT LEAST FIVE FEATURES OF THAT TOOL. GDB-GNU DEBUGGER  Allows taking a program and breaking it down to the assembly language level  Debug your programs  Examine your programs  Command line based tool which makes it easier to issue different parameters  Debug the kernel of any operating system UNIT 3: ALGORITHM WORKBENCH 3. SET B= (2 + A) SET A= (B + 4) SET B=( A/ 3.14) SET A= (8-B) 4. A. Set result = x + y 12 = 4 +8 B. Set result = z * 2 4 = 2 * 2 C. Set result = y / x 2 = 8 / 4 D. Set result = y – z 6 = 8 – 2 5. Dim cost1 As Double = 0 6. Dim cost1 As Integer = 0 7. Dim cost1 As Integer = 27 8. Total = 10 + 14 9. due......

Words: 257 - Pages: 2

Premium Essay

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

Free Essay

Pt 1420

...PT 1420 Student Name:__________________ Introduction to Programming Winter 2014/2015 Instructor: Martin Remmele Unit 7 Homework Assignment Due by end of first break February 10, 2015 Learning Objectives and Outcomes NOTE: This section lists concepts and techniques to be understood from this unit. The actual assignment that you are to complete is found in the next section: “Assignment Requirements”. * Be able to Use pseudocode/flowcharts to represent repetition structures. * Be able to Create While, Do-While, and Do-Until conditional loops. * Be able to Describe the implications of an infinite loop. Assignment Requirements Complete the following exercises. An exercise that calls for an algorithm may be written in English as a series of steps. An exercise that calls for program statements may be written in a) the text’s pseudocode, b) your own preferred pseudocode notation or c) Visual Basic. (VB code can simply be typed into your Word document; it does not have to be created in the development environment.) The logic of the statements will be more important to the grade than the syntax. * Short Answer Review Questions 1-5, starting on page 213 (5 pts each) * Algorithm Workbench Review Questions 1, 2, 7, and 8, starting on page 213 (10 pts each) * Programming Exercises 1, 3, and 4, starting on page 214 (10 points each) Required Resources *...

Words: 310 - Pages: 2

Free Essay

En 1420 Unit 1 Assignment

...EN 1420 Unit 1 Assignment 1. When I first encountered the word argument I immediately thought of politics. Now, I think of a conversation between people of opposing views discussing their personal point of view. 2. Politics/ School classes/ competing companies via T.V. commercials 3. Traditional arguments can be described as someone who wants to convince their audience to side with them and accept their points of view. This is seen in presidential elections and public debates. Consensual argument is the emphasis of agreement. This type of argument is often seen in the classroom amongst peers. 4. Some of the conditions necessary for an argument to work best would be; an issue, an arguer, audience, common ground, a forum, and audience outcomes. 5. Conditions of a failing argument would be; no disagreement or reason to argue, risky r trivial issue, inability to establish common ground, and standoffs or fights resulting in negative outcomes. 6. Ethical Argument- Ways to rebuild the economy/ ways to better the path of our nation. Unethical Argument- New credit lines that incur debt/ Advertisements for plastic surgery. 7. The role of the audience has changed drastically in the world as we catapult into the digital age. So easily now people are able to reach new information (good and bad, true and false) by simply getting onto the internet and clicking around. 8. Four sources of arguable issues can be found in many places, but the......

Words: 254 - Pages: 2

Premium Essay

Pt 1420

...Assignment and Calculations, page 43). Set creditsLeft = creditsTaken – creditsNeeded Terms should be switched Step 3: Write the exact output you would expect from the following line of code if the user of the program enters “Nolan Owens”. (Reference: Displaying Items, page 40 – 41). Display “The student’s name is “, studentName The student’s name is Nolan Owens Step 4: Write the exact output you would expect from the following line of code if the user of the program enters a name of Nolan Owens and they have taken 20 credits so far. (Reference: Displaying Items, page 40 – 41). Display “The Network Systems Administration degree is awarded after 90 credits and “, studentName, “has “, creditsLeft, “left to take before graduation.” The Network Systems Administration degree is awarded after 90 credits and Nolan Owens has 70 left to take before graduation. Step 5: Complete the following pseudocode to solve the programming problem. 1. //Provide documentation on line 2 of what this program does 2. //Calculates credits needed to graduate 3. //Declare variables on lines 4, 5, 6, and 7 4. Declare Real creditsTaken 5. Declare Real creditsLeft 6. Declare String studentName 7. Constant Real CREDITS_NEEDED = 90 8. //Ask for user input of studentName and creditsTaken //on line 9 - 12. 9. Display “What is your name?” 10. Input studentName 11. Display “How many credits do you have?” 12. Input creditsTaken 13. //Calculate remaining......

Words: 603 - Pages: 3

Premium Essay

Unit 4

...it 4 as1PAUL LILLY TEREASA KATYNSKI UNIT 4 STUDY 1 Overcoming the perils of Canoe Lake * Describe the general structure of skin Epidermis, and Dermis The epidermis is the relatively thin, tough, outer layer of the skin. Most of the cells in the epidermis are keratinocytes. They originate from cells in the deepest layer of the epidermis called the basal layer. New keratinocytes slowly migrate up toward the surface of the epidermis. Once the keratinocytes reach the skin surface, they are gradually shed and are replaced by newer cells pushed up from below. The outermost portion of the epidermis, known as the stratum corneum, is relatively waterproof and, when undamaged, prevents most bacteria, viruses, and other foreign substances from entering the body. The epidermis also protects the internal organs, muscles, nerves, and blood vessels against trauma. In certain areas of the body that require greater protection the outer keratin layer of the epidermis is much thicker. Scattered throughout the basal layer of the epidermis are cells called melanocytes, which produce the pigment melanin, one of the main contributors to skin color. Melanin's primary function, however, is to filter out ultraviolet radiation from sunlight which damages DNA, resulting in numerous harmful effects, including skin cancer. The epidermis also contains Langerhans cells, which are part of the skin's immune system. Although these cells help detect foreign substances and defend the body......

Words: 555 - Pages: 3

Free Essay

Pt 1420 Homework

...Pt 1420 Unit 10 Homework Introduction to Programming Unit 10 Assignment 1 Short Answer 1. * Open the file – Opening the file creates a connection between the file and a program; this allows the program to read data from the file. * Process the file – Data is either read from the file or written to the file * Closing the file – The file must be closed when a program is finished using it. Closing the file disconnects the file from the program. 2. The file must be closed so the program will force any unsaved data in the buffer to be written to the file. 4. The file will not be erased, and any new data will be written at the end of the file’s current contents. 5. The program will create a new file. Algorithm Workbench 1. Declare OutputFile myFile Open myFile “my_name.dat” Write myFile “fatima” Close myFile 2. Declare InputFile myFile Declare String name1 Open myFile “my_name.dat” Read myFile name1 Close myFile Display ”Hello! My name is,” 3. Declare OutputFile numberList Declare Integer counter = 1 Open numberList “number_list.dat” For counter = 1 to 100 Write numberList, counter Next counter End For Close numberList 4. Declare InputFile number_list Declare Integer myNumber Open number_list ”number_list.dat" Display "Here are the numbers: " While NOT eof (number_list) Read numberList myNumber Display myNumber End While Close myName Programming Exercise Pg. 410 1. Declare Integer number......

Words: 296 - Pages: 2

Premium Essay

Fires of Jubilee Pt 4

...Antwan Rowel Mr.Kimbrough History B20a MW 9:35 November 7, 2011 Fires of Jubilee Pt.4 In The Fires of Jubilee Nat Turner's Fierce Rebellion: Stephen Oates gives an account of the brief but deadly slave revolt in and around Southampton, Virginia. His controlling theme is that of religion and the profound influence that it had on the development of Nat Turner's charismatic persona and his rationale for engaging in a project of deliberate murder of people who had at least in the context of slavery as a given of Turner's experience, treated him quite decently. The effects of Nat Turner's rebellion were profound. The insurrection of Nat Turner was inspiration for all slaves, even if just 60 whites were killed to the 140 blacks. I am impressed by his courage. The attitudes of many plantation owners changed as a result of Nat. Many people had believed that slaves would never think of hurting their "loving, Christian" master. What Nat did scared many whites tremendously. The Virginia state legislature actually debated freeing all slaves to avoid future conflict. Of course this never happened but this was the first time that such an idea had ever been discussed. Many slave holders blamed the rebellion on the abolishment movement. The same year of Nat's rebellion, William Lloyd Garrison began publishing "The Liberator". Some people attributed this to the cause of the killings. Laws were passed that forbid teaching slaves to read or write. An educated slave could be a dangerous......

Words: 593 - Pages: 3