Unit 3 Intro to Programming Homework

In: Computers and Technology

Submitted By mrboothe
Words 1208
Pages 5
1. What does the shell ordinarily do while a command is executing? What should you do if you do not want to wait for a command to finish before running another command?
Chances are that it will already be finished because the shell works very fast. You can give it multiple tasks all simultaneously and it will execute them in the order you typed them in. It will give results along the way and when done it will return to the $ prompt. Also if you want to run something add “&” to the command. 2. What is a PID number? Why are these numbers useful when you run processes in the background? Which utility displays the PID numbers of the commands you are running?
An identification number that is automatically assigned to each process when it is created on the Linux operating system. I personally don’t think that the PID is particularly useful, but they are required to use the kill command. The PS command displays the PID numbers. 3. Assume that the following files are in the working directory:
$ ls intro notesb ref2 section1 section3 section4b notesa ref1 ref3 section2 section4a sentrev
*Give commands for each of the following, using wildcards to express files names with as few characters as possible.
a. List all files that begin with section.
$ ls section*
b. List the section1, section2, and section3 files only.
$ ls section[1-3]
c. List the intro file only.
$ ls i*
d. List the section1, section3, ref1, and ref3 files.
$ ls *[13]

4. Give an example of a command that uses grep. In which of the preceding cases is grep used as a filter?
A. With both input and output redirected.
$ grep \$Id < *.c > id_list
B. With only input redirected.
$ grep -i suzi < addresses
C. With only output redirected.
$ grep -il memo *.txt > memoranda_files
D. Within a pipe.
$ file /usr/bin/*…...

Similar Documents

Intro to Psych Homework Week 3

...Homework Assignment Week 3 Critical and Creative Thinking Questions—Page 169 2. What are some examples of ways in which observational learning has benefited you in your life? Are there instances in which observational learning has worked to your disadvantage? Our book defines observational learning as learning new behavior or information by watching others. Some examples of ways in which observation learning has benefited me in my life are cooking, parenting, and work ethic. Watching my mother cook when I was little made me want to learn how and that’s how I now have the ability to cook meals for my own family without assistance. Parenting was another thing that I got from my mother; she was a single mother and was still able to provide for her two children without male figure in the picture. She was both a father and mother and I try to be that same parent with my children because of her. Work ethic is something else that I got from watching my sister and mother. They were always very dedicated, responsible, and punctual to their jobs and that’s how I am now. Observational learning can work to your disadvantage; it all just depends on the what, for example, driving. Growing up my mother and sister never used to wear their seatbelts therefore when it was time for me drive, I never wore my seatbelt. Very soon, I learned that I should my seatbelt if I didn’t want to get ticketed every time I was caught. Now, I don’t go anywhere without wearing my seatbelt and neither does...

Words: 755 - Pages: 4

Unit 3 Homework for Wan

...Configuration – routername(config-if)# Router Configuration – routername(config-line)# Basic Configuration Exercise 1. Router>enable Router#configure terminal Router(Config)#hostname AUS AUS(config)#end 2. AUS(config)# Enable Password class AUS(config)#Enable Secret class 3. Secret will supersede Password as the enable password. You do not need both, but you should have Secret over Password, as it is more secure. 4. AUS(config)#line con 0 AUS(config-line)#password cisco AUS(config-line)#login AUS(config-line)#line aux 0 AUS(config-line)#password cisco AUS(config-line)#login 5. AUS(config)#line vty 0 4 AUS(config)#password cisco AUS(config)#login 6. Aus(config)#service password-encryption 7. The secret password has stronger encryption than encrypting all passwords. 8. AUS(config)#line serial 0/0 AUS(config-if)#ip address 10.2.0.1 255.255.0.0 AUS(config-if)#clock rate 64000 AUS(config-if)#no shutdown 9. AUS(config)#interface fastethernet 0/0 AUS(config-if)#ip address 10.3.0.1 255.255.0.0 AUS(config-if)#no shutdown 11. AUS#copyrun start 12. show startup-config 14. Ping would be a good first choice. Show command Exercise 1. Show ip interface brief 2. Show interfaces 3. Show ip route 4. Show running-config 5. Show startup-config 6. The configuration in NVRAM is not lost when the router is rebooted and contains what configuration the router will have when it starts up. The running configuration is contained in RAM and......

Words: 339 - Pages: 2

Unit 3 Homework

...Short answer: 5. Variable type and identifier. 6. Some languages assign a default value as 0 to uninitialized variables. In many languages, uninitialized variables hold unkown values. Algorithm Workbench 3. a. Adds 2 to a and stores the result in b Set b= 2 +a b. Multiplies b times 4 and stores the result in a set a= b*4 c. Divides a by 3.14 and stores the result in b set b= 3.14/b d. Subtracts 8 from b and stored the result in a set a= b-8 4. a. set result= x+y= 4+8 b. set result=z*2= 2*2 c. set result= y/x= 8/4 set result= y-z= 8-2 5. Floating-point variable cost 6. Initialize the variable with the value 0. Declare Real price=53.85 Display "the original price." Input item original price Display "price" 7. Count:=27 8. Set total=10+14 9. Declare Integer downPayment Declare Integer Total Declare Integer Due 10. Dim subtotal As Double = 0 totalfee = subtotal * 0.15 Programming Exercise: 6. Sales Tax Design a program that will ask the user to enter the amount of a purchase. The program should then compute the state and county tax. Assume the state sales tax is 4 percent (.04) and the county tax is 2 percent (.02). The program should display the amount of the purchase, the state sales tax, the county sales tax, the total sales tax, and the total of the sale (which is the sum of the amount of the purchase plus the total sales tax). int main { double amtPurch double stateTax double countryTax cout << "How much did you purchase?"; ...

Words: 412 - Pages: 2

Intro to Programming Unit 1 Research Assignment

...Unit 1 research assignment 1 1970’s 1) Pascal, Creator, Niklaus Wirth. The specific motivation behind this language was to encourage good programming practice using structured programming and data structuring. 2) SQL (Structured Query Language) designed by, Donald D. Chamberlin, and Raymond F. Boyce. The motivation behind this language was designed for managing data held in a relational database management system. ( RDBMS) 3) C, Designed by Dennis Ritchie. the motivation behind this language is structured programming and allows lexical variable scope and recursion. 4) Applesoft BASIC, developed by Marc McDonald, and Ric Weiland. The motivation with this language was it was designed to be backwards-compatible with integer BASIC and used the core of Microsoft’s 6502 BASIC implementation. 5) GRASS, Developed by Thomas A. DeFanti. GRASS is similar to BASIC in sytax, but added numerous instructions for specifying 2D object animation, including scaling, translation, rotation and color changes over time. 1980’s 1) BASICA, Designed by Thomas E. Kurtz. Designed to offer support for the graphics and sound hardware of the IBM PC line. 2) Turbo Pascal, developed by Borland, under Philippe Kahn’s leadership. This is a software development system that includes a compiler and an integrated development environment for the Pascal programming language. 3) C++, designed by Bjarne Stroustrup. This is a general purpose programming language that is......

Words: 677 - Pages: 3

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

Unit 3 Assignment 1: Homework

...Kurt Trotter PT1420 Unit 3 Assignment 1 Week 3 07/06/2104 Homework Short Answers 5. You must specify type & name. 6. An uninitialized variable is by default a 0. Algorithm Workbench Review Questions 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 and assigns the result to the variable due. due = downpayment – total 10) Write a pseudocode statement that...

Words: 417 - Pages: 2

Pt1420 Unit 3 Homework

...Short Answer 1. What two things must you normally specify in a variable declaration? The variable’s name and data type 2. What value is stored in uninitialized variables? 0 Algorithm Workbench 3. Write assignment statements that perform the following operations with the variables a, b, and c. a. Adds 2 to a and stores the result in b Set b= 2+a b. Multiplies b times 4 and stores the result in a Set a= b*4 c. Divides a by 3.14 and stores the result in b Set b= 3.14/a d. Subtracts 8 from b and stores the result in a Set a= b-8 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. Set result = x + y = 4+8= 12 b. Set result = z * 2 = 2*2= 4 c. Set result = y / x = 8/4= 2 d. Set result = y – z = 8-2= 6 5. Write a pseudocode statement that declares the variable cost so it can hold real numbers. Floating-point variable cost 6. Write a pseudocode statement that declares the variable total so it can hold integers. Initialize the variable with the value 0. Declare Real price = 99.95 Display “The original price.” Input originalPrice Display price 7. Write a pseudocode statement that assigns the value 27 to the variable count. Count:=27 8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total. Declare Integer total= 0 Set total= 10+14 9. Write a pseudocode......

Words: 715 - Pages: 3

Intro to Networking Unit 4 Homework

...Multiple Choice 1. B & C 11. C 2. A&C 12. D 3. C&D 13. A&C 4. A&D 14. B 5. B 15.B 6. B 16. A 7. A&B 17. D 8. A 18. A&D 9. A 19.C 10. C 20. B,C&D Define key terms Electrical Circuit- A complete loop of material that conducts electricity. Frequency- When describing energy that acts like waves, the number of times that the entire waveform repeats per second. Amplitude Phase- When describing energy that acts like waves, when graphing the waveform centered on the X axis, and graphing some kind of power Bit Time- In an encoding scheme, the time period during which the encoding scheme sends an energy signal to represent 1 bit. Radio waves- Electromagnetic energy in a particular range of frequencies Wireless LAN- A group of wireless clients, plus one or more wireless access points, with the access points all using a common SSID Ecoding Scheme-A set of rules that define how to change the pattern of the waveforms of energy to represent binary 0s and 1s. Unsheilded twisted pair (UTP)- A type of cabling that uses pairs of copper wires, twisted together, with no additional shielding from the effects of EMI. Core- In a fiber-optic cable, the glass fiber in the center of the cable over which light can pass. Cladding- In a fiber-optic cable, the material around the core that helps direct light back into the core. Wireless WAN- A type of network that uses no wires (cables), instead using radio waves, with a wide-area network (WAN) business model of......

Words: 341 - Pages: 2

Unit 5 Research Paper for Intro to Programming

...NT 1310 | October 16 2014 | Phillip Wilson | Mr. Covington | A shell script is just a text file full of commands. It must be executable. A shell script is also a computer program designed to be run by the Unix shell, a command line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. Writing a shell script is much quicker than writing the equivalent code in other programming languages. The many advantages include easy program or file selection, quick start, and interactive debugging. A shell script can be used to provide sequencing and decision-making linkage around existing programs, and for moderately-sized scripts the absence of a compilation step is an advantage. Interpretive running makes it easy to write debugging code into a script and rerun it to detect and fix bugs. Non-expert users can use scripting to tailor the behavior of programs, and shell scripting provides some limited scope for multiprocessing. Most common usage methods of PowerShell are interactive console (powershell.exe) and script files (with extension of .ps1 that is also usually executed by powershell.exe). Main features of PowerShell are: .Net integration, object pipeline, easy access to many management domains (WMI, ADSI, COM, .NET etc.) and standardization that brings easy discovery and quick learning of new features after you know base......

Words: 311 - Pages: 2

Programming Unit 10 Homework

...Unit 10 Assignment 1: Homework Short Answer Ch10 #1 Describe the three steps that must be taken when a file is used by a program. Open the file, Process the file, Close the file #2 Why should a program close a file when it’s finished using it? By closing a file, any unsaved data that is held in the buffer is saved to its file. Also, when a program closes files that are no longer being used, the files will not take up more of the operating system's resources than necessary. #4 If an existing file is opened in append mode, what happens to the file’s existing contents? In most languages, when you open an output file and that file already exists on the disk, the contents of the existing file will be erased. #5 In most languages, if a file does not exist and a program attempts to open it in append mode, what happens? The Program will create a new file Algorithm Workbench Ch10 #1 Design a program that opens an output file with the external name my_ name. dat, writes your name to the file, and then closes the file. Declare an internal name for an output file. Declare outputFile myFile // Declare the variable to hold values // that will be read from the file Declare String name // Open a file named my_name.dat on // the disk Open myFile “my_name.dat” // Write your name to the file Write myFile “Your Name” // Close the file Close myFile #2 Design a program that opens the my_ name. dat file that was created by the algo-rithm in question......

Words: 651 - Pages: 3

Pt1420 Programming Unit 10 Research & Homework

...Unit 10: Homework and Research Assignment Definition Decision Structure - allows a program to perform actions only under certain conditions. Boolean expression - expressions that can be evaluated as either True or False Iteration - is the repetition of a block of statements within a computer program. Counter-controlled repetition structure - used when a program needs to repeatedly process one or more instructions until some condition is met, at which time the loop ends. Many programming tasks are repetitive, having little variation from one item to the next.  Condition controlled - Most programming languages have constructions for repeating a loop until some condition changes. Note that some variations place the test at the start of the loop, while others have the test at the end of the loop.  Pre – test loop - the condition gets evaluated at the beginning of the loop cycle. Therefore, the body of the loop will not get executed if the condition does not hold the very first time. Post – Test loop - the loop condition gets evaluated at the end of the loop cycle. Therefore, the body of the loop will get executed at least once, regardless of the condition. This is a major difference between a pretest loop and a posttest loop. You may choose a posttest loop if the problem description justifies the body of the loop be executed at least once. Repetition Sequence/ Set of statements - A repetition structure causes a statement or set of statements to......

Words: 1912 - Pages: 8

Intro to Programming

...Unit 3 Assignment 1: Homework Learning Objectives and Outcomes  Describe the use of variables (declaration: specifies properties of an identifier, it declares what a word means, and is most commonly used for functions, variables, constants and classes. It can also be used for other things like enumerations and type definitions. Naming: The variable name is the way to reference the stored value. It allows the name to be used independently of the exact information it represents. Assignment: It sets or re-sets the value stored in the storage locations marked by a variable name. It copies a value into the variable. Assignments allow a variable to hold different values at different times during its life span and scope. Although, some languages do not allow that kind of “destructive” reassignment because it could imply changes of non-local state. and Initialization: The process of locating and using the defined values for variable data that is used by a computer program. The operating system or application is installed with default or user-specified values that determine certain aspects of how the system or program is to function. These values are stored in initialization files. When the operating system or an application program is first loaded into memory, a part of the program performs initialization, finds definite values to substitute for variable values, and acts accordingly in program designs.  Use the correct data type for variables in program designs. Variables......

Words: 747 - Pages: 3

Research Assignment 3 Intro to Programming Logic and Design

...Research Assignment 3: Exploring Reverse Engineering • What is reverse engineering? Reverse engineering is the general process of analyzing a technology specifically to ascertain how it was designed or how it operates. This kind of inquiry engages individuals in a constructive learning process about the operation of systems and products. Reverse engineering as a method is not confined to any particular purpose, but is often an important part of the scientific method and technological development. The process of taking something apart and revealing the way in which it works is often an effective way to learn how to build a technology or make improvements to it. When reverse engineering software, researchers are able to examine the strength of systems and identify their weaknesses in terms of performance, security, and interoperability. The reverse engineering process allows researchers to understand both how a program works and also what aspects of the program contribute to its not working. • What are the advantages and disadvantages of using reverse engineering to discover the logics of a software program? Reverse engineering in software is reversing a program's machine code back into it's original source code. The advantages to using this technique is that one can repair certain bugs, see how a program operates, and improve the operation              of the program. The disadvantage is that certain other bugs may be introduced              during this process. ...

Words: 301 - Pages: 2

Intro to Programming

...Unit 3: Lab 3.1 Course Intro to programming Instructor : Sindar Lab 3.1 Lab 3.1 Step 1 Identify potential problems. Variable Name Problem Yes/No if yes, what’s wrong? Declare Real credits Taken No Declare Int cedits Left Yes We need to be able to use decimal as well. Declare Real studentName No Constant Real creditsNeeded=90 No Step 2 What’s wrong with this calculation Set credits-Left = credits-Taken – credits-Needed It should be: Set credits-Left = credits-Needed – credits-Taken Step 3 Write the exact output you would expect from the following code if the user of the program enters “John Brown”. Display “The student’s name is “, studentName Output will be “The student’s name is, John Brown Step 4 Write the exact output from the following line of code if user of the program enters John Brown and they have taken 20 credits so far. Display “The Network Systems Administration degree is awarded after 90 credits and “, studentName, “ has “, creditsLeft, “ left to take before graduation.” Output “ The Network Systems Administration degree is awarded after 90 credits and John Brown has 70 left to take before graduation. Step 5 1. //Provide documentation on line 2 of what this program does 2. //This program displays student information and degree program information 3. //Declare variables on lines 4, 5, 6, and 7 4. //Declare Real studentName 5. //Declare Real...

Words: 300 - Pages: 2

Intro to Programming Chapter Three Homework

...1. Structured programs use spaghetti code logic.   | a.  | True |   | b.  | False | | | | 2. In a selection structure, you perform an action or task, and then you perform the next action in order.   | a.  | True |   | b.  | False | | | | 3. Repetition and sequence are alternate names for a loop structure.   | a.  | True |   | b.  | False | | | | 4. In a structured program, any structure can be nested within another structure.   | a.  | True |   | b.  | False | | | | 5. A structured program must contain a sequence, selection, and loop structure.   | a.  | True |   | b.  | False | | | | 6. Because you may stack and nest structures while retaining the overall structure, it might be difficult to determine whether a flowchart as a whole is structured.   | a.  | True |   | b.  | False | | | | 7. As a general rule, an eof question should always come immediately after an input statement because the end-of-file condition will be detected at input.   | a.  | True |   | b.  | False | | | | 8. Structured programming is sometimes called goto-less programming.   | a.  | True |   | b.  | False | | | | 9. No matter how complicated it is, any set of steps can always be reduced to combinations of the two basic structures of sequence and loop.   | a.  | True |   | b.  | False | | | | 10. The case structure is a variation of the sequence structure and the do loop is a variation of the......

Words: 1129 - Pages: 5