Free Essay

Intro to Programming

In:

Submitted By refsy1z
Words 300
Pages 2
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 creditsTaken
6. //Constant Real creditsNeeded = 90
7. //Declare Real creditsLeft
8. //Ask for user input of studentName and creditsTaken
9. //Display “ What is the students name?”
10. //Input studentName
11. //Display “ How many credits have been taken?”
12. //Input creditsTaken
13. //Calculate remaining credits on line 14
14. //Set creditsLeft = creditsNeeded – creditsTaken
15. //Display student name and credits left on line 16 and 17
16. //Display studentName
17. //Display creditsLeft

Similar Documents

Premium Essay

Intro to Programming

...Intro to programming final study guide 1. Name the components of a computer: CPU, RAM, Secondary storage devices, Input devices, Output devices 2. What does a disk drive do? A disk drive stores data by magnetically encoding it onto a circular disk. 3. What is the largest value that can be stored in a bit? 255 4. What is ASCII? ASCII is the American Standard Code for Information Interchange which is a set of 128 numeric codes that represent the English letters, various punctuation marks, and other characters 5. What is machine language? Machine language is written in 1s and 0s and known as binary. 6. How does a computer execute instructions? The computer uses the fetch-decode-execute cycle. 7. What is assembly language? Assembly language uses short words that are known as mnemonics instead of binary. 8. What is syntax? Syntax is a set of rules that must be strictly followed when writing a program. 9. What is an interpreter? An interpreter is a program that both translates and executes the instructions in a high level language program 10. What is a logic error? A logic error is a mistake that does not prevent the program from running, but causes it to produce incorrect results. 11. What is an algorithm? An algorithm is a set of well defined logical steps that must be taken to perform a task. 12. What is Pseudocode? Pseudocode is fake code. 13. What are the symbols used in a flowchart? The Ovals which are called terminal symbols that start and stop something, The...

Words: 771 - Pages: 4

Free Essay

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

Words: 747 - Pages: 3

Free Essay

Intro to Programming

...1. Case Structure: A multiple alternative decision structure: It allows you to test the value of a variable or an expression and then use that value to determine which statement or set of statements to execute. 2. Logical Operators: Boolean expressions used to create a compound expression. Logical operators AND and OR allow you to connect multiple Boolean expressions. The logical operator NOT reverses the truth of a Boolean expression. Expression (AND) | Value | True AND false | False | False AND true | False | False AND false | False | True AND true | true | Expression (OR) | Value | True OR false | True | False OR true | True | False OR false | False | True OR true | true | Expression (NOT) | Value | NOT true | false | NOT false | True | | | | | 3. Relational Operators: A relational operator determines whether a specific relationship exists between two values. >, <, <-, =>, <=, ==, != (not equal to) 4. Repitition structures: A repetition structure causes a statement or set of statements to execute repeatedly. 5. Condition controlled loop: A condition-controlled loop uses a true/false condition to control the number of times that it repeats. 6. While loop: While loop has two parts (1) a condition that is tested for a true or false value, and (2)a statement or set of statements that is repeated as long as the condition is true. A pretest loop which means it tests a condition before performing...

Words: 834 - Pages: 4

Free Essay

Intro to Programming

...Program Description: This program will calculate total usable area of a house by summing the square feet of rectangular rooms. This requires inputs in the form of length and width dimensions of each room to find the area of each room then adding those numbers together to find the area of all rooms. The results will be the output in area of each room and the total area of all the rooms. Analysis: The area of each room is found using the equation Area=Length x Width. The output in total square feet is found by summing the output of the individual rooms. L = Length of room W = Width of room Area= (L) * (W) R1 = Room 1, L1 * W1 R2 = Room 2, L2 * W2 R3 = Room 3, L3 * W3 Define 3 integer numbers as area of each room: R1, R2, R3 Usable area will store the sum in total square feet of R1, R2, R3 Test Plan The following input is required for testing: Test Case 1: R1: L = 10, W = 12, L*W = 120 R2: L = 10, W = 10, L*W = 100 R3: L = 12, W = 12, L*W = 144 Usable Area: R1 + R2 + R3 = 364 square feet Test Case 2: R1: L = 10, W = 12, L*W = 120 R2: L = 11, W = 11, L*W = 121 R3: L = 12, W = 12, L*W = 144 Usable Area: R1 + R2 + R3 = 385 square feet Pseudocode // This program will add together the square feet of rooms to determine the total square feet of a house. // Declare variables Declare R1, R2, R3, Usable Area as Integer // Set values of Integers //The values for R will be found using L x W for each Room Set R1 = 120 Set R2 = 100 ...

Words: 317 - Pages: 2

Free Essay

Intro to Programming

...Individual Project Professor IT106-1401A-05: Introduction to Programming Logic Contents Phase 1 3 Deposit 3 Transfer 3 Phase 2 4 Problem Analysis Chart 4 Inquiry 4 Deposit 4 Transfer 4 Structure Chart 4 IPO 4 Inquiry 4 Deposit 4 Transfer 4 Coupling Diagram 4 Data Dictionary 4 Phase 3 5 Inquiry 5 Flowchart 5 Pseudocode 5 Deposit 5 Flowchart 5 Pseudocode 5 Transfer 5 Flowchart 5 Pseudocode 5 Phase 4 6 Flowchart 6 Pseudocode 6 Phase 5 7 Inquiry 7 Deposit 7 Transfer 7 Phase 1 Part 2: Determine current amount available in checking account (balanceChecking)-$50.00 Determine what the transfer amount will be (transferAmount)-$25.00 Retrieve the transaction number for confirmation (transactionNumber)-54643635345 Phase 2 Problem Analysis Chart Given Data | Required Results | Account number and PIN | Account Balance | Processing Required | Solution Alternatives | 1. Access banking systems to retrieve data 2. Provide to customer | 1. Have an automated system that emails balance info as opposed to displaying it. | Structure Chart Account information | VerifyInfo | Provide info | AccessInfo | Locate Retrieve PIN Display Info IPO Input | Processing | Module Reference | Output | Account numberWhich Account...

Words: 315 - Pages: 2

Free Essay

Intro to Programming Concepts

...Class | Attributes | Responsibilities | Operations | BookTextbookPicturebook | ISBNAuthorTitlePriceRangeAge | Receive Book DataValidate Book DataSelect and Print DataReceive Book DataValidate DataSelect and Print DataReceive Book DataValidate Book DataSelect and Print Data | +setBook-Over$50+validatePrice+setBook-GradeRange3to6+validateGrade+setBook-AgeRange3to6+validateAge | UML Book | -ISBN-Author-Title-Price | +over$50( ) | TextBook | -Grade | +GradeRange3to6( ) | PictureBook | -Age | +AgeRange3to4( ) | Book Class START setBook(inISBN, inAuthor, inTitle, inPrice) ISBN= inISBN Aurthor= inAuthor Title= inTitle Price= inPrice END START Over$50 validatePrice(validInput) IF validInput AND Price > 50.00 THEN Print ISBN, Author, Title, Price ENDIF END START validatePrice validate=true IF Price Not numeric THEN validInput=false Display ‘Invalid Price’, Price ENDIF END Book Driver Algorithm START testBook Create Book 1 as new Book( ) inISBN= 111111 inAuthor= ‘Test Aurthor’ inTitle= ‘Test Title’ inPrice= 55.99 Book 1.setBook(inISBN, inAuthor, intitle, inPrice) Book1.Over$50( ) END START TextBook class setTextBook(inISBN, inAuthor, inTitle, inPrice, inGrade) ISBN= inISBN Aurthor= inAurthor Title= inTitle Price= inPrice Grade=inGrade END START ...

Words: 1298 - Pages: 6

Premium Essay

Intro to Programming Lab 1

...Exercise 1.3.1 What is the decimal value of Byte 1 by itself? What is the decimal value of Byte 2 by itself? Answer: 25, 233 Exercise 1.5.1 On the desktop of your operating system, create a new folder called Classes. Open the C: drive and locate the path through the subfolders from the root directory C: to get to your Classes folder. This path will differ slightly depending on the operating system. Record the navigation path to get to your new Classes folder. Hint: Most directory structures that include the desktop of a computer involve finding a folder for users and selecting the correct user. Answer: click on start, then computer, then desktop and the “Class” file is there. Exercise 1.5.2 Open the Classes folder you created and move the myname. txt file to the Networking folder. What has happened to the OS reference to the location of the file myname. txt? What has happened to the physical storage location of myname. txt in memory? Answer: 1. The OS reference has been moved from the main folder “Classes” to the sub folder “Networking” 2. The os reference is now under the sub folder Networking in memory. Exercise 1.6.1 Record the amount of space you have available and how much total space you have on your Windows hard drive. Answer: 417 GB free if 465 GB. Exercise 1.6.3 Locate the system information for your Windows machine and record the amount of RAM you have installed. Answer: 4.00 GB of RAM Exercise 1.6.5 Access the System Information window on your Windows machine...

Words: 421 - Pages: 2

Premium Essay

Intro to Programming Usin Java

...Introduction to Programming Using Java Course Specifications Course length: 1.0 day(s) Course Description Course Objective: You will learn the basic concepts of programming using Java as the tool for learning. Target Student: This course is intended for students with no prior academic background in a field other than computer science or programming, who wish to embark on a course of study that will prepare them for employment as professional software developers. Students who interact on a business basis with software development professionals and need to improve communication through better understanding of the concepts and terminology used by professional programmers will also benefit equally. Prerequisites: Students should be familiar with using personal computers with a mouse and keyboard. Basic typing skills are mandatory. Students should be comfortable in the use of the Windows 2000, Windows XP, Windows Vista environment, or Windows 7 environment. To ensure your success in this course, we recommend that you take the following Element K courses or have equivalent experience: Microsoft Windows Vista: Level 1Microsoft Windows XP Professional: Level 1 Course Objectives Upon successful completion of this course, students will be able to: · explore various programming concepts. · create simple programs. · use methods to define the behavior of classes. · implement the object-oriented methodology. · handle errors in a program. Course Content Lesson 1: Introduction...

Words: 323 - Pages: 2

Premium Essay

Intro to Programming Chapter Three Homework

... | | | 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 while loop.   | a.  | True |   | b.  | False | | | | 11. Programs that use __C___ code logic are unstructured programs that do not follow the rules of structured logic.   | a.  | case | b.  | loop |   | c.  | spaghetti | d.  | nested | | | | 12. With a(n) __C__, you perform an action or task, and then you perform the next action, in order.   | a. ...

Words: 1129 - Pages: 5

Free Essay

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

Words: 311 - Pages: 2

Premium Essay

Intro to Programming Unit 1 Research Assignment

... 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 free-form and compiled. It is regarded as an intermediate-level language...

Words: 677 - Pages: 3

Free Essay

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

Free Essay

Intro to Programming Pizza Pi Iii Pseudo Code

...* Declarations * Constants are needed for * The minimum size a user can enter * 12 * The maximum size a user can enter * 36 * The # of slices in a small pizza * 8 * The # of slices in a medium pizza * 12 * The # of slices in a large pizza * 16 * The # of slices in an extra-large pizza * 24 * Variables are needed for * A Boolean for whether or not the program should exit, set to false by default * A Boolean for whether or not the input passed validation, set to false by default * A String for what the user inputs * An Integer for what the pizza’s diameter is, assuming it passes validation * Input * Ask the user for input and then read it * If the user input is the number 0, the exit variable is set to true and the loop is broken * Check if the input is valid, to be valid it must meet these parameters * Input must be above the number 12 * Input must be below the number 36 * Input must be a number * If the input is not between 12 and 36, tell the user and loop back to the initial prompt * If the input is not between a number, tell the user and loop back to the initial prompt * If validation is passed, the validation variable is set to true and the loop is ended * Processing and Output * If the validation...

Words: 341 - 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.

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

Words: 393 - Pages: 2

Premium Essay

Microsoftword

... BEHAVIORAL SCIENCE 00783 INTRODUCTION TO BEHAVIORAL SCIENCE A 3:30 - 5:0 MW 154 00784 INTRODUCTION TO BEHAVIORAL SCIENCE B 5:0 - 6:30 ST 154 00785 INTRODUCTION TO BEHAVIORAL SCIENCE D 9:30 - 11:0 ST 154 00787 INTRODUCTION TO BEHAVIORAL SCIENCE E 11:0 - 12:30 MW 154 00788 INTRODUCTION TO BEHAVIORAL SCIENCE F 12:30 - 2:0 ST 154 00789 INTRODUCTION TO BEHAVIORAL SCIENCE G 2:0 - 3:30 MW 154 00790 INTRODUCTION TO BEHAVIORAL SCIENCE H 3:30 - 5:0 ST 154 00791 INTRODUCTION TO BEHAVIORAL SCIENCE I 5:0 - 6:30 MW 154 INTRO TO PROGRAMMING 00030 INTRO TO PROGRAMMING (BBA) A 8:0 - 10:0 S 432 LABORATORY 8:0 - 11:0 T CL7...

Words: 479 - Pages: 2