Free Essay

Introduction to Programming

In: Computers and Technology

Submitted By dmccon1
Words 400
Pages 2
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 total = 0; double tax = 0;

//Enter Items cout << "Please enter the price of item 1"; cin >> item1;

cout << "Please enter the price of item 2"; cin >> item2;

cout << "Please enter the price of item 3"; cin >> item3;

cout << "Please enter the price of item 4"; cin >> item4;

cout << "Please enter the price of item 5"; cin >> item5;

//Compute subtotal subtotal = (item1 + item2 + item3 + item4 + item5 + item6);

//Compute amount of tax

tax = subtotal * (.06);

//Compute total

total = subtotal + tax;

//Display subtotal, total, and amount of tax

cout < " The subtotal of the sale is: " << subtotal << endl; cout < " The amount of sales tax is: " << tax << endl; cout < " The total of the sale is: " << total << endl;

return 0;

}//end of function main

Personal Information
1: Design a program that displays the following information:
. Your Name
. Your address, with city, Ind, and zip
. Your telephone number
. Your college major…...

Similar Documents

Free Essay

Programming

...Calling an external function or program that is written in a different programming language like a Java program within a Visual Basic program you first need to know the Function fundamentals that’s executed in any programming language. I came across this website called maples, where they have the ability to connect to and call functions from other programming languages. Maple uses this for various reasons. Like all other languages, the F# function has a name, it can have parameters, has a body and takes arguments. F# also supports functional programming constructs such as handling functions as values, depleting unnamed functions in expressions, composition of functions to form new functions, curried functions, and the implicit definition of functions by way of the partial application of function arguments. Maple's help system documents all the External Calling functions so you can see what is available. Briefly, however there are functions for converting Maple types to C and back, creating and interacting with Maple data structures creating and interacting with Maple language elements (names, procedures, etc), printing to the Maple interface, memory allocation, evaluating Maple statements and raising exceptions. There is even a C interface to the Task Programming Model. The function-name is an identifier that represents the function. The parameter-list consists of successive parameters that are separated by spaces. You can specify an explicit type for each parameter, as......

Words: 394 - Pages: 2

Premium Essay

Programming

...times 4 and stores the result in a c. Divides a by 3.14 and stores the result in b d. Subtracts 8 from b and stores the result in a 8. Write a pseudocode statement that assigns the sum of 10 and 14 to the variable total. 9. Write a pseudocode statement that subtracts the variable downPayment from the variable total and assigns the result to the variable due. 11. If the following pseudocode were an actual program, what would it display? Declare Integer a = 5 Declare Integer b = 2 Declare Integer c = 3 Declare Integer result Set result = a + b * c Display result 12. If the following pseudocode were an actual program, what would it display? Declare Integer num = 99 Set num = 5 Display num PROGRAMMING EXERCISES (Input, processing, and output) 2. Sales Prediction A company has determined that its annual profit is typically 23 percent of total sales. Design a program that asks the user to enter the projected amount of total sales, and then displays the profit that will be made from that amount. Hint: Use the value 0.23 to represent 23 percent 3. Land Calculation One acre of land is equivalent to 43,560 square feet. Design a program that asks the user to enter the total square feet in a tract of land and calculates the number of acres in the tract. Hint: Divide the amount entered by 43,560 to get the number of acres. 4. Total Purchase A customer is a store is purchasing five items. Design a program that asks......

Words: 1054 - Pages: 5

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

Free Essay

Programming

...Introduction Selection structures allow computer programs to perform different functions depending on if the condition of the function is true or false. Selection structures also enable the program to decide on a particular action based on the input of the user or other processes. There are several different types of selection structures that can be put into operation, they are the IF selection statement, the IF ELSE selection statement and switch selection statement. This paper will attempt to explain selection structure and its different types and will also give a real life scenario in pseudo code. Selection Control Structure Computer programs utilize selection structures to choose from a variety of actions or processes. These processes typically have an outcome of true or false. When a program reads as true the process will be directed to the output that enables it to be true and vice versa for false processes. With computers having the ability to solve problems, make decisions and follow direction with the aide of a program it eliminates many human errors. The “IF” selection statement structure is used when there is a solitary or a collection of inputs to be executed to decide if the condition is true or false. If a process is submitted as false the “IF else” statement is rendered and the false output is passed over and the computer continues executing to the next selection structure. The IF statement structure also compares two values with relational operators: •...

Words: 505 - Pages: 3

Free Essay

Programming

...the module in which its declared and only statements inside that module can access that module can access the variable. 5. The local variable usually beings at the variables declaration and ends at the end of the module which is then the variable is declared. 6. The difference between the both is that only a copy of the arguments value is passed and passing by reference means that the argument is passed into a specific type of parameter. 7. Global variables make debugging difficult because they make programming hard to understand, modules that use global variables are usually dependent and you have to track down every statement. Algorithm Workbench 1. Module main() Declare userNum as Integer Display “Enter a number” Input userNum Call TimesTen(usernum) Display usernum End 5. 13.4 00.0 00.0 6. 1, 3.4 0, 0 0, 0 7. Allows changes the values of passed parameters 1,3.4 0,0 0,0 Doesn’t allow changing of parameters 1,3.4 0,0 1,3.4 Programming Exercises 1. Kilo=input (“Enter distance in kilometers”) Miles=Kilo Print”, Kilo 2. Module TotalPurchase Declare Double amount, total Declare TAX=.06 While I<6 Display “Enter the price” Input amount Total=total+amount I=I+1 End while Display “Subtotal is:” + total Display “Tax is:” + (total*TAX) Display “Total is:”=(total*TAX)+total) End Module...

Words: 309 - Pages: 2

Free Essay

Programming

...information contained in this book or from the use of the CDROM or programs accompanying it. COVER DESIGN Aren Howell COPY WRITER Eric Borgert LAYOUT TECHNICIANS Brian Borders Susan Geiselman TeamLRN Contents at a Glance Introduction 1 AND PART I INTRODUCING DATA STRUCTURES Hour 1 2 3 4 5 Arrays Ordered Arrays The Bubble Sort The Insertion Sort ALGORITHMS 9 11 31 51 75 89 Overview of Data Structures and Algorithms PART II ABSTRACT DATA TYPES Hour 6 7 8 9 10 Stacks Queues and Priority Queues Linked Lists Abstract Data Types Specialized Lists AND 105 107 125 145 165 183 PART III RECURSION Hour 11 12 13 14 QUICKSORT 205 207 233 257 279 Recursion Applied Recursion Quicksort Improving Quicksort PART IV TREES Hour 15 16 17 18 19 20 Binary Trees Traversing Binary Trees Red-Black Trees Red-Black Tree Insertions 2-3-4 Trees Implementing 2-3-4 Trees 295 297 317 337 359 379 395 PART V HASH TABLES Hour 21 22 23 24 Hash Tables Quadratic Probing Separate Chaining When to Use What 415 417 441 457 475 PART VI APPENDIXES Appendix A B C Quiz Answers How to Run the Workshop Applets and Sample Programs Further Reading Index 487 489 505 509 513 TeamLRN Table of Contents INTRODUCTION 1 What This Book Is About ........................................................................................1 What’s Different About This Book..........................................................................2 Easy......

Words: 10065 - Pages: 41

Free Essay

Programming

...- -[ ] http://blog.renren.com/blog/73603/740437492 » / [ ] 2011-07-18 10:47 | ( : ) http://coolshell.cn/articles/4990.html 6 12 programming An open letter to those who want to start id Mailper Python Web “ Build Your Programming Technical Skills “ ( ) Notes/ActiveX/COM/ADO/ATL/.NET …… Mailper Delphi/Power builder ” Lotus 5 3D TA 561 ” The architecture of w-ai.org –... Some updates and my first Engl... / 10 Unix/Linux Windows 1 Linux Web+ 1 Python/Ruby Web 2 iOS Android Windows Windows Windows Linux+ Windows 9 : csv ( log python csv, python open, python sys) 52 word count (sys, os, path) (python sqlite) print Google (phrase, domain, use reader to follow tech blogs) 2 ( Vim / Emacs / Notepad++ Source Insight ( ctag) Cool IDE) / / 3 Unix/Linux Shell windows man ls/chmod/chown/rm/find/ln/cat/mount/mkdir/tar/gzip … sed/awk/grep/tail/less/more … ps/top/lsof/netstat/kill/tcpdump/iptables/dd… /etc /var/log /proc linux vmware player Ubuntu 1 6 9/6/13 1:36 PM - -[ ] http://blog.renren.com/blog/73603/740437492 /Linux 4 Web Web HTML CSS HTML Firefox + Firebug Javascript HTML DOM Firefox + Firebug Apache PHP PHP PHP chrome Nginx HTML MySQL MySQL SQL http://www.stanford.edu/~ouster/cgi-bin/cs142-fall10/index.php ) javascript HTTP: The Definite Guide browsers) Cookie/Session jQuery 4 3-5 ExtJS + Ajax ( +JSON (proxy, gateway, Javascript box model chrome DOM......

Words: 807 - Pages: 4

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

Pt1420 Introduction to Programming Lab03

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

Words: 275 - Pages: 2

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

Programming

...Question: Analyze, design, and document a simple program that utilizes a good design process and incorporates sequential, selection and repetitive programming statements as well as at least one function call and the use of at least one array. The specific problem you need to solve for the final project is: Design a program that will allow a user to Input a list of your family members along with their age and state where they reside. Determine and print the average age of your family and print the names of anyone who live in Texas. 2. What is the required output? What is the necessary input? How you will obtain the required output from the given input? Clearly describe variable names and definitions. Include all necessary formulas and example calculations. 3. Display pseudocode of your overall design including the Main module and the order of the module, subprogram and function calls. 4. Create a Hierarchy chart for the overall program in raptor 5. detailed pseudocode for each module, subprogram and function. 6. Add pseudocode comments with all major functionality and most minor functionality commented 7. Show test plan covering all major functionality and most minor functionality. Multiple Input and expected output provided for most modules. SOLUTION: Analysis: For this program, user will be asked for name, age and state of their family members, one by one, until the user decides to stop entering this information. To achieve the given task (printing average family......

Words: 919 - Pages: 4

Premium Essay

Programming

...flowcharts to describe a program’s structure. Use pseudocode to define a program’s structure. Formulate solution algorithms for calculations by properly following the order of operations. Assignment Requirements Answer: * Short Answer 1, 2, 3, and 4 on page 71 * Algorithm Workbench Review Questions 1 and 2 on page 71 * Programming Exercises Questions 1 and 4, starting on page 72 Required Resources Textbook Submission Requirements Submit your written answers to your instructor at the beginning of Unit 3. Unit 2 Research Assignment 1: Researching Variable Naming Rules Learning Objectives and Outcomes Determine program input, processing, and output stages. Create the necessary flowcharts to describe a program’s structure. Use pseudocode to define a program’s structure. Formulate solution algorithms for calculations by properly following the order of operations. Assignment Requirements Use the Internet and the ITT Tech Virtual Library to research the following questions: What are the variable naming rules of Visual Basic, Python, and Java? List three similarities and differences in between the three programming languages. Required Resources Textbook ITT Tech Virtual Library: http://library.itt-tech.edu Submission Requirements Submit your written answers to your instructor at the beginning of Unit 3. Labs Unit 2 Lab 2.1: Pseudocode Learning Objectives and Outcomes * Use pseudocode to define a program’s structure. *......

Words: 450 - Pages: 2

Premium Essay

Programming

...CSC331 – DATABASE MANAGEMENT SYSTEMS INSTRUCTOR: PERICLES LENG CHENG <Cyprus Blood Donation> Team Leader: <Alexandros Kafizas> Team Members: <Constantinos Eracleous, Andreas Theophanous, Petros Christodoulou> Requirements Discovery & Modeling * Introduction This database will be used to store the data for blood donations in Cyprus. The users will be able to retrieve any information about blood donors and blood donations. Users will be able to create and update any client entry containing essential information in order to be able and contact them, arrange participation in any upcoming donations and provide doctors and nurses of the blood donation with essential information about them. The database is also going to be used for storing the participating nurses and doctors data as well as equipment that is going to be used if the blood donation is not going to be taking place at a fixed location but on a random location (school, army, etc). The database would provide the appropriate protected access for the users and the data will be saved to a back up file. * Data Requirements * Donors The database system should allow the user to add new donors to the system. When adding a new donor the user should be able to enter the first name and last name of the donor, id number, date of birth, sex, Nationality, phone number, address (Country, Town, street, Postal code), blood type, type of donation and the date of last donation. ......

Words: 773 - Pages: 4

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

Programming

...Programming 1 - Semester 1, 2015 Assignment 1 Release Date: 27 / 02 /2015 Total raw marks: 60 Assignment weight: 6% NOTE: This assignment is to be undertaken individually—no group work is permitted. Background information For this assignment you are to complete a partially completed menu-driven, Java console application, which allows the user to select one of four options:     Display Time and Date Swim Fitness Summary Calculator Sentence Analyser Exit The incomplete code solution (in the source file called MenuDrivenProgram.java) is in the same Assignment 1 folder, available via myRMIT. The partially completed program already has code to display the menu. You should study the code and then compile and execute it without implementing the following options. This will allow you to understand the flow of execution of the program, as is. a) Once the processing for the selected option has been completed the program should return to the menu (that is, the program should not terminate). b) You do not need to handle runtime errors of any kind for this assignment and you may assume that the user will always enter input in the correct format. This applies both to the menu itself and the processing of the menu options. Program Features Menu Option A - Display Time and Date (10 marks) The program should retrieve the current time and date from the system and then display it in the format shown......

Words: 1404 - Pages: 6