Group Forums >> web developers and designers >> I need help
I need help
|
3 posts back to top |
Posted 8 months ago Hi everyone, I am new to this group and I'm a beginning student to programming. I am taking a VB class this semester and the text book is hard to follow. The professor I have does not really get back to you when you asked him questions, so like my fellow class mates, we are lost. So I decided to come to you guys to see if you can help me out and explain it in an easier way. The text book we are using is An Introduction to Programming using Visual basic 2008, by David I Schneider. The fast-food vendor sells pizza slices for $1.75, fries for $2.00 and soft drinks for $1.25. We are to write a program that will compute the customer's bill. This program should program should request the quantity of each item ordered in a Sub procedure, calculate the total cost with a Function procedure, and use a Sub procedure to display an itemized bill. How do I go about starting this program?
|
|
1355 posts back to top |
| Posted 8 months ago I hope someone can answer your question. I haven't gotten that far in my studies. On a personal note I have used a form for my invoices that calculates all of that automatically, it's through Microsoft Excel. If you can figure out the mechanics of it I am sure you could write a program using that method. I got the template off of Microsoft's Web site. The forgetful fishy........I think??!!?? |
|
440 posts back to top |
| Posted 8 months ago Sorry ms, I haven't done any real programming since 1981. I'm a relic in that department and methodologies have changed considerably since then. Any advice I give you on the subject would likely get you an "F" in your class, although it would work.
|
|
2 posts back to top |
| Posted 8 months ago Like Phreadd, I haven't done any real programming since the early 80's. I would recommend you start with the math. Write the problem as a math equation... like "1.75 * (x) + 2.00 * (y) + ..." There's your Function. That always helps to wrap your mind around the problem and show ways you might simplify it. Use the book to find the syntax for formatting the problem and printing your results. Then start loading your program and troubleshooting your results. Nothing works better than trial and error in the learning process! Hope this helps. Good Luck! |
|
3 posts back to top |
| Posted 8 months ago Thanks guys, you were all helpful. |
|
10 posts back to top |
| Posted 8 months ago ms_bossy says ...
Hey I gotcha just message me I just took Microsoft VB 2008 Edition Utilizing Express Edition. This sounds quiet familar, wouldn't be from Kaplan would it? Anyway if your still stuck lemme know I suppose. |
|
20 posts back to top |
| Posted 8 months ago Sonja said: "Write the problem as a math equation... like "1.75 * (x) + 2.00 * (y) + ..." There's your Function." She's correct. But I think it would help more if you create identities to emphasis the order of presidence: ((1.75 * x) + (2.00 * y) + (1.25 * z) ) The variables "x", "y" & "z" should be the arguments passed to your subroutine/function. It is also wise to declare your constant values with appropriate names and make them global constants. ((PIZZA_PRICE * x) + (FRIES_PRICE * y) + (DRINK_PRICE * z) ) NOTE: Make your constant's names ALL CAPS to differentiate the names from variables & function, subroutine names. DO NOT use one-character names ("x", "y"...) -- Use more descriptive names, BUT don't make the mistake most programmers make by making your names too long. Unnecessarily long names make the source code more difficult to read. This enhances readability and makes the program MUCH easier to maintain and alter in the future. Almost EVERY value in a program WILL change over time. If you can keep that in your mind, you'll be ahead of most of your classmates. |
