Sunday, September 29, 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ââ¬
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.