Free Essay

# Programming Final

Submitted By johnboyd
Words 991
Pages 4
Programming Final
1. The case structure lets the value of a variable or an expression determine which path of execution the program will take. It’s a multiple alternative decision structure that allows you to test the value of a variable or an expression and then use that value to determin which statement to execute.
2. The AND operator takes two Boolean expressions as operands and creates a compound Boolean expression that is true only when both expressions are true. True AND True = True
3. The OR operator takes two Boolean expressions as operands and creates a compound Boolean expression that is true when either of the sub expressions is true. True OR False = True
4. The NOT operator is a unary operator that takes a Boolean expression as its operand an reverses its logical value. The Not operator reverses the truth of its operand. If it is applied to an expression that is true the operator returns false. If it is applied to an expression that is false it returns True. Not true = False, Not false = True
5. Flow chart 6. And, Or , Not
7. And, Or, Not 8. And, OR, Not
9. > greater than, < less than, >= greater than or equal to, <= less than or equal to, == equal to, != not equal to
10. Case structure has a diamond at the top and branches down into different parallelograms.
11. A repetition structure causes a statement or set of statements to execute repeatedly.
12. A condition-controlled loop uses a true/false condition to control the number of times that it repeats, a count-controlled loop repeats a specific number of times. Both the While and Do-While loops cause a statement or set of statements to repeat as long as the condition is true. The Do-Until loop causes a statement or set of statements to repeat until a condition is true.
13. #12
14. A sentinel is a special value that marks the end of a list of values. Lets a loop know it can terminate.
15. A count-controlled loop iterates a specific number of times. A for-loop is a specifically designed as a count-controlled loop.
16. While-loop (how many times will u loop) trick question
17. While-loop “ “ “ “ trick question
18. While-loop “ “ “ “
19. Count-controlled loops are commonly used in programs. For example suppose a business is open six days a week and you are going to write a program that calculates the total sales for the week. You will need a loop that iterates exactly six times. Each time the loop iterates, it will prompt the user to enter the sales for one day.
20. pseudocode
21. The Do-while loop is a posttest. This means it performs an iteration before testing its condition. happens at the end.
22. pseudocode
23. loop-structure, which repeats as long as the Boolean expression is false. Do-until loop
24. The amount by which the counter variable is incremented in a for-loop is known as the step amount. Default is 1
25. What type of loop. for-loop ?
26. A while-loop is a pretest, which means it test its condition before performing an iteration. The Do-while is a posttest.
27. Using a counter variable the loop performs the following three actions; initialization, test, and increment.
28. While-loop, How many times
29. For-loop, how many times.
30. For-loop, how many times.
31. An optional parameter list appears inside a set of parentheses. If the function doesnot accept arguments, then an empty set of parentheses will appear. Function header
32. In a function flow chart the starting terminal symbol usually shows the name of the function, along with any parameters that the function has. The ending terminal symbol reads RERTURN, followed by a value or expression.
33. If a function returns a integer, the word Integer will appear, if it returns a real number the word Real will appear, and if it returns a string the word String will appear. It returns when it is called
34. The value that is returned must be the same data type that is in the header.
35. “ “ “ “
36. Input validation is part of the practice of defense programming. Empty input happens when an input operation attempts to read data, but there is no data to read. (pushing enter without putting in a value)
37. Defensive programming is the practice of anticipating errors that can happen while a program is running.
38. An input validation loop is called a error trap.
39. In Data type mismatches the first step is to read the input as a string, 2nd is determine whether the string can be converted, and 3rd is convert or send an error message and start over.
40. Boolean expression with an AND in it both expressions have to be true.
41. “writing data to” is the process of saving data to a file.
42. “reading data from” is the process of retrieving data from a file. input file is used to describe a file that data is read from.
43. Output file is used to describe a file that data is written to, because the program stores output in it.
44. Process the file is the step data is either written to or read from the file.
45. A textfile contains data that has been enclosed as text.
46. A sequential access file you access data from the beginning of the file to the end of the file.
47. A Direct access file or random access file you can jump right to any piece of data in a file.
48. Filename extensions are short sequences of character that appear at the end of a filename and is preceded by a period.
49. An oval is a flow chart sysmbol that opens and closes a flowchart.
50. Append mode is being able to put data at the bottom of a file.…...

### Similar Documents

Free Essay

#### Programming

...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......

Words: 394 - Pages: 2

#### Programming

...times 4 and stores the result in a c. Divides a by 3.14 and stores the result in b d. Subtracts 8 from b and stores the result in a 8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total. 9. Write a pseudocode statement that subtracts the variable downPayment from the variable total and assigns the result to the variable due. 11. If the following pseudocode were an actual program, what would it display? Declare Integer a = 5 Declare Integer b = 2 Declare Integer c = 3 Declare Integer result Set result = a + b * c Display result 12. If the following pseudocode were an actual program, what would it display? Declare Integer num = 99 Set num = 5 Display num PROGRAMMING EXERCISES (Input, processing, and output) 2. Sales Prediction A company has determined that its annual profit is typically 23 percent of total sales. Design a program that asks the user to enter the projected amount of total sales, and then displays the profit that will be made from that amount. Hint: Use the value 0.23 to represent 23 percent 3. Land Calculation One acre of land is equivalent to 43,560 square feet. Design a program that asks the user to enter the total square feet in a tract of land and calculates the number of acres in the tract. Hint: Divide the amount entered by 43,560 to get the number of acres. 4. Total Purchase A customer is a store is purchasing five items. Design a program that asks......

Words: 1054 - Pages: 5

Free Essay

#### Programming

...de la olla se transfiere al agua, el agua empieza a subir de temperatura asta que hierve 8. Señale la diferencia entre estado y fase Cada ves que se cambia de estado se adquiere o pierde energía a esto se le llama calor latente cuando se esta cambiando de un estado a otro se le llama face, cuando se termio el proceso se determina estado. 9. La parte interior de un neumático de automóvil está bajo una presión manométrica de 206.84 kPa a 4°C. Después de varias horas, la temperatura del aire interior sube a 50°C. Suponiendo un volumen constante, ¿cuál es la nueva presión manométrica? 10. Una muestra de 2 L de gas tiene una presión absoluta de 300 kPa a 300 K. Si tanto la presión como el volumen se duplican, ¿cuál es la temperatura final? La misma 11. Si tanto el calor como el trabajo se pueden expresar en las mismas unidades, ¿por qué es necesario distinguir entre ambos? Por que al convertir un tipo de energía a otro siempre hay perdidas 12. El calor latente de vaporización del agua es 540 cal/g. Sin embargo, cuando 1 g de agua se evapora por completo a presión constante, la energía interna del sistema se incrementa en solo 500 cal. ¿Qué pasó con las 40 cal restantes? ¿Se trata de un proceso isocórico? ¿isotérmico? Isotermico, las 40 restantes subieron la temperatura del vapor a mas de 100 grados Puntos Extras Una bala de plomo de 5 g que se mueve a 200 m/s se incrusta en un trozo de madera. La mitad de su energía inicial es absorbida por la bala. ¿Cuál es......

Words: 717 - Pages: 3

Free Essay

#### Programming

...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 Module...

Words: 309 - Pages: 2

Free Essay

#### Programming

...Definitions ........................................................................................16 Datafile ............................................................................................................16 Record ..............................................................................................................16 Field ..................................................................................................................16 Key....................................................................................................................16 Search Key........................................................................................................17 A Quick Introduction to Object-Oriented Programming ......................................18 Problems with Procedural Languages ..............................................................18 Objects in a Nutshell ........................................................................................19 A Runnable Object-Oriented Program ............................................................21 Inheritance and Polymorphism ........................................................................24 New C++ Features ................................................................................................25 The string Class..............................................................................................25 The vector......

Words: 10065 - Pages: 41

Free Essay

#### Programming

...- -[ ] http://blog.renren.com/blog/73603/740437492 » / [ ] 2011-07-18 10:47 | ( : ) http://coolshell.cn/articles/4990.html 6 12 programming An open letter to those who want to start id Mailper Python Web “ Build Your Programming Technical Skills “ ( ) Notes/ActiveX/COM/ADO/ATL/.NET …… Mailper Delphi/Power builder ” Lotus 5 3D TA 561 ” The architecture of w-ai.org –... Some updates and my first Engl... / 10 Unix/Linux Windows 1 Linux Web+ 1 Python/Ruby Web 2 iOS Android Windows Windows Windows Linux+ Windows 9 : csv ( log python csv, python open, python sys) 52 word count (sys, os, path) (python sqlite) print Google (phrase, domain, use reader to follow tech blogs) 2 ( Vim / Emacs / Notepad++ Source Insight ( ctag) Cool IDE) / / 3 Unix/Linux Shell windows man ls/chmod/chown/rm/find/ln/cat/mount/mkdir/tar/gzip … sed/awk/grep/tail/less/more … ps/top/lsof/netstat/kill/tcpdump/iptables/dd… /etc /var/log /proc linux vmware player Ubuntu 1 6 9/6/13 1:36 PM - -[ ] http://blog.renren.com/blog/73603/740437492 /Linux 4 Web Web HTML CSS HTML Firefox + Firebug Javascript HTML DOM Firefox + Firebug Apache PHP PHP PHP chrome Nginx HTML MySQL MySQL SQL http://www.stanford.edu/~ouster/cgi-bin/cs142-fall10/index.php ) javascript HTTP: The Definite Guide browsers) Cookie/Session jQuery 4 3-5 ExtJS + Ajax ( +JSON (proxy, gateway, Javascript box model chrome DOM......

Words: 807 - Pages: 4

Free Essay

#### Programming Final Assignmentv1.1

...Task 1 LO 1.1 All high-level programming languages support the concept of data types. A data type defines a set of values that a variable can store along with a set of operations. Data types are used to store various types of data which is managed by program. Data type attaches with variable to determine the number of bytes to be allocate to variable and valid operations which can be performed on that variable. Although C has several built-in data types, it is not a strongly typed language, as are Pascal and Ada. C supports various data types and here some common data type as character, integer and floating-point types. C defines five foundational data types as defined below: ▪ character ▪ integer ▪ floating-point ▪ double floating-point ▪ valueless These are declared as by char, int, float, double, and void, respectively. These types form the basis for some other types also. The extent and choice of these and data types may contrast amongst processor natures and compilers. However, in all belongings an object of type char is 1 byte. C stores character type inside as an integer. Each character has 8 bits so, we can have 256 different characters values (0-255). Character set is used to map between an integer value and a character. The size of an int is ordinarily the same as the word length of the implementation setting of the program. C has 3 classes of integer storage namely short int, int and long int. All of these data......

Words: 5415 - Pages: 22

#### Programming

...Question: Analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as at least one function call and the use of at least one array. The specific problem you need to solve for the final project is: Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas. 2. What is the required output? What is the necessary input? How you will obtain the required output from the given input? Clearly describe variable names and definitions. Include all necessary formulas and example calculations. 3. Display pseudocode of your overall design including the Main module and the order of the module, subprogram and function calls. 4. Create a Hierarchy chart for the overall program in raptor 5. detailed pseudocode for each module, subprogram and function. 6. Add pseudocode comments with all major functionality and most minor functionality commented 7. Show test plan covering all major functionality and most minor functionality. Multiple Input and expected output provided for most modules. SOLUTION: Analysis: For this program, user will be asked for name, age and state of their family members, one by one, until the user decides to stop entering this information. To achieve the given task (printing average family......

Words: 919 - Pages: 4

Free Essay

#### Programming Final Project

...Description Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who lives in Texas. Analysis For the purpose of this program, the user will be asked a series of questions requiring the input of name, age, and state for each of their family member until the number of family members is met. In order to carry out the given task of finding the average age of family members along with the ones who live in Texas, the program should include the function of calculating and displaying the age. It should also include the ability to take the input of family names and print the family members who are only from Texas. Program Design Required outputs include: Average family age Names of family members only from Texas Required Inputs: Names of family members Ages of family members States where the family members reside Variable Declarations/Definitions: String array (s_Names/s_State) to hold names/states Integer array (i_Age/i_Count) to hold ages/family members The information the user inputs (age, name, state) will be stored in the arrays as defined above. Required Calculations: Average Age- Average age=(sum of ages of family members) divided by (number of family members provided) (Example) i_Count=6 i_Age[0]=15, i_Age[1]=25, i_Age[2]=13, i_Age[3]=56, i_Age[4]=70...

Words: 624 - Pages: 3

#### Programming

...flowcharts to describe a program’s structure. Use pseudocode to define a program’s structure. Formulate solution algorithms for calculations by properly following the order of operations. Assignment Requirements Answer: * Short Answer 1, 2, 3, and 4 on page 71 * Algorithm Workbench Review Questions 1 and 2 on page 71 * Programming Exercises Questions 1 and 4, starting on page 72 Required Resources Textbook Submission Requirements Submit your written answers to your instructor at the beginning of Unit 3. Unit 2 Research Assignment 1: Researching Variable Naming Rules Learning Objectives and Outcomes Determine program input, processing, and output stages. Create the necessary flowcharts to describe a program’s structure. Use pseudocode to define a program’s structure. Formulate solution algorithms for calculations by properly following the order of operations. Assignment Requirements Use the Internet and the ITT Tech Virtual Library to research the following questions: What are the variable naming rules of Visual Basic, Python, and Java? List three similarities and differences in between the three programming languages. Required Resources Textbook ITT Tech Virtual Library: http://library.itt-tech.edu Submission Requirements Submit your written answers to your instructor at the beginning of Unit 3. Labs Unit 2 Lab 2.1: Pseudocode Learning Objectives and Outcomes * Use pseudocode to define a program’s structure. *......

Words: 450 - Pages: 2

Free Essay

#### Programming Final Pt1420

...1. What is the term used for the memory address of the location of the statement immediately after the module called? Return Point 2. What tool would a programmer use to visualize the relationship between modules? Hierarchy charts 3. What is the term used for the variable that received an argument that passed into a module? Parameter 4. What is the term used that means only a copy of the argument’s value is passed into the parameter? “passing an argument by Value” 5. What’s the name of the variable that’s visible to every module and the entire program? Global 6. What is the term used that means the argument is passed into a parameter that will reference the content of the argument in the module. “passing an argument by Reference” 7. What’s the name of the structure that is a logical design that controls the order in which a set of statements executes? Control structure 8. Which symbol indicates that some condition must be tested in a flowchart? Diamond 9. What type of operator can be used to determine whether a specific relationship exists between two values? Relational 10. What operator (or symbols) are used to determine that the operands are NOT exactly the same value? != 11. What is the symbol in a flowchart that denotes a terminal point? Oval 12. Which flowchart symbol denotes a process? Rectangle 13. What is the term that represents “a storage location in memory”? Variable 14. List the variable naming rules: cannot...

Words: 500 - Pages: 2

#### Final Study Guide Programming

...Final study guide for programming 1)A case structure single alternative dual alternative is a nice way of taking nested if else statements and puts it. Its multiple alternative 2)False_True what logical operator would make it true? OR what would make that false? AND ^^^^^^^^^^ if an expression is false what operator would return or make it true? NOT what operators are these <> = ==? Relational first line of a case structure starts with the word case followed by? FALSE text expression loops are which structure cause them to loop repeatedly? Repitiion structure what type of loops uses a hulian expression to express the number of times it repeats? Condition controls. Which pair of loops causes a statemtnet or set of statements to repeat as long as it is true? While and Do what represents an ending value? Sentinal value 15)which loop is designed to intional test and incrment the counter? For Loop 19)When do we use a counter control loop? When we know how many times we want to loop which of the folllowing are good examples of a poset test loop? Do while and do until Which loop repeats a statement as long as an bulian expression is false? Do-Until what automatically counters as the end of a loop which statement doesnt contain but does at the end of the statementt? Its a for loop 26)this kind of loop performs a task at least once? Do-until using the counter example what loop performs three actions?refactor is the answer 31)function what__......

Words: 585 - Pages: 3

Free Essay

#### Programming

...Programming 1 - Semester 1, 2015 Assignment 1 Release Date: 27 / 02 /2015 Total raw marks: 60 Assignment weight: 6% NOTE: This assignment is to be undertaken individually—no group work is permitted. Background information For this assignment you are to complete a partially completed menu-driven, Java console application, which allows the user to select one of four options:     Display Time and Date Swim Fitness Summary Calculator Sentence Analyser Exit The incomplete code solution (in the source file called MenuDrivenProgram.java) is in the same Assignment 1 folder, available via myRMIT. The partially completed program already has code to display the menu. You should study the code and then compile and execute it without implementing the following options. This will allow you to understand the flow of execution of the program, as is. a) Once the processing for the selected option has been completed the program should return to the menu (that is, the program should not terminate). b) You do not need to handle runtime errors of any kind for this assignment and you may assume that the user will always enter input in the correct format. This applies both to the menu itself and the processing of the menu options. Program Features Menu Option A - Display Time and Date (10 marks) The program should retrieve the current time and date from the system and then display it in the format shown......

Words: 1404 - Pages: 6

Free Essay

#### Programming

...Prompt user for dusting whole house Get user response and store Prompt user for cleaning bathrooms Get user response and store Prompt user for clean floors Get user response and store Prompt user for make beds Get user response and store Prompt user for senior citizen Get user response and store Calculate senior citizen discount Calculate total price Calculate final price Display output total price Display output for final price End CODE Main //This program will calculate the senior citizen discount, total price and final price. The program will display results to the user. //Declare variables Declare dustWholeHouse, cleanBathroom, cleanFloor, makeBed, seniorCitizen totalPrice, finalPrice AS Float //Initialize variables Set dustWholeHouse = 0 Set cleanBathroom = 0 Set cleanFloor = 0 Set makeBed = 0 //Welcome message Write (“Welcome to Home Services Inc.! This program will list the prices of the services offered. It will calculate your senior citizen discount if applicable, the total price, and the final price. Please input data when prompted,”) Write (“Price list of services offered”) Write (“Dust whole house is \$120”) Write (“Bathroom cleaning is \$80”) Write (“Cleaning the floor is \$60”) Write (“Making your bed is \$20”) //Prompt 1 Write (“Do you want to dust whole house? - Enter 1 for “YES” or 0 for “NO” ”) Input prompt1 If prompt1 == 1 then Set “dustWholeHouse = 120” Else......

Words: 651 - Pages: 3

Free Essay

#### Programming

... | name | nationality | 01 | Pat | British | 02 | Hilary | British | 03 | Sven | Swedish | 04 | Pierre | French | | Event | eid | description | winner | 01 | running |   | 02 | jumping |   | 03 | throwing |   | | Competes | cid | eid | 01 | 01 | 02 | 01 | 03 | 02 | 04 | 02 | 04 | 03 | | Select the BEST answer from the following options based upon the provided data and data structures: Select one: a. There is a British competitor in every event. b. Pierre does not compete in any event c. Sven has been entered in two events d. Pat is competing in the jumping event e. Hilary has entered only the running event Question 1 If we write a program in a programming language and switch to SQL when we require to use the database, then the SQL environment in use is known as _______ SQL. Select one: a. Real - time b. Dynamic c. PL - d. Embedded Question 2 Embedded SQL is which of the following? Select one: a. Hard-coded SQL statements in a program language such as Java. b. The process of making an application capable of generating specific SQL code on the fly. c. Hard-coded SQL statements in a procedure. d. Hard-coded SQL statements in a trigger. Question 3 In JDBC, what represents a single instance of a particular database session? Select one: a. a thread b. an opened connection c. a closed connection d. a pipe Question 4 A relational database query normally......

Words: 4344 - Pages: 18