...the module in which its declared and only statements inside that module can access that module can access the variable. 5. The local variable usually beings at the variables declaration and ends at the end of the module which is then the variable is declared. 6. The difference between the both is that only a copy of the arguments value is passed and passing by reference means that the argument is passed into a specific type of parameter. 7. Global variables make debugging difficult because they make programming hard to understand, modules that use global variables are usually dependent and you have to track down every statement. Algorithm Workbench 1. Module main() Declare userNum as Integer Display “Enter a number” Input userNum Call TimesTen(usernum) Display usernum End 5. 13.4 00.0 00.0 6. 1, 3.4 0, 0 0, 0 7. Allows changes the values of passed parameters 1,3.4 0,0 0,0 Doesn’t allow changing of parameters 1,3.4 0,0 1,3.4 Programming Exercises 1. Kilo=input (“Enter distance in kilometers”) Miles=Kilo Print”, Kilo 2. Module TotalPurchase Declare Double amount, total Declare TAX=.06 While I<6 Display “Enter the price” Input amount Total=total+amount I=I+1 End while Display “Subtotal is:” + total Display “Tax is:” + (total*TAX) Display “Total is:”=(total*TAX)+total) End...
Words: 309 - Pages: 2
...Calling an external function or program that is written in a different programming language like a Java program within a Visual Basic program you first need to know the Function fundamentals that’s executed in any programming language. I came across this website called maples, where they have the ability to connect to and call functions from other programming languages. Maple uses this for various reasons. Like all other languages, the F# function has a name, it can have parameters, has a body and takes arguments. F# also supports functional programming constructs such as handling functions as values, depleting unnamed functions in expressions, composition of functions to form new functions, curried functions, and the implicit definition of functions by way of the partial application of function arguments. Maple's help system documents all the External Calling functions so you can see what is available. Briefly, however there are functions for converting Maple types to C and back, creating and interacting with Maple data structures creating and interacting with Maple language elements (names, procedures, etc), printing to the Maple interface, memory allocation, evaluating Maple statements and raising exceptions. There is even a C interface to the Task Programming Model. The function-name is an identifier that represents the function. The parameter-list consists of successive parameters that are separated by spaces. You can specify an explicit type for each parameter, as described...
Words: 394 - Pages: 2
...Introduction Selection structures allow computer programs to perform different functions depending on if the condition of the function is true or false. Selection structures also enable the program to decide on a particular action based on the input of the user or other processes. There are several different types of selection structures that can be put into operation, they are the IF selection statement, the IF ELSE selection statement and switch selection statement. This paper will attempt to explain selection structure and its different types and will also give a real life scenario in pseudo code. Selection Control Structure Computer programs utilize selection structures to choose from a variety of actions or processes. These processes typically have an outcome of true or false. When a program reads as true the process will be directed to the output that enables it to be true and vice versa for false processes. With computers having the ability to solve problems, make decisions and follow direction with the aide of a program it eliminates many human errors. The “IF” selection statement structure is used when there is a solitary or a collection of inputs to be executed to decide if the condition is true or false. If a process is submitted as false the “IF else” statement is rendered and the false output is passed over and the computer continues executing to the next selection structure. The IF statement structure also compares two values with relational operators: •...
Words: 505 - Pages: 3
...Reverse engineering involves taking something apart to see how it works. The advantages are you can learn the kind of system functions a target program is using. You can learn the files the target program accesses. You can learn the protocols the target software uses and how it communicates with other parts of the target network. The most powerful advantage to reversing is that you can change a program's structure and thus directly affect its logical flow. The disadvantages would be by enabling competitors to create competing devices, the possibility of reverse engineering might decrease the incentive for technology creators to develop new products, and reducing the manufacturer’s control over consumer uses for the product might have the same effect. One tool is REC Studio 4 - Reverse Engineering Compiler some of the features are Disassembler, Disassembler, Calling conventions, Floating-point, Windows Debugger. Short Answer 5. The variable’s name, and the variable’s data type 6. Some languages assign a default value such as 0 to uninitialized variables. In many languages, however, uninitialized variables hold unpredictable values. Algorithm workbench review 3. set b = 2+a Set a = b * 4 Set b = a / 3.14 Set a = b – 8 4. a. Set result = x + y b. Set result = z * 2 c. Set result = y / x d. Set result = y – z result = x++ - y; Answer -4 result = 4 – 8 = -4 result = ++w + y; Answer w = w + 1 = 5 + 1 = 6 result = 6 + 8 = 14 5. Declare...
Words: 297 - Pages: 2
...Exploring Programming Languages Computers don't do anything without someone telling them what to do, much like the average teenager. To make the computer do something useful, you must give it instructions in either of the following two ways. When you write a program it tells a computer what to do, step by step, just as you would like when taking directions. When you buy a program that someone else has already written, it tells the computer what to do. Ultimately, to get a computer to do something useful, you (or somebody else) must write a program. A program does nothing more than tell the computer how to accept some type of input, manipulate that input, and spit it back out again in some form that humans find useful. Table 1 lists some common types of programs, the types of input that they accept, and the output that they produce. The five popular programming languages in the 1970’s were Pascal, C, SQL, KRL, and COMAL. Pascal is an influential imperative and procedural programming language, designed in 1968–1969 and published in 1970 by Niklaus Wirth. C (/ˈsiː/, as in the letter C) is a general-purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. SQL was developed at IBM by Donald D. Chamberlin and Raymond F. Boyce in the early 1970s. SQL often referred to as Structured Query Language. KRL is a knowledge representation language, developed by Daniel G. Bobrow and Terry Winograd while at Xerox PARC and Stanford University...
Words: 839 - Pages: 4
...Computer Programming Computers and machines have definitely changed people's lives over the years influencing academic life, workplace, and even the home setting. Therefore, it is important to become knowledgeable about computers and its different applications. Without doing so can severely affect one's chances in succeeding especially in his or her professional life since majority, if not all, of companies around the world depend on computers and machines. There are numerous jobs that deal specifically on the development of technology, including computers. One of the major careers in the field of computers is computer programming. People who work in this field are responsible for “writing, testing, and maintaining the instructions that computers follow to perform their functions. They also focus on conceiving, designing, and testing logical structures for solving problems by computer” (“Computer Programmers”). Literally, they program computers, softwares, and applications to function the way computers should. In 2007, “40 percent of companies expected to add programmers and information technologists, 45 percent expected to maintain their staffs, and 81 percent planned to increase the salaries of their computer programmers” (“The 2007 Job Market Outlook for Computer Programmers”). However, these numbers are not enough because it seems that the job outlook for this profession is not good. “The occupation is forecasted to grow more slowly than the average for all other occupations...
Words: 911 - Pages: 4
...After researching the programming languages between the eras of 1970s-2000s I discovered there were many types of programming languages being developed at a spectacular rate. The popularity of the languages were dependent upon what you were trying to program. Below you will find a general idea of 5 programming languages and a brief description of those languages. 1970s- PASCAL • Designed in 1968-1969 • Published in 1970 by Niclaus Wirth • Historically influential and procedural programming language • Intended to encourage good programming practices using structured programming and data structuring • Influential imperative and procedural programming language 1980s- C++ (pronounced see plus plus) • Statically typed, free-form, multi-pariadigm, compiled, general-purpose programming language • Middle-level language o Comprises a combination of both high-level and low-level language features • Developed by Bjarne Stroustrup starting in 1979 at Bell Labs as an enhancement to the C programming language • Renamed C++ in 1983 • Has imerative, object-oriented, generic programming features • Provides low-level memory manipulation • For use in embedded systems or operating system kernels • Is a compiled language • Available on many platforms and provided by various organizations 1990s- JAVA • Originally developed by James Gosling at Sun Microsystems • Released in 1995 as core component of Sun Microsystems’ Java platform • Derives much of its syntax from C and...
Words: 470 - Pages: 2
...Programming Solutions Being able to create a solution to a certain problem through programming can be a huge task to undertake, but it is a task that must be accomplished in order to get certain things done. Many companies face problems in the IT field that can be solved through programming, from simple to very complex, these problems usually require some sort of input and variables in order to create a solution. One problem that I face in the workplace of construction, is trying to figure out the number of ceiling tiles we will need to fit the ceilings in most offices we build. The ceiling tiles are a certain size and cover large areas which can be a tedious task trying to count how many tiles it will take to fill in the ceiling. A programming solution could be very beneficial in an instance such as this because by creating inputs such as the size of the tiles and the area they need to cover, an output could be the number of tiles that will be needed and thus saving a large amount of time on counting every space they need to fill. This problem of having to determine the number of ceiling tiles it will take to cover the celling area is normally done by counting the spaces in the ceiling that need to be filled and then determining how many tiles will need to be purchased. By coming up with a program to solve this problem would no doubt save a lot of time and even money by not buying an excess amount and either throwing them away or storing them. I believe a simple program would...
Words: 701 - Pages: 3
...Benefits of Programming Knowledge John Padgett IT/ 215 August 8, 2013 Chan Benefits of Programming Knowledge When you are an IT professional, you really want to know as much as you can about your particular specialty as an IT member and you also need to have some knowledge in programming concepts as well. It really doesn’t matter what you do as an IT team member for a particular company, but as a member you need to have basic programming concept skills to be effective and understanding how to solve any problems that you may encounter. The main problem today for any IT division of a company is being able to support all aspects of IT that company may need. It starts with security for the company and its data all the way to systems managers and network engineers just to name a few of the positions that IT professionals have skills to perform those jobs within the companies IT team. Everything that you will do as an IT professional will require you to have some basic knowledge in programming concepts because just about all the areas in the IT field ultimately come down to programming the computer to do a specific function or task. If you don’t have the basic skills of programming concepts you will be lost when it comes to trouble shooting any problems. As an It professional you will come across many circumstances that will require you to have programming fundamentals to do the job required at the time. Having knowledge in the JAVA language is beneficial...
Words: 515 - Pages: 3
...can occur in a program but can be handled in a way that allows the program to continue operation.(Editorial Board, 2014) Dealing with errors in a well-defined way allows programmers to write code to handle errors. This is exception handling. There are pros and cons for using error and exception handling. Exception handling enables normal code to be written and to deal with the exceptional cases code elsewhere. It also provides the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program. A second advantage of exceptions is the ability to propagate error reporting up the call stack of methods which allows grouping and differentiating error type objects. In traditional programming, error detection, reporting, and handling often leads to confusing code. This presents disadvantages because you lose compile time support, the calling method must take care is testing all possible return values, and the code blends leading to cluttering. These errors can only be corrected by fixing the program. The best programs of this type forestall errors if possible, recover from them when they occur without terminating the application, or (if all else fail) gracefully terminate an...
Words: 401 - Pages: 2
...Introducing Algorithms Dedric D. Owens PRG/211 – Algorithms and Logic for Computer Programming October 28, 2013 John Rogers Describe the Top-Down Approach to Algorithm Writing When developing a program, the top-down approach is more than not the preferred method. This is driven by what the program actually does; basically the function of the program. According to Penn State Lehigh Valley, “top-down design or stepwise refinement is an approach to designing an algorithm” and, there are four steps in this top-down design. These steps are as follows: You have to “understand the problem by thoroughly analyzing it.” Then, “formulate the algorithm by determining and writing the main tasks to be carried out as a sequence of general steps”. The third step is to “fill in more details by determining the sub-tasks, if any, for each main task. Lastly, “repeat step third step until you arrive at a precise algorithm expressed in terms of basic executable instructions.” How is pseudo-code used to assist in writing an algorithm? Pseudo-code is defined as an outline of a program written in a form that can easily be converted into real programming statements. It is sometimes confused with an algorithm when developing a program. In reviewing Prelude to Programming: Concepts and Design, Fifth Edition, (para. 2.1, pg 72 an algorithm is “a step by step method for solving a problem or doing a task.” Pseudo-code uses short and easy to understand phrases in plain...
Words: 602 - Pages: 3
...Assignment 1: Exploring Programming Languages 1970’s Pascal- created by Nicklaus Wirth Designed in 1968-1969 and published in 1970 Intended to teach students structured programming. Used to introduce as undergraduate courses. The first compiler was designed in Zurich for the CDC 600 mainframe computer. Small Talk- Created by Alan Kay, Dan Ingalls, Adele Goldberg Appeared/created in 1972 Was designed to underpin the new world of computing by the human computer symbiosis. For educational use. Influenced by Logo and Sketchpad. Scheme- Created in 1975 Designed Guy L. Steele and Gerald Jay Sussman Was influenced by Lisp, ALGOL, and MDL. Designed to choose lexical scope and was the first to require implementations to perform tail call optimization which gives stronger support for functioning programming. Once was one of the first to support first class continuations. SQL- Created in 1974 Designed by Donald D. Chamberlin and Raymond F. Boyce Influenced by Data log. Designed to manipulate and retrieve data stored in IBM’s original quasi-relational database management system. ML - Created by Robin Milner & others at university of Edinburgh Created in 1973 Motivated by or inspired by ISWIM ...
Words: 1049 - Pages: 5
... | | | 4. In a structured program, any structure can be nested within another structure. | a. | True | | b. | False | | | | 5. A structured program must contain a sequence, selection, and loop structure. | a. | True | | b. | False | | | | 6. Because you may stack and nest structures while retaining the overall structure, it might be difficult to determine whether a flowchart as a whole is structured. | a. | True | | b. | False | | | | 7. As a general rule, an eof question should always come immediately after an input statement because the end-of-file condition will be detected at input. | a. | True | | b. | False | | | | 8. Structured programming is sometimes called goto-less programming. | a. | True | | b. | False | | | | 9. No matter how complicated it is, any set of steps can always be reduced to combinations of the two basic structures of sequence and loop. | a. | True | | b. | False | | | | 10. The case structure is a variation of the sequence structure and the do loop is a variation of the while loop. | a. | True | | b. | False | | | | 11. Programs that use _____ code logic are unstructured programs that do not follow the rules of structured logic. | a. | case | b. | loop | | c. | spaghetti | d. | nested | | | | 12. With a(n) ____, you perform an action or task, and then you perform the next action, in order. | a. |...
Words: 1062 - Pages: 5
...True or False (Circle T/F if you think the statement is true/false) (Each question worth 5 points) 1. In C#, a project is a set of files and a solution is a set of projects. T 2. Every object you create or use in C# programming has a specific type usually. When a method doesn’t return anything, there is no return type defined for the method. F 3. In C#, some of the objects, variables or constants don’t have a specific type. F 4. The continue statement skips the remaining statements in the loop (any loop) and transfers control to the test condition. T 5. A smaller type must be explicitly cast to a compatible larger type. F 6. Assume you declared a constant when you’re programming. Although it is called a “constant”, its value can be changed when the program is running. F 7. The members in class A that are marked by private are accessible to methods of class A and also to methods of classes derived from class A. F 8. In C#, when you declare a variable without initializing it, the system will initialize the variable to 0 automatically as VB does. F 9. The system will execute a mathematical formula from left to right; you don’t have to consider the issue of operator precedence in C#. F 10. Implicit casting sometimes runs the risk of data loss. F Multiple Choice questions: (Circle all that applies. If all of your choices are correct but you missed the other correct choices, you will receive partial...
Words: 390 - Pages: 2
...Programming in Unix Introduction to Sociology In today’s society, computers have played a major part of how corporations and individuals conduct business. In a sense, they have made some of the hardest tasks fairly easy by the click of a button or by typing a certain command. Computer programs perform both simple and complex calculations with user seeing the end result. However, computer programs have to be written by computer programmers. To understand how programs work, you must consider how the computer interprets the information entered by the programmer. “A program is a set of instructions that guide the computer in performing its basic and logical arithmetic operations (Afzal, 2008, p. 349).” These programs have to be written in a certain language for the computer to interpret. There are several types of languages used to write programs. Although the programmer types words and numbers to perform these mathematical and logical calculations, the computer sees only 1’s and 0’s. This is called machine language. There is also assembler language. “Instead of a series of zeros and ones, assembler language uses some recognized symbols, called mnemonics (memory aids), to represent instructions (Afzal, 2008, p. 349).” High level language is the language in which the programmer desires to write in such as Pascal, C++, C, and Java to name a few. To translate a high level language to machine language, a compiler or an interpreter must be used. The first step...
Words: 1049 - Pages: 5