Premium Essay

Pt 1420

In:

Submitted By dsith007
Words 297
Pages 2
Assignment
6. A loop that has no way of stopping, and repeats until the program is interrupted.
7. A Do-While loop
8. A variable that is used to accumulate the total of a series of numbers.
9. A sentinel is a special value that marks the end of a list of items.
10. A sentinel value must be unique enough that it will not be mistaken as a regular value in the list.

Algorithm
3. // Declare a counter variable. Declare Integer

// Constant for the maximum value Constant Integer MAX_VALUE = 100 //Display the multiples of 10 from 0 through 100 For counter = 0 to MAX_VALUE Display counter End For

4. //Declare Integer number Declare an accumulator variable Declare Integer total = 0

Declare Integer counter For counter = 1 to 10 Display “Enter a number.”
Input number Set total = total + number End For Display “The total is”, total 9. Declare Integer count For count < 50 Display “The count is “, count Set count = 1 To 50 End For 10. //Declare integer count
While count
Research
List three examples that show when a count-controlled loop is better than condition-controlled loop in programming? 1. It keeps a count of the number of times you want to use the program to input data
2. It only runs as many times as you have instructed the program to run
3. It will stop after the allotted time it has been instructed to
2.List three examples that show when a condition-controlled is better than count-controlled loop in programming?
1.The variable can be more than one number.. as long as the statement is true 2.Condition-controlled will stop so long has reached the directed variable
3.The variables numbers can be any real number which will make the

Similar Documents

Free Essay

Pt 1420

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

Words: 310 - Pages: 2

Premium Essay

Pt 1420

...Step 1: This program is most easily solved using just a few variables. Identify potential problems with the following variables declared in the pseudocode. Assume that the college has the ability to offer half credits. (Reference: Variable Names, page 39-40). Variable Name | Problem(Yes or No) | If Yes, what’s wrong? | Declare Real creditsTaken | No | | Declare Int creditsLeft | Yes | Data type should be Real | Declare Real studentName | Yes | Data type should be String | Constant Real credits Needed = 90 | Yes | Should be no space in variable name | Step 2: What is wrong with the following calculation? (Reference: Variable Assignment and Calculations, page 43). Set creditsLeft = creditsTaken – creditsNeeded Terms should be switched Step 3: Write the exact output you would expect from the following line of code if the user of the program enters “Nolan Owens”. (Reference: Displaying Items, page 40 – 41). Display “The student’s name is “, studentName The student’s name is Nolan Owens Step 4: Write the exact output you would expect from the following line of code if the user of the program enters a name of Nolan Owens and they have taken 20 credits so far. (Reference: Displaying Items, page 40 – 41). Display “The Network Systems Administration degree is awarded after 90 credits and “, studentName, “has “, creditsLeft, “left to take before graduation.” The Network Systems Administration degree is awarded after 90 credits and Nolan Owens has 70 left...

Words: 603 - Pages: 3

Free Essay

Pt 1420 Homework

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

Words: 296 - Pages: 2

Free Essay

Pt 1420 Lab 6

...Module Module1 Sub Main() Dim mobileProvider As Integer = 0 Dim dataOption As Integer = 0 Dim dataPackage As Boolean = True Call inputOption(mobileProvider, dataOption, dataPackage) Console.WriteLine() Call displayProvider(mobileProvider) Call displayOption(mobileProvider, dataPackage) Console.ReadLine() Console.WriteLine(" Press Enter To Continue ") Console.ReadLine() End Sub Sub inputOption(ByRef mobileProvider As Integer, ByRef dataOption As Integer, ByRef dataPackage As Boolean) Console.Write(" Enter 1 for ATT, 2 for Sprint, and 3 for Verizon ") mobileProvider = Console.ReadLine() Console.WriteLine() Console.WriteLine(" Enter 1 If you want Data Package, or 2 If you do not ") dataOption = Console.ReadLine() Console.WriteLine() If dataOption = 1 Then dataPackage = True Else : dataPackage = False End If End Sub Sub displayProvider(ByVal mobileProvider As Integer) Select Case mobileProvider Case 1 Console.WriteLine(" You selected ATT ") Case 2 Console.WriteLine(" You selected Sprint ") Case 3 Console.WriteLine(" You selected Verizon ") End Select End Sub Sub displayOption(ByVal mobileProvider As Integer, ByVal dataPackage As Boolean) ...

Words: 256 - Pages: 2

Premium Essay

Pt 1420 Unit 4

...Unit 4 Research 1: Using Global Variables Advantages of using Global Variables * Global variable belongs to every function in the program. * Avoid passing frequently-used variables between several functions. * A global variable is accessible in every scope. * A global variable can potentially be modified from anywhere. * It can be accessed from any other files using extern. Disadvantages of using Global Variables * Non-locality -- Source code is easiest to understand when the scope of its individual elements is limited. Global variables can be read or modified by any part of the program, making it difficult to remember or reason about every possible use. * Implicit coupling -- A program with many global variables often has tight couplings between some of those variables, and couplings between variables and functions. Grouping coupled items into cohesive units usually leads to better programs. * Concurrency issues -- if globals can be accessed by multiple threads of execution, synchronization is necessary (and too-often neglected). When dynamically linking modules with globals, the composed system might not be thread-safe even if the two independent modules tested in dozens of different contexts were safe. * Namespace pollution -- Global names are available everywhere. You may unknowingly end up using a global when you think you are using a local (by misspelling or forgetting to declare the local) or vice versa. Also, if you ever have to link...

Words: 384 - Pages: 2

Free Essay

Pt 1420 Unit 10 Homework

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

Words: 291 - Pages: 2

Premium Essay

Pt 1420 7.4 Flow Chart

...Module 3 Position Paper Jerry Wilkins ITT Technical Institute   There are many risks both health and environmental that take place when using hormones to genetically engineer food. According to the American Academy of Environmental Medicine (AAEM), several animal studies indicate serious health risks associated with genetically modified (GM) food. The AAEM has asked physicians to advise all patients to avoid GM foods. Numerous health problems increased after GMOs were introduced in 1996. The percentage of Americans with chronic illnesses and food allergies has gone up drastically. Reproductive disorders, autism, and digestive problems have steadily been on the rise as well. Although there is no sufficient research to confirm that genetically engineered foods are a contributing factor to these issues, there is still something about the process of genetically modifying the food that seems immoral and unhealthy. Between 1996 and 2008, US farmers sprayed an extra 383 million pounds of herbicide on GM food producing a "superweeds," which are resistant to the herbicide. This is causing farmers to use even more toxic herbicides every year. Not only does this create environmental harm, GM foods contain higher residues of toxic material. Roundup, for example, is linked with sterility, hormone disruption, birth defects, and cancer. GM crops and their associated herbicides can harm birds, insects, amphibians, marine ecosystems, and soil organisms. They reduce bio-diversity, pollute...

Words: 575 - Pages: 3

Premium Essay

Pt 1420 Unit 2 Homework

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

Words: 270 - Pages: 2

Free Essay

Segway Incident

...Kylie Lewis 4/9/14 Block 3 Segways: Terror Causing Torture Devices Treasured recollections with your best friend scrapbook themselves as terror-and-pain-free moments. Well, they should anyway, but with my best friend Alexis’s and my aptitude for disaster, my most memorable memories with her elicit injury-and-terror-filled life- flashing-before-my-eyes-moments. Thanks to our never-failing clumsiness, the four day trip I took with her and her eccentric family to St. Louis last fall break included slips down staircases, tumbles into rooftop ponds, and an accidental masterpiece resulting from a dropped pumpkin. Despite all of these unfortunate accidents, one escapade trumped all of them: The Great Segway Fiasco. Eerie, early morning fog shrouded our car on the morning it all began as we drove down the St. Louis streets toward the Segway rental place; Alexis’s mom had signed us up for a Segway tour. As we arrived at the Segway place, the tour leader presented us with a very clear set of rules. “Now, since your age of 12 doesn’t reach our city-street age requirement of 16, we’ll be taking you guys in the woods today. This means that the path will be considerably thinner, so you need to ride single file. If your tires bump against anyone else’s, you guys will crash. Remember, Segways are designed to continue moving along even after you get off of them, so make sure to lean your Segway against a tree or rock when you step off.” He barked loudly. After a century of learning how...

Words: 605 - Pages: 3

Premium Essay

Sagway

...Faculty of Business Studies Tutor Marked Assignment BE322: Entrepreneurship and small business management First Semester 2015 – 2016 What Segway Learned About the Value of Feasibility Analysis the Hard Way Web:www.segway.com Introduction The Segway PT is a two-wheeled, self-balancing transportation device that consists primarily of a set of tall handlebars on top of two disc-like wheels. There are no chains or visible mechanical workings. Riders lean forward to move forward and back to move backward. Turning is done mechanically via hand controls. The device is driven by a quiet, nonpolluting electric motor and can travel up to 10 miles per hour. The name "Segway PT" stands for "Segway Personal Transporter. " The Segway was built in secrecy and was unveiled on December 3, 2001 , on the ABC program Good Morning America. [pic] [pic] The initial reaction to the Segway PT was enthusiastic. Venture capitalist John Doerr predicted that it would be as important as the Internet. Apple's Steve Jobs predicted that cities would be built around it. To cope with the expected demand for the product, Segway's factory in Bedford, New Hampshire, was designed to build up to 40,000 units per month. Initial sales were targeted at between 10,000 and 50,000 units during the first 12 months. But, after 21 months, only 6,000 units had sold. What went wrong? Feasibility Analysis ...

Words: 1667 - Pages: 7

Premium Essay

Physics Mobile

...The segway What has changed witht the invention of the segway? Steve Jobs said it would be bigger than the PC. Today, it used everyday with police departments, security companies, and golf courses. But the segway didnt revolutionize these departments. The Segway PT is a two-wheeled, self-balancing, battery-powered electric vehicle. It was marketed as a balance-sensitive machine that could transport a human at about 13 m.p.h. and last for a day on only 5 cents-worth of electricity. This brought the glamour of the segway, but it do anything new for these departments. People believed we needed it as a faster way to travel around in pedestrian areas, where vehicles were not allowed. This was the first of its kind, and did not replace a product, simply creating its own market. Invented by Dean Kamen, it is produced by Segway Inc. of New Hampshire, USA. This is a new technology, but merely an improvement in transportation. There were a couple problems with why the segway did not revolutionize transportation. Since Segways could go up to 13 m.p.h., they were not allowed on most sidewalks. However, they also went too slow for many roads, leaving customers unsure of where to ride them. Plus, the $4,950 debut price put the machines far out of budget for the average consumer. With such a high price, it could not become an item that everyone had, and why would you spend so much on an item you were unsure of where to ride it. There was also the problem of injury. In 2003, Segway...

Words: 366 - Pages: 2

Premium Essay

Segway Case Analysis

...In December 2001, Dean Kamen of Segway LLC unveiled the Human Transporter HT. With lofty ideas of replacing the automobile and unrealized sales forecasts, Kamen's Segway HT has not moved mankind nearly as much as Kamen had expected. With an annual CEO change since start-up, it is apparent that Segway's lack of a stated vision and mission is haunting the organization. The lack of "a way ahead", coupled with a less than well-defined marketing strategy, has caused Segway to fall short of Kamen's expectations. Kamen, while a definite asset to Segway, could be a detour or even a dead end on the company's road to success. Historically, Kamen's successes have been based on his abilities to be innovative in research and design, while at the same time being able to pass the developed product off to a partnering company that is able to take the product to market. Kamen's emotional attachment to Segway is preventing its success. As if these problems were not enough, combined with the fact that there was no pent up demand for such a product, Segway's future success will be dependent on an organizational make-over. Segway Value Chain In order to highlight Segway's situation, I have broken down their value chain into two simple classes. Firstly I will focus on "what is working" and secondly on "what is not working" for Segway. What is working Technology: Segway uses their patented design to produce a socially responsible (green product), environmentally friendly mode of transportation...

Words: 1249 - Pages: 5

Premium Essay

Product Critique Segway

...Paul Baptista Critique 2 New Product Planning SEGWAY In this critique I will be analyzing the product failure of the Segway PT a two wheeled (Personal Transportation) device that is battery powered that utilizes self-balancing technology. It is propelled by simply standing on the device and pitching your weight forward or backwards. The technology in the base of the Segway utilized motors and sensors to adapt to the angle or pitch the rider commanded and set forth the speed and direction, turning the Segway worked in the same manner by leaning with the handle bars to turn left or right which changed the speed of the wheels to turn in either direction. Segway was considered to be a game changing innovation in the way the regular person would get around, endorsed by big names like “Steve Jobs” from Apple and “Jeff Bezos” from Amazon, Segway seemed to be the new thing with a Blue Ocean approach in personal transportation market . In this critique I will be elaborating on the missteps taken by Segway’s entry to new transportation market facing regulatory transportation barriers, followed by the shortcomings with the quality of the product, and why the Segway failed to appeal to the market, lastly some suggested improvements. Barriers to Entry Segway had a plan to develop and change the way people moved around from point A to point B by creating a device that would be environmentally friendly and economically useful for everyday use. The problem the firm faced was once introduced...

Words: 1209 - Pages: 5

Premium Essay

Segway

...Faculty of Business Studies Tutor Marked Assignment BE322: Entrepreneurship and small business management First Semester 2015 – 2016 What Segway Learned About the Value of Feasibility Analysis the Hard Way Web:www.segway.com Introduction The Segway PT is a two-wheeled, self-balancing transportation device that consists primarily of a set of tall handlebars on top of two disc-like wheels. There are no chains or visible mechanical workings. Riders lean forward to move forward and back to move backward. Turning is done mechanically via hand controls. The device is driven by a quiet, nonpolluting electric motor and can travel up to 10 miles per hour. The name "Segway PT" stands for "Segway Personal Transporter. " The Segway was built in secrecy and was unveiled on December 3, 2001 , on the ABC program Good Morning America. [pic] [pic] The initial reaction to the Segway PT was enthusiastic. Venture capitalist John Doerr predicted that it would be as important as the Internet. Apple's Steve Jobs predicted that cities would be built around it. To cope with the expected demand for the product, Segway's factory in Bedford, New Hampshire, was designed to build up to 40,000 units per month. Initial sales were targeted at between 10,000 and 50,000 units during the first 12 months. But, after 21 months, only 6,000 units had sold. What went wrong? Feasibility Analysis ...

Words: 1684 - Pages: 7

Premium Essay

Segway

...The Segway PT is a two-wheeled, self-balancing transportation device that consists primarily of a set of tall handlebars on top of two disc-like wheels. There are no chains or visible mechanical workings. Riders lean forward to move forward and back to move backward. Turning is done mechanically via hand controls. The device is driven by a quiet, nonpolluting electric motor and can travel up to 10 miles per hour. The name "Segway PT" stands for "Segway Personal Transporter. " The Segway was built in secrecy and was unveiled on December 3, 2001 , on the ABC program Good Morning America. The initial reaction to the Segway PT was enthusiastic. Venture capitalist John Doerr predicted that it would be as important as the Internet. Apple's Steve Jobs predicted that cities would be built around it. To cope with the expected demand for the product, Segway's factory in Bedford, New Hampshire, was designed to build up to 40,000 units per month. Initial sales were targeted at between 10,000 and 50,000 units during the first 12 months. But, after 21 months, only 6,000 units had sold. What went wrong? Feasibility Analysis While the Segway was a technological marvel, in retrospect there were fundamental flaws in both its product feasibility analysis and its market feasibility analysis. When reviewing Segway's prelaunch and postlaunch behavior, one has to wonder how so many critical issues seemingly weren't analyzed or were missed. It provides lessons for future entrepreneurs to be more...

Words: 1344 - Pages: 6