Cash Register Application

Please support our Java advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jan 2005
Posts: 20
Reputation: bcheath_1 is an unknown quantity at this point 
Solved Threads: 1
bcheath_1's Avatar
bcheath_1 bcheath_1 is offline Offline
Newbie Poster

Cash Register Application

 
0
  #1
Jan 30th, 2005
I have attached my current source code to this message. It is in .java format.

Here is a brief description of my problem:

I have a program which accepts input for a Purchase Price, an Amount Tendered, and then displays the Change Due. Also, it must display the number of dollars, quarters, dimes, nickels, and pennies. The input is complete and I can calculate the Change Due, but I cannot figure out how to calculate each piece of change individually.

Note: The output is not in the code, but I know how to properly write it, so I won't need any help with output

Thanks in advance for any help:


Also, here is the look my application is to have:

Purchase Price: $ ________ (completed)
Amount Tendered: $ ________ (completed)

Your change is: $ ________ (completed)

__ one dollar bill (s)
__ quarter (s)
__ dimes (s)
__ nickel (s)
__ penn (y/ies)


Thank you for your business. Come back soon. (completed)
Attached Files
File Type: java Exercise3_24.java (2.2 KB, 199 views)
Reply With Quote Quick reply to this message  
Join Date: Jun 2004
Posts: 2,108
Reputation: server_crash is on a distinguished road 
Solved Threads: 18
server_crash server_crash is offline Offline
Postaholic

Re: Cash Register Application

 
0
  #2
Jan 30th, 2005
How come you prompt the user for amount in pennies?
Reply With Quote Quick reply to this message  
Join Date: Jan 2005
Posts: 20
Reputation: bcheath_1 is an unknown quantity at this point 
Solved Threads: 1
bcheath_1's Avatar
bcheath_1 bcheath_1 is offline Offline
Newbie Poster

Re: Cash Register Application

 
0
  #3
Jan 30th, 2005
Well as you can see in the problem message in the source code, it is required. This is a homework assignment, so I have to do what the instructor says. I hope that explanation helps.
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Cash Register Application

 
0
  #4
Jan 31st, 2005
So all you need to do is find out how to most efficiently give change?

How do you determine what combination of coins and bills to use in a store? All you have to do is put that reasoning into code.

Say you give $1.26 in change.
How many dollars is that?
When those are gone, how many quarters are there in the leftover amount?
etc. etc. etc.

It's not hard.
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 46
Reputation: Gink is an unknown quantity at this point 
Solved Threads: 0
Gink Gink is offline Offline
Light Poster

Re: Cash Register Application

 
0
  #5
Feb 1st, 2005
nested loops
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 213
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: Cash Register Application

 
0
  #6
Feb 1st, 2005
recursive function would be my choice. Far cleaner.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 7
Reputation: fiberoptik is an unknown quantity at this point 
Solved Threads: 0
fiberoptik fiberoptik is offline Offline
Newbie Poster

Re: Cash Register Application

 
0
  #7
Sep 21st, 2005
I have to do the same basic problem. My prof. said to use integer division & modulus to find the amount for each coin in nested if loops. How to write it is the next big headache.
Reply With Quote Quick reply to this message  
Join Date: Mar 2005
Posts: 7
Reputation: fiberoptik is an unknown quantity at this point 
Solved Threads: 0
fiberoptik fiberoptik is offline Offline
Newbie Poster

Re: Cash Register Application

 
0
  #8
Sep 21st, 2005
I have to do the same basic problem. My prof. said to use integer division & modulus to find the amount for each coin in nested if loops. How to write it is the next big headache.We're to specify if the coin is singular/plural also.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 1
Reputation: cdpothen is an unknown quantity at this point 
Solved Threads: 0
cdpothen cdpothen is offline Offline
Newbie Poster

Re: Cash Register Application

 
0
  #9
Sep 29th, 2005
I tried working on this and this was my solution. Not very great maybe, i hope its of use to you
Attached Files
File Type: java assignment help.java (5.9 KB, 158 views)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC