9/30/2014
Chapter 2 Assignment 1: Homework
Short Answer
1. What does a professional programmer usually do first to gain an understanding of a problem?
A professional programmer gains this understanding by working directly with the customer.
2. What is pseudocode?
The word pseudo means fake, so pseudocode is fake code.
3. Computer programs typically perform what three steps?
1 input is received.
2 Some process is performed on the input.
3 Output is produced
4. What does the term user-friendly mean?
The term user-friendly is commonly used in the software business to describe programs that are easy to use.
Algorithm Workbench Review
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.
Display “What is your height?”
Input 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.
Display “What is your favorite color?”
Input color
Programming Exercises
1. Personal information
Display “Enter your name”
Input name
Display “Enter your address, with city, state, and zip”
Input address, city, state, zip
Display “Enter your telephone number”
Input Telephone number
Display “Enter college major”
Input college major
2. Total Purchase
Display "Enter the first item"
Input item1
Display "Enter the second item"
Input item2
Display "Enter the third Item" input item3
Display "Enter the fourth Item" input item4
Display "Enter the fifth Item" input item5
Set subtotal=item1+item2+item3+item4+item5
Set sales tax= subtotal*.06
Set total=subtotal+sales tax
Display "the subtotal is", subtotal, "the sales tax is", sales tax, "total is", total