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 05-05-2006, 02:52 PM   #1 (permalink)
verdell32
Registered User
 
verdell32's Avatar
 
Join Date: Oct 2004
Posts: 35
verdell32 is on a distinguished road
Visual Logic(Visual Designer) question

I am working on a project and I can't understand how you can use one input to calculate change.

Here is the question:
Correct Change. Write a program to assist a cashier with determining correct change. The program should have one input, the number of coins to return to the customer. The output should be the appropriate change in quarters, dimes, nickels and cents. Hint. Consider how integer division (\) and integer remainder (Mod) can be used as part of your solution.

I don't see how you can do it without two inputs like: amountTendered - amountOfSale?

And also we are using IF Conditions.
verdell32 is offline   Reply With Quote
Old 11-22-2006, 07:33 AM   #2 (permalink)
toe_cutter
Code Monkey
 
Join Date: Aug 2002
Location: Boston, MA
Posts: 79
toe_cutter is on a distinguished road
Send a message via ICQ to toe_cutter Send a message via AIM to toe_cutter Send a message via Yahoo to toe_cutter
You only need to know the amount change the cashier will hand back. I normally would say not to hard code any value like this, but for this example I would say hard code the change.

You would have a value like change=78 (hard coded), and then the input would be how many coins to return. Obviously there is a minimum number of coins they can choose, and a maximum as well. Maximum would be 78 in this case all pennies, and the minimum would be 6 (3 quarters and 3 pennies). Any thing above 78 or below 6 would be and error.
__________________
toe_cutter 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
anyone know a lot? question concerns php also. Rotkiv HTML, XML, Javascript, AJAX 7 01-12-2006 12:09 PM
help with visual studio .net scavanau Platform/API C++ 4 08-02-2005 07:27 AM
Question about the output window 357mag Standard C, C++ 5 04-20-2005 01:48 PM
A question about Visual C++.Net 357mag Standard C, C++ 1 03-30-2005 05:01 AM
Visual C++ command-line work-around? Hosiah Platform/API C++ 1 07-17-2004 01:00 AM


All times are GMT -8. The time now is 09:16 PM.


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