Saturday, November 9, 2019

Homework for professional programmer Essay

Short Answer 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?† Input sucker Name Display â€Å"What a nice name you have, â€Å", suckerName, â€Å" now where might your address be?† Display â€Å"Street: (ex: 12345 What St.)† Input suckerStreet Display â€Å"Now the city: (ex: Who’sville) Input suckerCity Display â€Å"Now how about your state? (ex: IN) Input suckerState 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† Input stuffOne Display â€Å"item 2† Input stuffTwo Display â€Å"Item 3† Input stuffThree Display â€Å"Item 4† Input stuffFour Display â€Å"Item 5† Input stuffFive 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†

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.