Homework for professional programmer Essay
Homework for professional programmer
1. What does a professional programmer usually do first to gain an understanding of a problem? (The wording of this question has me a little stumped so I’ll give you all the answers that are running through my head and see if that is what you are looking for here) a. Should “problem” = 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. Should “problem” = an issue in the code that is preventing it from executing, than the first thing I would imagine being done is to look over the program for syntax errors and logic errors. (While I know that syntax is usually the culprit for error, I may as well look for the both of them if I’m going to be going over code line by line.)
2. What is pseudocode?
Pseudocode is “fake” code (as per the pseudo meaning fake and code meaning 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. Computer programs typically perform what three steps?
The three steps that computer programs typically perform are: a. Input- where the program collects data from a source
b. Process- Where the input data is used for an out come
c. Output- where the processed data is presented
4. What does the term “user-friendly” mean?
User-friendly is a term used in the software development 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.
1 Display “You have found the I’m Going to Turn Your Height into Information I Can Use program (feel free to clap and cheer!)”
2 Display “Enter your height, please”
3 Input yourHeight
4 Display “Thank you! (Now please move along, I have more people to collect data from.)” 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 “Wow! You found my super-secret hiding place… While you’re here, can I ask you what your favorite color is?” 2 Input favColor
3 Display “You are getting sleepy… soooooo very sleepy… when you wake up, you will never remember being here… “
Programming Exercise Questions
1. Personal Information
Design a Program that displays the following information:
* Your name
* Your address, with the city, state, and ZIP
* Your telephone number
* Your college major
Display “Welcome to your personal information data collection program. It would be my honor to collect your personal data and use it at my discretion. Now, if you don’t mind, I would love for you to simply enter your data when prompted. Thank you so much.”
Display “What might your name be?”
Display “What a nice name you have, “, suckerName, “ now where might your address be?” Display “Street: (ex: 12345 What St.)”
Display “Now the city: (ex: Who’sville)
Display “Now how about your state? (ex: IN)
Display “Now I’d like your zip-code please.(ex: 54321)” Input suckerZip
Display “Just for fun, how about you give me your phone number too. Area code first, please. I’d like this to be accurate when I spread your information to all of those annoying telemarketers out there. (ex:(123)456-7890) Input sucker Phone
Display “Alright, last bit of info. I just need your college major and you are free to go.” Input sucker Major
Display “Thank you for all of your time. I hope to have you talking to a
million people you don’t want to answer the phone for soon. Have a pleasant day.”
From the Programmer,
I understand that I would need to take this type of program much more seriously if I were to be putting together something for a client. I have had a good run of the college recruiter phone calls lately stemmed from the misfortune of trying to look for scholarships. Unfortunately I decided to take it out on this program assignment. My hope is that you will have just as much of a laugh over it as I have and that you find it to fulfill the requirements of the assignment.
4. 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. Display “StuffMart Cart”
Set stuffTax = 0.06
Display “Please enter each item separately”
Display “Item 1”
Display “item 2”
Display “Item 3”
Display “Item 4”
Display “Item 5”
Set stuffSub =stuffOne + stuffTwo + stuffThree + stuffFour + stuffFive Display “Here is your subtotal: $”, stuffSub
Set stuffTotal =stuffSub * stuffTax
Display “Here is your total due: $”, stuffTotal
Display “Thank you for shopping at StuffMart”