Pt1420 Week 2

363 Words2 Pages
Homework 1. What does a professional programmer usually do first to gain an understanding of a problem? Works directly with the customer. 2. What is pseudocode? 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? Used to describe programs that are easy to use. 5. What two things must you normally specify in a variable declaration? Name and Data type 6. What value is stored in uninitialized variables? A default value of 0(Zero) 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. Declare Integer height Display “Enter Height.” Input Height Display 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. Declare Integer color Display “What is your favorite color.” Input color Display color Programming Exercises 1. Personal Information Design a program that displays the following information: • Your name • Your address, with city, state, and ZIP • Your telephone number • Your college major. Declare Integer Personal info Display “What is your name.” Input name Display “what is your complete mailing address.” Input address Display “what is your telephone number.” Input number Display “what is your college major.” Input major. Display personal info 2. Total Purchase: A customer in a store is purchasing five items. Design a program that asks for the price of each item, and then displays the subtotal of the sale, the amount of sales tax, and the total. Assume the sales tax is 6 percent. Declare integer total sale Display “what is the price of item1.” Input item1
Open Document