473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Beginner Help...

I have been trying to write a program, but it isn't working! I have to calculate money in dollars, quaters, nickels, dimes and pennies. I've been working on it for more then a week and it just isn't working.
Mar 13 '08 #1
2 1091
Banfa
9,065 Expert Mod 8TB
I'm pretty certain the problem is at line 17 of you code.


I may be wrong of course, you could try posting it then we would know for sure.
Mar 13 '08 #2
weaknessforcats
9,208 Expert Mod 8TB
I expect it's because you are using floating point (because of the handy decimal) and are suffering from rounding error.

Finance applications shoulod use integers and you should keep your amounts in pennies.

An integer containing 123 can always be display as $1.23 by your display function. You don't need the decimal point at all in the code until you print your data.
Mar 13 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Art | last post by:
NEWBIE ALERT! Esteemed List Participants and Lurkers: (System: P-II 350, 192 meg, Win98 SE, Python 2.2.3, wxPythonWIN32-2.4.1.2-Py22.exe) I'm having a lot of fun getting started with Python...
3
by: jvax | last post by:
Hi all, I hope I'm posting in the right NG... I have a data text file I want to read from a c++ program. the data file goes like this: 90 # number of balls 33 42 13
8
by: Grrrbau | last post by:
I'm a beginner. I'm looking for a good C++ book. Someone told me about Lafore's "Object-Oriented Programming in C++". What do you think? Grrrbau
1
by: LRW | last post by:
I was wondering if anyone could recommend some good beginner sites and tutorial sites for writting ASP.Net pages in C#. Things that especially help with datagrids!! And, are there additional...
14
by: z_learning_tester | last post by:
But I can't seem to find the answer. The question is how do you reverse the words in a string? Or how do you reverse the numbers listed in a string? The example is usually something like: Turn...
3
by: William Foster | last post by:
Good evening all, Microsoft is really starting to annoy me as a new user. I am trying to convert my code from VBA (A very user friendly laguage with generally good help files) to Visual Studio...
10
by: See_Red_Run | last post by:
Hi, I am trying to figure out how to get started with PHP/MySQL. Everything I've read so far says to start with PHP first. I was expecting something like Visual Basic Express or some other type...
1
by: Blue_hatter | last post by:
Hey Guys, I'm a newbie to the whole C++ Programming thing as I think I said before in a post. The thing is, I have this idea that might help me to learn at a better pace than I am doing currently....
10
by: hamza612 | last post by:
I want to start learning how to program. But I dont know where to start. From what I've heard so far c++ is not a good lang. to learn as a beginner because its very complicated compared to others...
22
by: ddg_linux | last post by:
I have been reading about and doing a lot of php code examples from books but now I find myself wanting to do something practical with some of the skills that I have learned. I am a beginner php...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.