Elite Fitness Bodybuilding, Anabolics, Diet, Life Extension, Wellness, Supplements, and Training Boards
Chat & Conversation Turbo Pascal
|
Author | Topic: Turbo Pascal | ||
Pro Bodybuilder Posts: 350 |
does anyone have any experience in this basic programming. I just have a basic qustion/programme i need to write but i missed the classes in myComputing course on this subject and need help. anyone???? | ||
Amateur Bodybuilder Posts: 249 |
I'll help ya out... what seems to be the problem? (reply quick or you'll have to wait till I wake up in the mornin'... heh) -Warik | ||
Pro Bodybuilder Posts: 350 |
ok all u pascal wizards, heres the question: A caresalesman wants a programme to display the following: REGISTRAION WHOLESALE PRICE SELL PRICE that is how the display must look, the sale price is 40% of the wholesale. can anyone help, much appreciated!! | ||
Amateur Bodybuilder Posts: 249 |
Ok. I don't know Pascal, so I took a few minutes to learn it so I can help you out here... if I have some errors in my code, it's cause I've never written anything in Pascal. Ok, so it has to display the Registration, Wholesale Price, and Sell Price. I assume that you have to input the Registration and the Wholesale Price. First you need to declare variables to store all of those values. You need the registration, the wholesale price, and the sell price.
Then you must assign values to those variables through keyboard input. First your "begin" statement...
writeln('Please enter the registration number: '); Now you must calculate the sell price of the car. You said that the sale price is only 40% of the wholesale price... you have the wholesale price in your example at $1000 and the sell price at $1400. That's 40% MORE than the wholesale price. I'll assume that's what you meant. sellPrice := wholesalePrice * 1.40; Now to display the output. I'll let you figure that one out yourself... it's the easiest part of the program. =) Now, you said that the program must only do 5 cars, so you can use a FOR loop which starts before the first "writeln" statement and ends right after you display the output. So here is pretty much how the entire program should look. Please refrain from just copying it and being done with it for you will learn nothing and never be a good programmer. Ok, now that I've said that, here it is. var registration : char; begin for counter := 1 to 5 do sellPrice := wholesalePrice * 1.40; ***CODE TO OUTPUT GOES HERE*** end. I think that should do it. If you have any more trouble, let me know. -Warik [This message has been edited by Warik (edited November 24, 2000).] | ||
Pro Bodybuilder Posts: 350 |
thanks warick, ill give it a go this week in class, are u telling me u just learnt that on the spot, well done bro. | ||
Amateur Bodybuilder Posts: 249 |
No problem, you're welcome. Just worry about thinking how to SOLVE the problem before you start thinking about how to WRITE the solution. That's the key to getting a program written. Anyone can type out lines of code, but it takes skill to have those lines of code perform a specific task as efficiently as possible. -Warik | ||
Elite Bodybuilder Posts: 1114 |
What language do you normally program in Warik? | ||
Amateur Bodybuilder Posts: 249 |
Normally, I'm an underpaid PHP programmer interacting with a MySQL database. I also know Perl and Visual Basic (if you can call that a programming language), and I'm taking a C++ "class" at college. (Note the quotes... they move sooo slowly.) How about you, Latimer? Are you a programmer as well? -Warik | ||
Elite Bodybuilder Posts: 1114 |
I'm not a programmer. I've screwed around a little with VB and Java and even some C++. I'm in the Cisco Academy right now and will have my CCNA in spring and i'm studying at home for MCSE, which I should have shortly after I get my CCNA. I was just curious to see what kind of language you normally coded in. I'd like to get into PHP sometime in the future. My friend and I are developing a web site right now that will rely heavily on databases. We're still deciding which route to go but I'm leaning towards PHP. |
All times are ET (US) | |
Powered by Infopop www.infopop.com © 2000
Ultimate Bulletin Board 5.45c