Free Essay

Pt1420 Introduction to Programming Lab03

In: Computers and Technology

Submitted By barakuda318
Words 275
Pages 2
Variable Name | Problem(Yes or No) | If Yes, What is wrong? | Declare Real creditsTaken | NO | | Declare Int creditsLeft | YES | INT can only hold whole numbers, cant account for half credits. | Declare Real studentName | Yes | Needs to be string not Real. Real is for numbers | Constant Real creditsNeeded = 90 | No | |
Step 1

Step 2
What is wrong with the following calculation?
Set creditsLeft = creditsTaken – creditsNeeded
The calculation is backwards, if left as is it would read a negative number. It should be
Set creditLeft = creditsNeeded – creditsTaken.

Step 3
Display “The student’s name is”, studentName
The student’s name is Nolan Owens

Step 4
Display “The Network Systems Administration degree is awarded after 90 credits and”, studentName, “has”, creditsLeft, “left to take before graduation.”
The Network System Administration degree is awarded after 90 credits and Nolan Owens has 70 left to take before graduation.

Step 5 1. //Provide documentation on line 2 of what this program does 2. //This program shows how many credits a student needs to graduate from Network System Administration. 3. //Declare variables on line 4, 5, 6, and 7 4. Declare Real creditsTaken 5. Declare Real creditsLeft 6. Declare String studentName 7. Declare Constant Integer creditsNeeded = 90 8. //Ask for user input of studentName and creditsTaken on line 9-12 9. Display “What is the student’s name?” 10. Input studentName 11. Display “How many credits have they taken?” 12. Input creditsTaken 13. //Calculate remaning credits on line 14 14. Set creditsLeft = creditsNeeded – creditsTaken 15. //Display student name and credits left on line 16 and 17 16. Display “The student’s name is”, studentName, 17. Display “They have”, creditsLeft, “credits left until graduation.”

Lab 3.2…...

Similar Documents

Premium Essay

Introduction to Programming

...PERSPECTIVE The logic of indirect speech Steven Pinker*†, Martin A. Nowak‡, and James J. Lee* *Department of Psychology, and ‡Program for Evolutionary Dynamics, Departments of Mathematics and Organismic and Evolutionary Biology, Harvard University, Cambridge, MA 02138 Edited by Jeremy Nathans, Johns Hopkins University School of Medicine, Baltimore, MD, and approved December 11, 2007 (received for review July 31, 2007) When people speak, they often insinuate their intent indirectly rather than stating it as a bald proposition. Examples include sexual come-ons, veiled threats, polite requests, and concealed bribes. We propose a three-part theory of indirect speech, based on the idea that human communication involves a mixture of cooperation and conflict. First, indirect requests allow for plausible deniability, in which a cooperative listener can accept the request, but an uncooperative one cannot react adversarially to it. This intuition is supported by a game-theoretic model that predicts the costs and benefits to a speaker of direct and indirect requests. Second, language has two functions: to convey information and to negotiate the type of relationship holding between speaker and hearer (in particular, dominance, communality, or reciprocity). The emotional costs of a mismatch in the assumed relationship type can create a need for plausible deniability and, thereby, select for indirectness even when there are no tangible costs. Third, people perceive language as a......

Words: 6875 - Pages: 28

Premium Essay

Pt1420 Research Paper 1 Programming Languages

...Between the 1970's and the 2000's there are so many programming languages, it seems nigh impossible to list all of them. But, of course, there's always the most important or the most popular, and a lot of times the most important/most popular are the same languages, just maybe in a different order. The 1970's seen a quick advancement in computers and their languages due the the creation of the microprocessors. This era's programming history is marked by C, Pascal, Smalltalk, Scheme and Prolog The C programming language is the basis for many others. It's one of the singly most important building blocks of many of the languages used today. C was created in 1971, though it's roots go back to 1954's Fortran. However, it's direct predeccessor was B in 1969. C was created as a compiler to more easily install OS's on computers. It made it possible to the few system-dependent requirements and then use a C compiler to install the new OS. Bell Lab's Ken Thompson was behind the original B, then him and Dennis Ritchie, also of Bell Labs, improved upon it for the NB language. The evolution of NB led naturally to C. Pascal is another language that is the basis of many others, and many of the languages used commonly now have it somewhere in their developmental line. Pascal was named for Frenchman Blaise Pascal, a pioneer mathematician, that had created the first arithmetic machine. That machine could, arguably, be considered the first computer. Niklaus Wirth had written the first......

Words: 1483 - Pages: 6

Free Essay

Pt1420 Programming Unit 1 Research Assignment

...1970’s CLU is a programming language created at MIT by Barbara Liskov and her students between 1974 and 1975. It was notable for its use of constructors for abstract data types that included the code that operated on them, a key step in the direction of object-oriented programming (OOP). Euclid is an imperative programming language for writing verifiable programs. It was designed by Butler Lampson and associates at the Xerox PARC lab in the mid-1970s. The implementation was led by Ric Holt at the University of Toronto and James Cordy was the principal programmer for the first implementation of the compiler. It was originally designed for the Motorola 6809 microprocessor. Forth is an imperative stack-based computer programming language and programming environment. Language features include structured programming, reflection (the ability to modify the program structure during program execution), concatenative programming (functions are composed with juxtaposition) and extensibility (the programmer can create new commands). Although not an acronym, the language's name is sometimes spelled with all capital letters as FORTH, following the customary usage during its earlier years. Forth was designed by Charles H. Moore and appeared in the 1970’s. GRASS is the original version of GRASS was developed by Tom DeFanti for his 1974 Ohio State University Ph.D. thesis. It was developed on a PDP-11/45 driving a Vector General 3DR display, and as the name implies, this was a purely......

Words: 1885 - Pages: 8

Free Essay

Introduction to Programming

...Individual Project: INTRODUCTION TO PROGRAMMING T110-1304A-05 INTRODUCTION TO PROGRAMMING JAVA GRAPHICAL USER INTERFACE (GUI) AND DESIGN DOCUMENT 11/11/2013 Table of Contents Week 1: Project Outline 3 WEEK 1: Case Diagrams 4 Use Case Diagram 4 Week 1: Class Diagrams 4 Class Diagrams 4 Week 2 Java Fundamentals 5 Week 3: Java Control Structure 10 Week 4: Error Handling and File Input/output 16 TBD 19 Week 1: Project Outline Pizza R Us was founded in 2013 by a group of students who wanted to change the world of pizza one pie at a time. Using technology to bring the restaurant to the homes of the masses Pizza R US is currently developing an online ordering system that would rival the leaders of its class. Offering the following delicious products: Pizza’s Sizes: Small, Medium, Large Toppings: Pepperoni, Ham, Onions, Bacon, Bell Peppers, Pineapples, Sausage, Olives, Etc…. Breadsticks Wings Sauces: Hot, Mild, Medium, Extra Hot WEEK 1: Case Diagrams Use Case Diagram http://yuml.me/diagram/plain;scale:60;/usecase/// PIZZA R US, %5BCustomer%5D-(Log In),......

Words: 3241 - Pages: 13

Free Essay

Introduction to Programming

...David McCon March 31, 2014 Unit 2 Assignment 1 Introduction to Programming The first thing a professional programmer will usually do to gain the understanding of a problem is to work directly with, and interview the customer. What is pseudocode? Pseudocode is an informal language that has no syntax rules, and is not meant to be compiled or executed. Computer programs typically perform what three steps? Computer programs usually follow the following three steps: 1) Input is received. 2) Some process is performed on the input. 3) Output is produced. What does the term “user- friendly” mean? User friendly- easy to use, simple, not complicated 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. Display “enter height here”       2. Input height 3. save in word document named height       2. Design an algorithm that prompts the user to enter his or her favorite color and stores the user’s input in a variable named color.                       1. Display “enter favorite color”                       2. Input favorite color                       3. Save in word document named favorite color. Total Purchases 4: #include <iostream> using namespace std; int main(void) { //declarations double item1 = 0; double item2 = 0; double item3 = 0; double item4 = 0; double item5 = 0; double subtotal = 0; double......

Words: 400 - Pages: 2

Premium Essay

Pt1420

...ALONZO DARGAN (17186943) PT1420 Computer Programming Unit 7 Assignment 1: Homework 7 May 2014 Short Answers Page 213 1-5 1. Why should you indent the statements in the body of a loop? Because by indenting the statements in the body of the loop you visually set them apart from the surrounding code. This makes your program easier to read and debug. 2. Describe the difference between pretest loops and posttest loops. A pretest loop means to test its condition before performing an iteration A posttest loop means it performs an iteration before testing its condition. 3. What is a condition-controlled loop? A condition-controlled loop uses a true/false condition to control the number of times that it repeats. 4. What is a count-controlled loop? A count-controlled loop repeats a specific number of times. 5. What three actions do count-controlled loops typically perform using the counter variable? 1) Initialization: the variable is initialized 2) Test: the loop tests the variable by comparing it to the maximum value 3) Increment: to increase the value during each iteration the loop increments the counter variable by adding 1 to it. Algorithm Workbench Review Questions 1,2,7, and 8 p. 213-214 1. Design a While loop that lets the user enter a number. The number should be multiplied by 10, and the result stored in a variable named product. The loop should iterate as long as the product contains a value less than 100. A- Declare number as integer ...

Words: 721 - Pages: 3

Premium Essay

Introduction to Object-Oriented Programming

...Introduction to OOPs ------------------------------------------------- 1.1 STRUCTURED INTRODUCTION Structured programming (known as modular programming) is a subset of procedural programming that enforces a logical structure in the programming being written, to make it more efficient and easier to understand and modify. Structured programming frequently employs a top-down design model, in which developers map out the overall program structure into separate subsections. A defined function or a set of similar functions coded in separate modules can be reused in other programs. After a module has been tested individually, it is then integrated with other modules into the overall program structure. Program flow follows a simple hierarchical model that employs looping constructs such as 'for,' 'repeat' and 'while.' Use of the 'Go To' statement is discouraged in structured programming. Structured programming was first suggested by the mathematicians Corrado Bohm and Guiseppe Jacopini. They demonstrated that any computer program can be written with just three structures: decision, sequences and loops. In structured programming coders break larger pieces of code into shorter subroutines (functions, procedures, methods, blocks or otherwise) that are small enough to be understood easily. In general, programs should use local variables and take arguments by either value or reference. These techniques help to make isolated small pieces of code easier to understand the whole program at......

Words: 2729 - Pages: 11

Premium Essay

Pt1420

...PT1420 unit 1 homework 1. Software mainly directs and coordinates computer hardware. In its function, software directly provides instructions to the computer hardware and serves as input to another piece of software to facilitate computing. 2. Some basic computer hardware includes the motherboard, CPU, RAM, hard drive. 3. A computer stores data in clusters on the hard drive. Each cluster is a pie slice-looking area that holds a certain amount of data. The amount of data that can be stored in each cluster is dependent on the operating system. 4. A program tells the computer how to accept some type of input, manipulate that input, and spit it back out again in some form that humans find useful. 5. Machine Language is what essentially people normally call binary. Assembly Language is the next step up, using specific keywords and terms, and will require an assembler to convert into executable machine language. A high-level language is what most programmers’ use, because of its reconizability since it may contain some English terms that we humans can understand. To convert a high-level language to machine language, you'll need a compiler and linker. 6. A compiler takes all of the code and translates it into something a computer can understand. This compiled code is then executed or saved to a file to be executed at a later time. Interpreter takes code and translates it line by line and doesn't save the translated code in a file. 7. System......

Words: 418 - Pages: 2

Premium Essay

Pt1420

...PT1420 - Midterm Study Guide Study online at quizlet.com/_cl08u 1. ...: How many times will this loop iterate Set = 1 While i 5 Display i end while 22. List three examples of application software: Microsoft Word Adobe Photoshop Microsoft Visual Studio 6. ...: How many times will this loop iterate Set = 1 While i Great Then < Less Then >= Greater Then or Equal 7 is false 5 < 7 Is True (5 > 7) or (10 > 3) is True (5 > 7) and (10 < 3) is False NOT (5 > 7 ) and (10 > 3 )is true because the NOT reverses the False Age < 10 and age > 60 Will never be true 55. What is the term that describes the part of the program that a variable can be accessed?: Scope What is the truth table for AND?: True AND True = True True AND False = False False AND False = False False AND True = False 34. 35. 56. 36. 57. What is the truth table for OR?: True OR True = True True OR False = True False OR False = False False OR True = True 58. 59. 60. What is the value of 2^3?: 2 2 2 = 8 What is the value of 4^2?: 4 * 4 = 16 What is the value of the expression 10-4*3/2+5?: 9. Multiply first, then divide, then subtract and finally add. What is used to check the relationship between two values?: Relational Operator What is used to translate high level language programs to machine language (or machine code)?: Compiler What makes a computer useful for everyday tasks?: Application Software What was the first programming language designed to perform complex math functions?:...

Words: 779 - Pages: 4

Premium Essay

Pt1420 Unit 1

...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 were the five popular programming......

Words: 1534 - Pages: 7

Free Essay

Programming Final Pt1420

...1. What is the term used for the memory address of the location of the statement immediately after the module called? Return Point 2. What tool would a programmer use to visualize the relationship between modules? Hierarchy charts 3. What is the term used for the variable that received an argument that passed into a module? Parameter 4. What is the term used that means only a copy of the argument’s value is passed into the parameter? “passing an argument by Value” 5. What’s the name of the variable that’s visible to every module and the entire program? Global 6. What is the term used that means the argument is passed into a parameter that will reference the content of the argument in the module. “passing an argument by Reference” 7. What’s the name of the structure that is a logical design that controls the order in which a set of statements executes? Control structure 8. Which symbol indicates that some condition must be tested in a flowchart? Diamond 9. What type of operator can be used to determine whether a specific relationship exists between two values? Relational 10. What operator (or symbols) are used to determine that the operands are NOT exactly the same value? != 11. What is the symbol in a flowchart that denotes a terminal point? Oval 12. Which flowchart symbol denotes a process? Rectangle 13. What is the term that represents “a storage location in memory”? Variable 14. List the variable naming rules: cannot...

Words: 500 - Pages: 2

Premium Essay

Introduction to C Programming

...computer, requiring no translation before being run. 8. Binary: A system of numerical notation to the base 2, in which each place of a number, expressed as 0 or 1, corresponds to a power of 2 9. Main memory: program-addressable storage that is directly controlled by and generally contained in the CPU: except for cache storage, the fastest type of storage available to any computer system. 10. Control systems: is a device, or set of devices, that manages commands, directs or regulates the behavior of other devices or systems. 11. Embedded systems: is a computer system with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints. 12. Data type: A data type in a programming language is a set of data with values having predefined characteristics. 13. Algorithm: a set of rules for solving a problem in a finite number of steps, as for finding the greatest common divisor. 14. Compiler: a computer program that translates a program written in a high-level language into another language, usually machine language. 15. Interpreter: a program that translates a second program to machine code one statement at a time and causes the execution of the resulting code as soon as the translation is completed 16. Assembly language: a computer language most of whose expressions are symbolic equivalents of the machine-language instructions of a particular computer. 17. File: a folder, cabinet, or other......

Words: 913 - Pages: 4

Free Essay

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

Premium Essay

Pt1420 1

...Bradley Griffin Keith Warren PT1420 Unit 2 Assignment 1: Homework Short Answer: 1. If the problem is program assignment of some sort, than the first step would be to design the basis of the program in pseudocode to gain a clear picture of what kind of commands will work where, then move into flowcharting to start putting together the logic. b. If the problem is an issue in the code that is preventing it from executing, than the first thing that should be done is to look over the program for syntax errors and logic errors.  2. Pseudocode is fake code. This is where a programmer writes out the code without worry of syntax or logic errors to get a visual feel of how the program should unfold. 3. Input, Process, and Output 4. User-Friendly is a term used to describe programs that are easy to use. Algorithm Workbench: 1. A. Display “Height” B. Input height C. Display “Here is the height you entered:”, height 2. A. Display “Favorite Color” B. Input Favorite Color C. 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:”,......

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