Pt1420 V1 Unit 2 Assignment 1: Homework

In: Computers and Technology

Submitted By ahocine48
Words 319
Pages 2
Unit 2 Assignment 1 Pt1420
Unit 2 Assignment 1: Homework Kenneth D. Davis Intro to Programming

Short Answer 1. What does a professional programmer usually do first to gain an understanding of a problem?
Interview the customer
2. What is pseudocode? Fake Code
3. Computer programs typically perform what three steps?
1. Input is received. 2. Some process is performed on the input. 3. Output is produced.
4. What does the term “user- friendly” mean?
The term user- friendly is commonly used in the software business to describe pro-grams that are easy to use. Programs that do not display adequate or correct instruc-tions are frustrating to use, and are not considered user- friendly. One of the simplest things that you can do to increase a program’s user- friendliness is to make sure that it displays clear, understandable prompts prior to each statement that reads keyboard input.
5. What two things must you normally specify in a variable declaration?
You must specify the variable type and an identifier
6. What value is stored in uninitialized variables?
Some languages assign a default value as 0 to uninitialized variables. In many languages, however, uninitialized variables hold unpredictable values.

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.

Set height = 72”
Display ‘Enter your Height at Age 21’
Input hEIGHT
Display ‘Enter your Height at Age 22’
Input 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.
Set Favorite Color = fAVCOLOR
Display ‘What is your Favorite Color?’
Input fAVCOLOR
Programming Exercises 1. Personal Information
Design a program that displays the following information:

Display ‘What is your Name?’
Input…...

Similar Documents

Pt1420 Unit 8 Assignment 1: Homework

...instructions in a computer program which loops endlessly. Example of an infinite loop: Set k = 1 While k < = 5 Display k End While 7. A FOR loop looks like what other loop in a flowchart? A For loop looks like a count-controlled loop. 8. Why is it critical that accumulator variables are properly initialized? An accumulator is used to keep a running total of numbers. In a loop, a value is usually added to the current value of the accumulator. If it is not properly initialized, it will not contain the correct total. 9. What is the advantage of using a sentinel? The advantage of using a sentinel is that when you are processing a long list of values with a loop a sentinel marks the end of a list of items. There is no limit to how many times a loop can execute. 10. Why must the value chosen for use as a sentinel be carefully selected? The value of a sentinel needs to be carefully selected because it can’t be mistaken as a regular value in the list. Algorithm Workbench: 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......

Words: 303 - Pages: 2

Pt1420 - Unit 1 Assignment 1

...UNIT 1 – BOOK REVIEW QUESTIONS (PAGE 26, SHORT ANSWER QUESTIONS #1–6) 1. Why is the CPU the most important component in a computer? a. Without the CPU, the computer could not run software. The CPU is the part of the computer that actually runs the programs. (pg. 3) 2. What number does a bit that is turned on represent? What number does a bit that is turned off represent? b. 1 represents a bit that is turned ON. 0 represents a bit that is turned OFF. (pg. 8) 3. What would you call a device that works with binary data? c. A device that works with binary data is called a DIGITAL device. (pg. 11) 4. What are the words that make up a high-level programming language called? d. The words that make up a high-level programming language are known as KEY WORDS or RESERVED WORDS. (pg. 17) 5. What are the short words that are used in assembly language called? e. The short words that used in assembly language are called MNEMONICS. (pg. 14) 6. What is the difference between a compiler and an interpreter? f. A COMPILER is a program that translates a high-level language program into a separate machine language program. An INTERPRETER is a program that both translates and executes the instructions in a high-level language program. (pg. 17-18) 7. What type of software controls the internal operations of the computer’s hardware? g. An operating system controls the internal operations of the computer’s hardware. (pg. 20) ...

Words: 257 - Pages: 2

Unit 2 Assignment 1 Pt1420

...Unit 2 Assignment 1: Homework Kenneth D. Davis Intro to Programming Short Answer 1. What does a professional programmer usually do first to gain an understanding of a problem? Interview the customer 2. What is pseudocode? Fake Code 3. Computer programs typically perform what three steps? 1. Input is received. 2. Some process is performed on the input. 3. Output is produced. 4. What does the term “user- friendly” mean? The term user- friendly is commonly used in the software business to describe pro-grams that are easy to use. Programs that do not display adequate or correct instruc-tions are frustrating to use, and are not considered user- friendly. One of the simplest things that you can do to increase a program’s user- friendliness is to make sure that it displays clear, understandable prompts prior to each statement that reads keyboard input. 5. What two things must you normally specify in a variable declaration? You must specify the variable type and an identifier 6. What value is stored in uninitialized variables? Some languages assign a default value as 0 to uninitialized variables. In many languages, however, uninitialized variables hold unpredictable values. 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. Set height = 72” Display ‘Enter your Height at Age 21’ Input hEIGHT Display ‘Enter your Height at Age 22’ Input......

Words: 458 - Pages: 2

Unit 2 Assignment 1 Homework

...Short Answer: 1, 2, 3 & 4 Pg. 71 1. What does a professional programmer usually do first to gain an understanding of a problem? A professional programmer gains this understanding by working directly with the customer. 2. What is pseudocode? 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? 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? The term user-friendly is commonly used in the software business to describe programs that are easy to use. 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 ZIP * Your telephone number * Your college major B. Answer * Display “name” * Input name * Display “Here is the name you have......

Words: 300 - Pages: 2

Pt1420 Unit 3 Assignment 1 Homework

...Unit 3 Assignment 1 Homework Short Answer: 5. What two thing must you normally specify in a variable declaration? * You must specify the variable type and an identifier. * int n; // type - int, identifier - n 6. What value is stored in uninitialized variables? * is a variable that is declared but is not set to a definite known value before it is used. Algorithm Workbench pg71-72 3) Write assignment statements that perform the following operations with the variable a, b and c. a) Adds 2 to a and stores the result in b. { b = 2 + a } b) Multiplies b by 4 and stores the result in a. { a = b * 4} c) Divides a by 3.14 and stores the result in b. { b = a MOD 3.14 } d) Subtracts 8 from b and stores the result in a { a = 8 – b } 4) Assume the variables result, w, x, y and z are all integers, and that w=5, x=4, y=8 and z=2. What value will be stored in result in each of the following statements? a) 12 = x + y b) 4 = z * 2 c) 2 = y / x d) 6 = y – z 5) Write a pseudocode statement that declares the variable cost so it can hold a real numbers. Dim cost1 As Double = 0 6) Write pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0. Dim cost1 As Integer = 0 7)Write a pseudocode statement that assigns the value 27 to the variable count. Dim count As Integer = 27 8) Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total. Total = 10 + 14 9) Write a......

Words: 577 - Pages: 3

Pt1420 Unit 1 Assignment 1 Homework

...Everything that a computer does is controlled by some kind of software. There are 2 general types of software that computers use, system software and application software. The typical hardware associated with a computer includes but are not limited to input devices such as mice, keyboards and webcams. Output devices like monitors, speakers and printers and your different types of memory (CPU, RAM, SSDs.) The computer’s data storage process consists of tiny electrical power charges in microscopic capacitors. When a computer is turned off the capacitors that your data is stored on lose their charge which is why computer memory goes blank when it is off. For data that is stored for longer periods of time, it is stored as a magnetic pattern on a spinning disk. A program is a set of instructions that a computer follows in order to perform a task. A program is run by the computer’s CPU or Central Processing Unit. Each instruction in a program tells the CPU to perform a specific operation. Machine Language: Language that CPU understands. It is always written in binary. Assembly Language: Language that consists of short words known as mnemonics. It was created because it was impractical for people to write programs in machine language. High-Level Language: Allows people to create powerful and complex programs without knowing how the CPU works, and without writing large numbers of low-level instructions. Compiler: Program that translates a high-level language into a......

Words: 287 - Pages: 2

Pt1420 Unit 5 Assignment 1. Homework

...Short Answer: 1. Explain what is meant by the term “ conditionally executed.” It is performed only when a certain condition is true. 2. You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use? If the condition is false, we follow another path, which skips the action. 3. If you need to test the value of a variable and use that value to determine which statement or set of statements to execute, which structure would be the most straightforward to use? If and then 4. Briefly describe how the AND operator works. The AND operator connects two Boolean expressions into one compound expression. Both subexpressions must be true for the compound expression to be true. 5. Briefly describe how the OR operator works. The OR operator connects two Boolean expressions into one compound expression. One or both subexpressions must be true for the compound expression to be true. It is only necessary for one of the subexpressions to be true, and it does not matter which. 6. When determining whether a number is inside a range, which logical operator is it best to use? AND 7. What is a flag and how does it work? A flag is a variable that signals when some condition exists in the program. Algorithm Workbench Review: 1.Design an If- Then statement ( or a flowchart with a single alternative decision structure) that assigns 20 to the variable y......

Words: 686 - Pages: 3

Pt1420 Unit 5 Assignment 1. Homework

...Short Answer: 1. Explain what is meant by the term “ conditionally executed.” It is performed only when a certain condition is true. 2. You need to test a condition and then execute one set of statements if the condition is true. If the condition is false, you need to execute a different set of statements. What structure will you use? If the condition is false, we follow another path, which skips the action. 3. If you need to test the value of a variable and use that value to determine which statement or set of statements to execute, which structure would be the most straightforward to use? If and then 4. Briefly describe how the AND operator works. The AND operator connects two Boolean expressions into one compound expression. Both subexpressions must be true for the compound expression to be true. 5. Briefly describe how the OR operator works. The OR operator connects two Boolean expressions into one compound expression. One or both subexpressions must be true for the compound expression to be true. It is only necessary for one of the subexpressions to be true, and it does not matter which. 6. When determining whether a number is inside a range, which logical operator is it best to use? AND 7. What is a flag and how does it work? A flag is a variable that signals when some condition exists in the program. Algorithm Workbench Review: 1.Design an If- Then statement ( or a flowchart with a single alternative decision structure) that assigns 20 to the variable y......

Words: 686 - Pages: 3

Unit 2 Assignment 1 : Homework

...Short Answer 1. A professional programmer usually begins by creating a design of the program to gain an understanding of the problem. 2. Pseudocode is a fake code. 3. The three steps that the computer programs typically perform are input is received, some process is performed on the input, and output is produced. 4. “user friendly” means programs that are easy to use. Algorithm Workbench 1. Display “What is your height?” Input height Display “Here is the height you entered:” Display height 2. Display “What is your favorite color?” Input color Display “Here is the color you entered:” Display color Programming Exercise 1.Personal Information Display “What is your name?” Input name Display “What is your address, city, state, and zip?” Input address, city, state, zip Display “What is your telephone number?” Input telephoneNumber Display “What is your college major?” Input collegeMajor Display name,address,city,state,zip,telephoneNumber,collegeMajor 2. Sales Prediction Display “Enter the projected amount of total sales” Input totalSales Set dollars =0.23 Display totalSales*setdollars 3. Land Calculation Display “Enter total square feet of land” Input squareFeet Set 43,560 == one acre Declare / squareFeet by 43,560 to get acres 4 Total Purchase Display “What is the price of this item” Input price Display “What is the price of item 2” Input price 2 Display “What is the price of item 3” Input......

Words: 264 - Pages: 2

Pt1420 Unit 3 Assignment 1

...Jairo Granado Prof. M. Ashraf PT1420 March 28, 2015 Unit 3 Assignment 1: Homework Short Answer 1. What two things must you normally specify in a variable declaration? You must specify type & name. 2. What value is stored in uninitialized variables? An uninitialized variable is by default a 0. Algorithm Workbench 3. Write assignment statements that perform the following operations with the variable a, b and c. a) Adds 2 to a and stores the result in b. { b = 2 + a } b) Multiplies b by 4 and stores the result in a. { a = b * 4} c) Divides a by 3.14 and stores the result in b. { b = a MOD 3.14 } d) Subtracts 8 from b and stores the result in a { a = 8 – b } 4. Assume the variables result, w, x, y and z are all integers, and that w=5, x=4, y=8 and z=2. What value will be stored in result in each of the following statements? a) 12 = x + y b) 4 = z * 2 c) 2 = y / x d) 6 = y – z 5. Write a pseudocode statement that declares the variable cost so it can hold a real numbers. Dim cost1 As Double = 0 6. Write pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0. Dim cost1 As Integer = 0 7. Write a pseudocode statement that assigns the value 27 to the variable count. Dim count As Integer = 27 8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total. Total = 10 + 14 9. Write a pseudocode statement that subtracts the variable downpayment from the variable total......

Words: 533 - Pages: 3

Unit 2 Assignment 1: Homework

...Short Answers Page 71 1. What does a professional programmer usually do first to gain an understanding of a problem? They begin by creating a design of the program. 2. What is pseudocode? Programs used during the design process 3. Computer programs typically perform what three steps? Input process output 4. What does the term “user-friendly” mean? 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. 1. Dim Height As Double 2. Console.writeline(“Enter your Height:”) Save height as 3. Height = Console.readline() 4. Console.writeline(“Your Height Is: “ & Height) 5. Console.writeline(“Press Enter To Close.”) 6. Console.writeline() 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. 1. Dim Color As Double 2. Console.write(“Enter Your Favorite Color:”) Save color as 3. color = Console.readline() 4. Console.writeline(“Your Favorite Color Is: “&color) 5. Console.writeline(“Press Enter To Close.”) 6. Console.readline() Programming Exercises 1. Personal Information Design a program that displays the following information: Your name Your address, with city, state, and ZIP Your telephone number Your college major Dim Color As Double Console.write(“Enter Your Name:”) Name = Console.readline() Console.write (“Enter your......

Words: 441 - Pages: 2

Pt1420 Unit 6 Assignment 1

...Week 06 Assignments Textbook Reading * Chapter 4 * Chapter 5 sections 5.1, 5.2, and 5.3 (pages 196-201) Week 06 Homework From the Gaddis textbook: * Programming Exercises 2, 6 and 9, on pages 160-161 For the Programming Exercises, design a program means write the pseudocode for the program. Except for Programming Exercise 2, your design should include multiple modules, not just main(). Upload a Microsoft Word document with the pseudocode to your shared PT1420 community website or submit a paper copy to your instructor by the beginning of the Week 7 class. Programing Exercises pg. 160-161 2. Areas of rectangles Module Main() Declare width1 integer = 0 Declare length1 integer = 0 Declare width2 integer = 0 Declare length2 integer = 0 Declare area1 integer = 0 Declare area2 integer = 0 Call rectangle1 (width1, length1, area1) Call rectangle2 (width2, length2, area2) Call comparison (rectangle1, rectangle2) Display “press enter to continue” End module Module rectangle1 (value width1 as integer, value length1 as integer, value area1 as integer) Display "Enter the width of rectangle 1” Input width1 Display "Enter the length of rectangle 1" Input length1 area1 = width1 * length1 End module Module rectangle2 (value width2 as integer, value length2 as integer, value area2 as integer) Display "Enter the width of rectangle 2” Input width2 Display "Enter the length of rectangle 2" Input length2 area2 = width2 * length2 End......

Words: 764 - Pages: 4

Pt1420 Unit 2 Assignment 1: Homework

...Short Answer: 1.) The first thing a programmer usually does first in programming is design flowcharts and pseudocode which will help with process. 2.) Pseudocode code is a fake code used as a model for programs; it has no syntax rules and is well written making it easy to translate to actual codes. 3.) Computer programs typically perform a three step process 1 input is received, 2 some process is performed on the input, 3 output is produced. 4.) “User-friendly” is commonly used in the software business to describe programs that are easy to use. Algorithm Workbench: 1.) 1 Display “Height” 2 Input height 3 Display “here is the height that you entered:”, height 2.) 1 Display “Favorite color” 2 Input favorite color 3 Display “Here is your favorite color you entered:”, color Programming Exercises: 1.) Personal Information 1 Display “Name” 2 Input Name 3 Display “Here is the name you have entered:”, name 4 Display “Address with city, state, and ZIP” 5 Input address with city, state, and ZIP 6 Display “This is the address you have entered:”, address with city, state, and ZIP 7 Display “Telephone number” 8 Input telephone number 9 Display “This is the telephone number you have entered:”, telephone 10 Display “College Major” 11 Input college major 12 Display “This is the college major you have entered:”, college major 4.) Total Price 1 Display “enter the items original price” 2 Input originalPrice 3 Set SalePrice = OriginalPrice *......

Words: 251 - Pages: 2

Pt1420 Unit 1 Homework

...Jonathan Ford Intro to Programming Unit 1 Homework 4/13/16   1. Why is the CPU the most important component in a computer?       a. Without the CPU, the computer could not run software. The CPU is the part of the computer that actually runs the programs. (pg. 3)   2. What number does a bit that is turned on represent? What number does a bit that is turned off represent?       b. 1 represents a bit that is turned ON. 0 represents a bit that is turned OFF. (pg. 8)   3. What would you call a device that works with binary data?       c. A device that works with binary data is called a DIGITAL device. (pg. 11)   4. What are the words that make up a high-level programming language called?       d. The words that make up a high-level programming language are known as KEY WORDS or RESERVED WORDS. (pg. 17)   5. What are the short words that are used in assembly language called?       e. The short words that used in assembly language are called MNEMONICS. (pg. 14)   6. What is the difference between a compiler and an interpreter?       f. A COMPILER is a program that translates a high-level language program into a separate machine language program. An INTERPRETER is a program that both translates and executes the instructions in a high-level language program. (pg. 17-18)   7. What type of software controls the internal operations of the computer’s hardware?       g. An operating system controls the internal operations of the computer’s hardware....

Words: 254 - Pages: 2

Pt1420 Unit 1 Assignment 1 Homework

...Unit 1 Assignment 1: Homework Short Answer 1. Why is the CPU the most important component in a computer? The CPU is the most important part of the computer is that it runs the programs, without it a computer cannot run software. 2. What number does a bit that is turned on represent? What number does a bit that is turned off represent? A bit that is on is represented by the digit 1 and a bit that is off is represented by the digit 0. 3. What would you call a device that works with binary data? A digital device is any device that works with binary data. 4. What are the words that make up a high-level programming language called? Key words or reserved words have specific meaning and purpose in the programming language. 5. What are the short words that are used in assembly language called? Assembly language uses short words that are known as mnemonics. 6. What is the difference between a compiler and an interpreter? Compiler is a program that translates high-level language program into a separate machine language program. An interpreter is a program that both translates and executes the instructions in a high-level language program. 7. What type of software controls the internal operations of the computer’s hardware? An operating system is the most fundamental set of programs on a computer. The operating system controls the internal operations of the computer’s hardware, manages all of the devices connected to the computer, allows data to be saved to and......

Words: 272 - Pages: 2