Premium Essay

Pt1420 Unit 8 Assignment 1: Homework

In: Computers and Technology

Submitted By tikki1202
Words 303
Pages 2
Short Answer Review Questions:

6. What is an infinite loop? Write the code for an infinite loop.
An infinite loop is a sequence of 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 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…...

Similar Documents

Free Essay

Pt1420 Programming Unit 1 Research Assignment

...language and integrated development environment (IDE) from Microsoft for its COM programming model first released in 1991. Visual Basic is designed to be relatively easy to learn and use.[1][2] Visual Basic was derived from BASIC and enables the rapid application development (RAD) of graphical user interface (GUI) applications, access to databases using Data Access Objects, Remote Data Objects, or ActiveX Data Objects, and creation of ActiveX controls and objects. Java was originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++, but it has fewer low-level facilities than either of them. Java is a general-purpose, concurrent, class-based, object-oriented computer programming language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. PHP is a server-side scripting language designed for web development but also used as a general-purpose programming language. PHP is now installed on more than 20 million websites and 1 million web servers. Originally created by Rasmus Lerdorf in 1995, the reference implementation of PHP is now produced by The PHP Group. While PHP originally stood for Personal......

Words: 1885 - Pages: 8

Premium Essay

Physics Unit 8 Assignment 1

...Unit 8 Assignment 1 20. Because the magnetic force which deflects the electrons is defined by F = q * v x B (v x B is the cross product of the 2 vectors), so: The force vector would always be perpendicular to both the v and B vectors. Since the force is perpendicular to the electron's velocity vector, and thus the path of the electrons, the work done by the field on the electrons is 0, because W = F*d*cos(theta), and theta=90 degrees, therefore cos(theta)=0, and W=0 If W = 0 then there is no change in the kinetic energy of the electrons, thus their speed remains constant; the acceleration provided by the magnetic field was used only to change the direction. 31. Well, it depends upon the Sensitivity setting of the metal detector. As it is clear, the threshold value of the metal detector's sensitivity can be adjusted to suit various needs. so it is obviously set to discard small variations caused by a very small pieces of metal. 34. Yes, There is nothing seperately as a DC motor or DC generator. It is simply a DC machine. It acts either as a motor or a generator depending on the input. If the input is mechanical energy, the output is electrical : this is generator action If the input is electrical, the output is mechanical torque: this is motoring action 48. when you step up the voltage with transformers you lose current. It is a trade off and motors are not 100% effective so you would have a power loss. Unit 2 Assignment 1 8. when your......

Words: 647 - Pages: 3

Premium Essay

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

Premium Essay

Unit 3 Assignment 1: Homework

...Dr. Davis PT1420 26 June 2014 Unit 3 Assignment 1: Homework 5. Write a pseudo code statement that declares the variable cost so that so that it can hold real numbers. a. declare real cost 6. Write a pseudo code statement that declares the variable total so that it can hold integers. Initialize the variable with value zero. a. Declare real price = 0.00 display “the original price” input items original price display “price” 3. Write assignment statements that perform the following operations with variables a, b and c. a. set b = a+2 b. set a = b*4 c. set b = a/3.14 d. set a= b-8 7. Write a pseudo code statement that assigns the value 27 to the variable count. A count: = 27 8. Write pseudo code statement that assigns the sum of 10 and 14 to the variable total. a. declare integer total set total = 10+14 display total 9. Write a pseudo code statement that subtracts the variable down payment from the variable total and assigns the result for the variable due. a. declare integer down payment declare integer total declare integer due set due = total – down payment display “down payment “ input down payment 10. Write a pseudo code statement that multiplies the variable subtotal by 0.15 and assigns the result to the variable total fee a. declare real subtotal declare real totalfee set totalfee subtotal * 0.15 display “subtotal” input subtotal display totalfee 4. Assume the variable result,...

Words: 550 - Pages: 3

Premium Essay

Unit 1 Pt1420

...Unit 1 Research 1 PT1420 In the 1970s the programming language that was most popular was Pascal. Pascal was designed in 1968-69 but published in 1970. Niklaus Wirth created the Pascal language to “1) make available a language suitable for teaching programming as a systematic discipline based on fundamental concepts clearly by the language, and 2) to define a language whose implementations could be both reliable and efficient on then-available computers. In 1972 the C programming language was developed by Dennis Ritchie. C was created to work with the system Unix. “Unix gives C such advanced features as dynamic variables, multitasking, interrupt handling, forking, and strong, low-level, input-output. Because of this, C is very commonly used to program operating systems such as Unix, Windows, the MacOS, and Linux.” In the 1980s the popular programming language was C++. C++ was developed at Bell Laboratories. C++ is a general purpose multi-paradigm spanning compiled language that has both high-level and low-level languages’ features. It was started as an enhancement to the C programming language, Bjarne Stroustrup in 1979. In the 1990s Java was the popular programming language. It was created in 1991 developed by James Gosling at Sun Microsystems and release in 1995. In the 2000s Visual Basic (VB) was popular in the programming world. VB was developed from BASIC which was originally developed in 1964 by John Kemeny and Thomas Kurts. VB is a Microsoft programing language and......

Words: 261 - Pages: 2

Premium Essay

Pt1420 Unit 1

...“Unit 1 Assignment 1” ITT Technical Institute Intro to Programming – PT1420 Unit 1 Assignment 1 Short Answer Questions 1. Why is the CPU the most important component in a computer? The reason the CPU is the most important component in a computer is because without the CPU you can’t run any software. 2. What number does a bit that is turned on represent? What number does a bit that is turned off represent? The number in a bit that represents a turned on position is 1. The number in a bit that represents a turned off position is 0. 3. What would call a device that works with binary data? A digital device is a device that works with binary data. 4. What are the words that make up a high-level programming language called? Keywords or Reserved Words are words that make up a high-level programming language. 5. What are short words that are used in assembly language called? Mnemonics are short words that are used in assembly language. 6. What is the difference between a compiler and an interpreter? The difference between a compiler and an interpreter is that a compiler translates high-level language into separate machine language program while an interpreter 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 controls the internal operations of the computer’s hardware. Unit 1 Research Assignment 1 * What......

Words: 1534 - Pages: 7

Premium Essay

Pt1420 Unit 8

...HomeworkUnit 8 Assignment Short Answer 6-10 page 213 6. What is an infinite loop? Write the code for an infinite loop. An infinite loop is a sequence of instructions in a computer program which loops endlessly. While keepgoing ==”y” 7. A For loop looks like what other loop in a flowchart? It looks the while loop. 8. Why is it critical that accumulator variables are properly initialized? Accumulator variables should be properly initialized to be sure that it does not contain garbage. 9. What is the advantage of using a sentinel? The advantage of a sentinel automatically marks the end of the list for you. 10. Why must the value chosen for use as a sentinel be carefully selected? It must be carefully selected to be sure it doesn’t get mistaken as a regular value in the list. Algorithm 3, 4, 9, and 10 page 213 3. Design a For loop that displays the following set of numbers: 0, 10, 20, 30, 40, 50 . . . 1000 For(int i = 0; i <=1000; i += 10) System.out.print(i + “,”); 4. Design a loop that asks the user to enter a number. The loop should iterate 10 times and keep a running total of the numbers entered. Scanner k = new Scanner(System.in); int total = 0; For(int i = 0; i < 10; i ++){ System.out.println(“Enter a number:”); Total += k.nextlnt();} 9. Convert the following While loop to a For loop: Declare Integer count = 0 While count < 50 Display " The count is ", count Set count = count + 1 End While 10. Convert the following For loop......

Words: 299 - Pages: 2

Premium Essay

Unit 8 Assignment 1

...IS3350 Unit 8 Assignment 1 To: Verizon Date: 2 February, 2014 Subject: Data Breach Executive Summary Overview Verizon’s 2013 Data Breach Investigations Report (DBIR) provides truly global insights into the nature of data breaches that can help organizations of all sizes to better understand the threat and take the necessary steps to protect themselves. The breadth and depth of data represented in this year’s DBIR is unprecedented. It combines the efforts of 19 global organizations: law enforcement agencies, national incident-reporting entities, research institutions, and a number of private security firms — all working to study and combat data breaches. Analysis With 47,000+ Security incidents analyzed, 621 confirmed data breaches studied, and 19 international contributors, Verizon has ample amounts of data to compile and use to better their network. This data can also be analyzed to see what types of people are making these breaches and what motives they may have for doing so. In the 2013 DBIR, 69% of breaches were spotted by an external party and 76% of the network intrusions were due too weak or stolen passwords. Some of the other factors that have been realized was that 75% of the attacks are opportunistic and 19% of attacks are some form of espionage. There is also much evidence that many of these breaches could be tied to organized crime and gathering financial information. On a very basic level, just looking at the history of organized crime, money has......

Words: 344 - Pages: 2

Premium Essay

Pt1420 Unit 1 Assignment 1 Homework

... 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 separate machine language program. Interpreter: Program that both translates and executes the instructions in a high-level program. As described earlier in this paper, I......

Words: 287 - Pages: 2

Free Essay

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

Premium Essay

Nt1330 Unit 8 Assignment 1

...Group Policy in a Mixed Client OS Environment Unit 8 Assignment 1 ITT Technical Institute Floyd Washington Jr. May 16, 2015 Group policy is a tool used for customizing, controlling, and securing Windows operating systems. It was introduced in Windows 2000 as part of the IntelliMirror technologies. Group policy can be applied at the local computer level or to OU’s, domains, or sites in an Active Directory environment. Group policy was supported by Windows XP Professional, but not XP Home Editions. Group Policy in Vista adds many settings which gives administrators more control over users and computers. In this essay I will discuss five of the newer features that was not in the older versions of windows. * The first policy that I will discuss is the Control Removable Media policy. Devices like thumb drives, flash memory card readers, and external USB hard disks made it easy for users to transfer data between two computers. Although convenient, the ease that removable media created brought about the rise in industry espionage. User could easily copy and share company secrets with competitors by copying the information on to a removable device and uploading it to another computer. Software was made available to block access to USB ports on sensitive terminals. * The second policy that I will discuss is the Control power management settings. Power management on a single computer can save energy and money. Enforcing a power management strategy can save a......

Words: 532 - Pages: 3

Premium Essay

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

Free Essay

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

Premium Essay

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

Premium Essay

Home Page » Computers and Technology Pt1420 Unit 1 in: Computers and Technology Pt1420 Unit 1 “Unit 1 Assignment 1” Itt Technical Institute Intro to Programming – Pt1420 Unit 1 Assignment 1 Short Answer Questions 1.

...Home Page » Computers and Technology Pt1420 Unit 1 In: Computers and Technology Pt1420 Unit 1 “Unit 1 Assignment 1” ITT Technical Institute Intro to Programming – PT1420 Unit 1 Assignment 1 Short Answer Questions 1. Why is the CPU the most important component in a computer? The reason the CPU is the most important component in a computer is because without the CPU you can’t run any software. 2. What number does a bit that is turned on represent? What number does a bit that is turned off represent? The number in a bit that represents a turned on position is 1. The number in a bit that represents a turned off position is 0. 3. What would call a device that works with binary data? A digital device is a device that works with binary data. 4. What are the words that make up a high-level programming language called? Keywords or Reserved Words are words that make up a high-level programming language. 5. What are short words that are used in assembly language called? Mnemonics are short words that are used in assembly language. 6. What is the difference between a compiler and an interpreter? The difference between a compiler and an interpreter is that a compiler translates high-level language into separate machine language program while an interpreter 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......

Words: 393 - Pages: 2

USA, Hong Kong, Taiwan | Dragon Ball – Bảy Viên Ngọc Rồng chap 317 | ужас