Free Essay

Pt 1420 Homework

In: Computers and Technology

Submitted By scho
Words 296
Pages 2
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 InputFile numberFile
Open numberFile “numbers.dat”
Display “Here are the numbers: “
While NOT eof(numberFile)
Read numberFile (number)
Display number
End While
Close numberFile
2.
Declare String name
Declare Integer counter = 0
Declare InputFile nameFile
Open nameFile (names.dat”)
While NOT eof(nameFile)
Read nameFile name
Set counter = counter + 1
End While
Close nameFile
Display “The number of names in the file is “, counter

Similar Documents

Premium Essay

Pt 2520

...UNIT 1. RESEARCH ASSIGNMENT 1 EXPLORING PROGRAMMING LANGUAGES PT 2520 SQL was introduced by IBM in the 1970. The first company to implement SQL commercially was Oracle. These two companies were followed by several other companies. Each of those company introduced different version of SQL with some variation. In short, many versions of SQL were available in global market. Due to this reason and making single one SQL instead of various SQL in market, it was standardized. Newest SQL and standard is SQL99. Later on SQL2003 and SQL2008 were also standardize. This is an extremely complex work, and it is not yet clear how much industry support it will attract. Rather than having a series of conformance levels, each incorporating its predecessors, SQL99 has basic functionality called "Core SQL" and various optional enhancement levels.SQL is basic language for all databases. Full form of SQL is Structure Query Language. But SQL is more popular as Sequel Query Language. Due to this reason SQL called as Sequel. SQL is pronounced by sequel; the letters originally stood for Structure Query Language. SQL used by all DBMS like DB2, Oracle, Microsoft's SQL Server and Access, Sybase, Informix, MySQL, mSQL etc.After standardization of SQL, it becomes more sophisticated and easy. Typically a relational database product includes more than the DBMS called as "back end". SQL is only language to manage all back end databases. Using SQL, we can store data, manipulate and retrieve from database...

Words: 540 - Pages: 3

Premium Essay

Becoming a Pt

...schooling shouldn’t play a factor in choosing your career; it’s what you love to do so “you never have to work a day in your life.” Oakland University is one of the top 5 schools in Michigan for this program and that’s the main reason why I decided to transfer from Wayne State over to Oakland. I like competition and with this field growing how it is, I look forward to working hard to say I graduated PT school from Oakland University. After school, there’s even more requirements for where I wish to be when I become a certified physical therapist. According to Dawn Rosenberg McKay from About.com (2012), “All states in the US require physical therapists to be licensed. To become licensed you will have to take the National Physical Therapy Exam which the Federation of State Boards of Physical Therapy (FSBPT) administers.” Even when you graduate PT school and think you’re done with the whole education aspect of it, it is require for you take a state exam to become an actual certified Physical Therapist. This field is very competitive and takes a lot of time to get where you want to be but PT is growing around the state and country. According to McKay (2012), “The job outlook for physical therapists is excellent. This occupation is projected to experience faster growth, through 2020, than other occupations requiring at least a master's degree.” This creates a lot more opportunities for me to find the job I love right when I graduate school. Most people say “do what you love”......

Words: 1598 - Pages: 7

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

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

Words: 291 - Pages: 2

Free Essay

Pt Krakatau Steel

...Seluruh sumber data diperoleh dari http://www.krakatausteel.com/ PT Krakatau Steel adalah perusahaan baja terbesar di Indonesia. BUMN yang berlokasi di Cilegon, Banten ini berdiri pada tanggal 31 Agustus 1970. Visi dari PT Krakatau Steel adalah menjadi perusahaan baja terpadu dengan keunggulan kompetitif untuk tumbuh dan berkembang secara berkesinambungan menjadi perusahaan terkemuka di dunia. Untuk mewujudkan visi tersebut, Krakatau Steel berusaha menyediakan produk baja bermutu dan jasa terkait bagi kemakmuran bangsa. Sejarah singkat mengenai berdirinya perusahaan BUMN ini pada suatu masa pada 1960, Presiden Soekarno mencanangkan Proyek Besi Baja Trikora untuk meletakkan dasar industri nasional yang tangguh. Sepuluh tahun kemudian tepatnya 31 Agustus 1970, berdirilah PT Krakatau Steel (Persero) yang memanfaatkan kembali peralatan-peralatan dari proyek itu yang berbentuk pabrik kawat baja, pabrik baja tulangan dan pabrik baja profil. ada 1977, Presiden Suharto meresmikan mulai beroperasinya produsen baja terbesar di Indonesia itu. Guna mendukung visi sebagai Perusahaan baja terpadu dengan keunggulan kompetitif untuk tumbuh dan berkembang secara berkesinambungan menjadi perusahaan terkemuka di dunia, PT Krakatau Steel melakukan reformulasi nilai budaya perusahaan yang baru. Nilai Budaya Perusahaan tersebut adalah: * Competence  Mencerminkan kepercayaan akan kemampuan diri serta semangat untuk meningkatkan pengetahuan, ketrampilan, keahlian, dan sikap mental......

Words: 1060 - Pages: 5

Premium Essay

Pt 1420

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

Words: 297 - Pages: 2

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

Words: 270 - 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

Free Essay

Sd 1420

...Tarrin Thomas SD 1420 Unit 9 Assignment · Which of the following statements converts a double value d into a string s? · s = new Double(d).stringOf(); · s = String.stringOf(d); · s = (new Double(d)).toString(); · s = (Double.valueOf(s)).toString(); The answer is D · Assume Calendar calendar = new GregorianCalendar(). Which of the following statements will return the number of days in a month? · calendar.getActualMaximum(Calendar.DAY_OF_MONTH) · calendar.get(Calendar.MONTH_OF_YEAR) · calendar.get(Calendar.WEEK_OF_MONTH) · calendar.get(Calendar.WEEK_OF_YEAR) · calendar.get(Calendar.MONTH) The answer is E · Assume Calendar calendar = new GregorianCalendar(). Which of the following statements will return the week of the year? · calendar.get(Calendar.MONTH_OF_YEAR) · calendar.get(Calendar.WEEK_OF_YEAR) · calendar.get(Calendar.WEEK_OF_MONTH) · calendar.get(Calendar.MONTH) The answer is B · What will be the output of running the class Test with the following code lines? interface A { } class C { } class B extends D implements A { } public class Test extends Thread { public static void main(String[] args) { B b = new B(); if (b instanceof A) System.out.println("b is an instance of A"); if (b instanceof C) System.out.println("b is an instance of C"); } } class D extends C { } · b is an instance of A followed by b......

Words: 1250 - Pages: 5

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

Words: 575 - Pages: 3

Free Essay

Pt Komnas

... MM – 6021 Enterprise Risk Management Mid-Term Exam Student Name: Mirna Nurmeilasari Student ID: 29114866 1st Semester – 2015/2016 MASTER OF BUSINESS ADMINISTRATION School of Business & Management INSTITUTE TEKNOLOGI BANDUNG PT KOMUNIKASI NASIONAL, Tbk. ENTERPRISE RISK MANAGEMENT EXECUTIVE SUMMARY I. Objective PT Komunikasi Nasional, Tbk. atau yang lebih dikenal dengan sebutan KOMNAS merupakan Badan Usaha Milik Negara (BUMN) yang berstatus perseroan terbuka dan bergerak di bidang informasi dan komunikasi (InfoKom/InfoCom). Perusahaan ini merupakan salah satu penyedia jasa dan jaringan telekomunikasi secara lengkap (full service and network provider) terbesar di Indonesia. Tujuan kedepannya KOMNAS berharap mampu mengalahkan pesaingnya dan menjadi penyedia jasa dan jaringan telekomunikasi secara lengkap terbesar di Indonesia. Dengan diloloskannya Sarbanes-Oxley Act menjadi perundang-undangan yang mewajibkan seluruh perusahaan yang tercatat di Bursa Saham New York untuk mematuhi US SEC (otoritas pasar modal Amerika Serikat), yang salah satunya adalah mengimplementasikan pengendalian internal perusahaan. Di tahun 2004, COSO mengeluarkan ‘Enterprise Risk Management – Integrated Framework’, sebagai pengembangan unsur-unsur pengendalian internal COSO framework. Dijelaskan ada 8 komponen dalam Enterprise Risk Management, yaitu: 1. Lingkungan Internal (Internal Environment), 2. Penentuan Tujuan (Objective Setting) 3. Identifikasi......

Words: 377 - Pages: 2

Free Essay

En 1420- Understanding Rhetorical Structures

...ITT EN 1420 Understanding Rhetorical Structures Can the Star Wars Expanded Universe (EU) live on as Legend? As Michelle Lawhorn tries to explain in her editorial “Star Wars: Is the EU Really Gone?” (Lawhorn, 2014) Michelle reminds readers that George Lucas didn’t put his official stamp on any novel, comic, or game saying that is truly what happens in the Star Wars universe. The EU is a collection of authors that had continued to further tell the stories of Star Wars after Episode VI: Return of the Jedi (ROTJ) in the absence of any more movies by George Lucas. Fans fell in love with these stories and believed them to be cannon and official Star Wars storyline. Then George Lucas sells Star Wars to Walt Disney and Disney announces that the EU is considered non-cannon in future films and novels and fan were extremely upset. Michelle does a great job explaining that the Star Wars history has not been erased in any way and that all novels, comics, and games will be rebranded Legends. Many fans of the EU thought that many of their beloved characters would disappear and be forgotten. Michelle reassures the readers that this is not the case “See, here’s the thing: the EU was never canon to begin with. George Lucas never signed off on any novel, game, or comic to be official canon…Basically, the EU was unofficial “official” fan fiction.” (Lawhorn, 2014) George Lucas basically let different departments within Lucas Film continue creating products for Star Wars in order......

Words: 815 - Pages: 4

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

Words: 603 - Pages: 3

Premium Essay

Unit 7 Homework

...Lab 7 Homework PT 1420 4/28/2016 Short Answers 1-5 1. Why should you indent the statements in the body of a loop? When indenting your statements, you can make them stand out from surrounding code. 2. Describe the difference between pretest loops and posttest loops? A pretest loop test the conditions before each iteration while a posttest loop test after each iteration. 3. What is a condition-controlled loop? A way for computer programs to repeat one or more various steps depending on conditions set either by the programmer initially or real time. 4. What is a count-controlled loop? A counter variable used to control or keep track of the number of times a loop iterates. Initialization, test and increment. 5. What three actions do count- controlled loops typically perform using the counter variable? While loop, do-while loop and for loop. Algorithm Questions 1,2,7 and 8 1. declare integer product declare integer number product =0 do while product < 100 display “enter number” input number product = number*10 2. do{ sum =0 print(“enter=a”) read a print(“enter=b”) read b sum = a*b print(“sum=”+sum) print(‘ do you wish to continue”) read Response } while (RESPONSE) 7. Declare integer x =1 Do { while x > 0 display “enter a number” input x } End while 8. Declare string sure Display “are you sure you want to quit?” While sure != "Y" AND sure != "y" End while Programming exercises 1,3, and 4 1. Module Module1 Sub Main() Dim......

Words: 483 - Pages: 2