Welcome to Dream.In.Code
Become an Expert!

Join 136,938 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,848 people online right now. Registration is fast and FREE... Join Now!




QBASIC NEED HELP WITH HOMEWORK PLEASE

5 Pages V  1 2 3 > »   
Reply to this topicStart new topic

QBASIC NEED HELP WITH HOMEWORK PLEASE, Need help with my homework please =\

StealthTools
11 Mar, 2008 - 11:19 AM
Post #1

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
HI...

I need help with my QBasic homework

Here it is: Use QBasic to write a program that allows the user to enter the number of quarters, dimes, nickles, and pennies. The program should translate the coins into a dollar amount and display the result. Your program should include the following:

* A SUB procedure that recieves the number of each coin and translates the coins into a dollar amount.

* Appropriate comments, including your name, a brief summary of the program, and description for each set of statements.

* Descriptive variable names.

* Correct, formatted output.



If you can help me on this or even write a program for me that would be awesome!

I have to have it completed by 6:00pm 3/11/08

I am logged into Windows Live messenger now: Stealth_Tools@Hotmail.com

Thanks for your help...


User is offlineProfile CardPM
+Quote Post

Nykc
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:27 AM
Post #2

sudo rm -R /
Group Icon

Joined: 14 Sep, 2007
Posts: 4,152



Thanked: 16 times
Dream Kudos: 275
My Contributions
LMAO - They are still teaching QBasic.

I would be happy to do your homework for you, but I don't think you professor would approve of PLAGIARISM.

Oh and Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.


Instead post your code.gif and we can maybe help you when you get stuck. List your errors and what it should be doing. We can work through this as a team.

Happy Coding!

This post has been edited by Nykc: 11 Mar, 2008 - 11:28 AM
User is online!Profile CardPM
+Quote Post

StealthTools
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:28 AM
Post #3

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(Nykc @ 11 Mar, 2008 - 12:27 PM) *

LMAO - They are still teaching QBasic.

I would be happy to do your homework for you, but I don't think you professor would approve of PLAGIARISM.

Instead post your code.gif and we can maybe help you when you get stuck. List your errors and what it should be doing. We can work through this as a team.

Happy Coding!



I don't have a professor.. I am home schooled and have a proctor... I have no clue how to do this and if I had the working code I could learn THIS PROGRAM and take my test and hopefully make a good grade on it... this program is to help me learn before my test

I can paste code I have done in the past but I have no idea on how to do SUB functions...

This post has been edited by StealthTools: 11 Mar, 2008 - 11:30 AM
User is offlineProfile CardPM
+Quote Post

Nykc
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:33 AM
Post #4

sudo rm -R /
Group Icon

Joined: 14 Sep, 2007
Posts: 4,152



Thanked: 16 times
Dream Kudos: 275
My Contributions
This should help you out in regards to SUBS and Functions.

SUBS and Functions
User is online!Profile CardPM
+Quote Post

StealthTools
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:37 AM
Post #5

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(Nykc @ 11 Mar, 2008 - 12:33 PM) *

This should help you out in regards to SUBS and Functions.

SUBS and Functions



If you would please stay with me on thsi post... I will try and create this program and post it on here,

thanks a bunch
User is offlineProfile CardPM
+Quote Post

Nykc
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:42 AM
Post #6

sudo rm -R /
Group Icon

Joined: 14 Sep, 2007
Posts: 4,152



Thanked: 16 times
Dream Kudos: 275
My Contributions
Ill be around till 4:30 EST. I will do my best to help you

This post has been edited by Nykc: 11 Mar, 2008 - 11:42 AM
User is online!Profile CardPM
+Quote Post

StealthTools
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:50 AM
Post #7

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(Nykc @ 11 Mar, 2008 - 12:42 PM) *

Ill be around till 4:30 EST. I will do my best to help you



I am EST also


Here's what I have so far:

CODE



DECLARE SUB GetData (Quarters, Dimes, Nickles, Pennies, Total)
DECLARE SUB DisplayInfo (Total)

'*** Coin translation ***

'*** This program requires the user to enter a  ***
'*** number of quarters, dimes, nickles, and    ***
'*** pennies, Then converts that information to ***
'*** a dollar amount.                           ***

CLS

'*** CALL GetData to Prompt user to enter needed data ***

CALL GetData(Quarters, Dimes, Nickles, Pennies, Total)

'*** CALL DisplayInfo to display dollar amount ***

CALL DisplayInfo(Total)




SUB DisplayInfo (Total)


PRINT
PRINT
PRINT "You have:", Total; "dollars",
PRINT
PRINT
PRINT




END SUB

SUB GetData (Quarters, Dimes, Nickles, Pennies, Total)

CLS
PRINT
INPUT "Enter the number of quarters:", Quarters
INPUT "Enter the number of dimes:", Dimes
INPUT "Enter the number of nickles:", Nickles
INPUT "Enter the number of pennies:", Pennies
PRINT
LET Total = (Quarters * 25) + (Dimes * 10) + (Nickles * 5) + (Pennies)
PRINT












END SUB







Holey hell???

Is this correct?? I get the right amount of dollars I think!!!!!!

All it seems to need now is an easy format$

OMG!!
User is offlineProfile CardPM
+Quote Post

Nykc
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:52 AM
Post #8

sudo rm -R /
Group Icon

Joined: 14 Sep, 2007
Posts: 4,152



Thanked: 16 times
Dream Kudos: 275
My Contributions
Looks ok, let me test it for you...

What are you compiling this in? I was trying with Just BASIC and it won't run because it doesnt like

SUB DisplayInfo (Total)

I am stepping through your code, it just looks like you will need to add the format$.

This post has been edited by Nykc: 11 Mar, 2008 - 11:55 AM
User is online!Profile CardPM
+Quote Post

StealthTools
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:52 AM
Post #9

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(Nykc @ 11 Mar, 2008 - 12:52 PM) *

Looks ok, let me test it for you...


K! smile.gif
User is offlineProfile CardPM
+Quote Post

StealthTools
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 11:58 AM
Post #10

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(StealthTools @ 11 Mar, 2008 - 12:52 PM) *

QUOTE(Nykc @ 11 Mar, 2008 - 12:52 PM) *

Looks ok, let me test it for you...


K! smile.gif



I am using QBASIC 7.1

And take a look at this?

CODE


DECLARE SUB GetData (Quarters, Dimes, Nickles, Pennies, Total)
DECLARE SUB DisplayInfo (Total)

'*** Coin translation ***

'*** This program requires the user to enter a  ***
'*** number of quarters, dimes, nickles, and    ***
'*** pennies, Then converts that information to ***
'*** a dollar amount.                           ***

CLS

'*** CALL GetData to Prompt user to enter needed data ***

CALL GetData(Quarters, Dimes, Nickles, Pennies, Total)

'*** CALL DisplayInfo to display dollar amount ***

CALL DisplayInfo(Total)

SUB DisplayInfo (Total)


PRINT
PRINT
PRINT USING Format$; "You have:"; Total; "dollars";
PRINT
PRINT
PRINT




END SUB

SUB GetData (Quarters, Dimes, Nickles, Pennies, Total)

CLS
PRINT
INPUT "Enter the number of quarters: ", Quarters
INPUT "Enter the number of dimes: ", Dimes
INPUT "Enter the number of nickles: ", Nickles
INPUT "Enter the number of pennies: ", Pennies
PRINT
LET Format$ = "$$###.##"
PRINT
LET Total = (Quarters * 25) + (Dimes * 10) + (Nickles * 5) + (Pennies)
PRINT













END SUB








Why won't this Format$ work? the program runs fine and then gets an error before calling the total dollar amount.


EDIT: Oh yea, If you logg onto Windows Live messenger I can send you my version of QBASIC 7.1

This post has been edited by StealthTools: 11 Mar, 2008 - 12:06 PM
User is offlineProfile CardPM
+Quote Post

Nykc
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 12:06 PM
Post #11

sudo rm -R /
Group Icon

Joined: 14 Sep, 2007
Posts: 4,152



Thanked: 16 times
Dream Kudos: 275
My Contributions
Well without access to the program I can't install that version at work try this and let me know.

CODE

CLS
PRINT
Format$ = "$$###.##"
PRINT
PRINT USING Format$; Total
END


In place of Let Format$

This post has been edited by Nykc: 11 Mar, 2008 - 12:07 PM
User is online!Profile CardPM
+Quote Post

StealthTools
RE: QBASIC NEED HELP WITH HOMEWORK PLEASE
11 Mar, 2008 - 12:09 PM
Post #12

New D.I.C Head
*

Joined: 11 Mar, 2008
Posts: 38


My Contributions
QUOTE(Nykc @ 11 Mar, 2008 - 01:06 PM) *

Well without access to the program I can't install that version at work try this and let me know.

CODE

CLS
PRINT
Format$ = "$$###.##"
PRINT
PRINT USING Format$; Total
END


In place of Let Format$


I am getting like $202.00.., lol - not displaying as single dollar amounts..

Quarters: 5
Dimes: 3
Nickles: 8
Pennies: 7

Should = $2.02

How do I get this to display like that?

This post has been edited by StealthTools: 11 Mar, 2008 - 12:15 PM
User is offlineProfile CardPM
+Quote Post

5 Pages V  1 2 3 > » 
Fast ReplyReply to this topicStart new topic
Time is now: 12/3/08 10:49PM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month