Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 10-27-2004, 03:51 PM   #1 (permalink)
verdell32
Registered User
 
verdell32's Avatar
 
Join Date: Oct 2004
Posts: 35
verdell32 is on a distinguished road
Change cpp here's the code again

We are learning in Borland C++ 5 so I am trying to teach myself at the same time in Visual C++.NET 2003.


Write a program that inputs the amount of a sale and an amount tendered by a customer. The program should then calculate the total amount of change due and display the same. Then the program should calculate the individual bills and coins that would be used to give change back to a customer.

Sample output: Another example:

Amount tendered : $50.00 Amount tendered : $200.00
Amount of sale : $12.13 Amount of sale : $121.62
Your total change: $37.87 Your total change: $ 78.38
--------------------------------- -----------------------------------
$50 0 1 fifty
$20 1 1 twenty
$10 1 0 tens
$ 5 1 1 five
$ 1 2 3 ones
50¢ 1 0 half dollars
25¢ 1 1 quarter
10¢ 1 1 dime
5¢ 0 0 nickels
1¢ 2 3 pennies

Thanks for all your help.

Last edited by verdell32; 10-29-2004 at 11:37 AM. Reason: update
verdell32 is offline   Reply With Quote
Old 10-27-2004, 04:20 PM   #2 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,487
sde is on a distinguished road
lol not again
__________________
Mike
sde is offline   Reply With Quote
Old 10-27-2004, 06:11 PM   #3 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,487
sde is on a distinguished road
i'm confused, was this supposed to be a response to another thread? or is there really no question your asking? .. you are more likely get a response if you post where you are so far, and asking specific questions. no one is just going to do your homework as you post it.
__________________
Mike
sde is offline   Reply With Quote
Old 10-27-2004, 07:33 PM   #4 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Wait a minute.

Verdell, get back to your first thread. Analize it.
Then go the coins change thread and analize the two solutions I gave. See if there is a logic behind all this.
Here are your references:

DATE POST

MONEY POST
__________________
Valmont is offline   Reply With Quote
Old 10-27-2004, 08:03 PM   #5 (permalink)
sde
Moderator
 
sde's Avatar
 
Join Date: May 2002
Location: us.ca
Posts: 4,487
sde is on a distinguished road
lol, that's what i was afraid of after my first post .. it looked like there was already something going on. heh
__________________
Mike
sde is offline   Reply With Quote
Old 10-29-2004, 03:09 AM   #6 (permalink)
Valmont
[code][/code] enforcer
 
Valmont's Avatar
 
Join Date: Mar 2003
Location: Netherlands
Posts: 1,544
Valmont is on a distinguished road
Verdell32, why did you edit your original post? That wasn't nessecery at all. I think you misinterpreted the replies in here.

You should have clicked on those two links I gave you. You would have found three complete apps that almost do exactly as you wanted. All you needed to do is to experiment with them -and to look at them closely- to see that your specific money problem has been solved in an earlier post.

Basically all you needed to add is one extra substraction:
Money - Cost = ToChangeMoney.
After that, you could have unleashed the algorithms in those threads on ToChangeMoney.

Quote:
Everbody has a different learning curve maybe I don't catch on as fast ...
That is of no relevance to me. Only hard work is what I am interested in. In that case I am infinite patient. If a student needs it, I'll stay up to GMT time (CET around here), or miss my weekend.
Post your problem once again, and I'll work on it. We are not as bad we look in my fantasy .
__________________
Valmont is offline   Reply With Quote
Old 10-29-2004, 05:03 AM   #7 (permalink)
verdell32
Registered User
 
verdell32's Avatar
 
Join Date: Oct 2004
Posts: 35
verdell32 is on a distinguished road
Change.cpp

I apologize that I did misinterpet your messages; I thought you were trying to be funny when you told me to go look at the other ones, I guess a part of mis-communication. I am currently at school right now and I will post my information again. I am trying to learn as much as I can; while I am taking this first C++ course; I am learning on my own Visual basic.NET. I really do appreciate all your help.

Have a blessed day.
verdell32 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -8. The time now is 10:21 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting