Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multi Purpose Calculator
#3
You cannot multiply by decimals right now because you have declared a, b and c as integers. An integer is a whole number. If you notice, you only ever use up to four variables through your entire code. There's little reason to bother declaring separate variables for cases. Just declare four floats within the while loop (so they'll be flushed with each iteration) and use them as needed. If you know you're never going to add or subtract decimals then you could declare integers for those cases specifically. But realistically that's not something a calculator can assume.

I noticed you have a lot of redundancy in your coding. Specifically recalling the cout object numerous times for one output session. That's unnecessary. You also aren't returning a value at the end of the main function; you should be returning 0 for success.

http://diseasesf.pastebin.com/HNMastWg
Ho, ho, ho! Well, if it isn't fat stinking billy goat Billy Boy in poison!
How art thou, thou globby bottle of cheap, stinking chip oil?
Come and get one in the yarbles, if ya have any yarbles, you eunuch jelly thou!
Reply


Messages In This Thread
Multi Purpose Calculator - by Reality - 10-22-2010, 10:05 PM
RE: Multi Purpose Calculator - by Reality - 10-24-2010, 07:22 PM
RE: Multi Purpose Calculator - by Disease - 10-24-2010, 08:21 PM
RE: Multi Purpose Calculator - by Reality - 10-24-2010, 09:14 PM
RE: Multi Purpose Calculator - by Disease - 10-25-2010, 04:13 AM
RE: Multi Purpose Calculator - by Reality - 10-25-2010, 12:37 PM
RE: Multi Purpose Calculator - by Disease - 10-25-2010, 02:10 PM
RE: Multi Purpose Calculator - by Reality - 10-25-2010, 05:04 PM
RE: Multi Purpose Calculator - by Disease - 10-25-2010, 05:22 PM
RE: Multi Purpose Calculator - by Reality - 10-25-2010, 07:33 PM
RE: Multi Purpose Calculator - by haphazard - 10-27-2010, 07:04 PM
RE: Multi Purpose Calculator - by Hustler - 10-27-2010, 07:05 PM
RE: Multi Purpose Calculator - by Reality - 10-27-2010, 07:05 PM
RE: Multi Purpose Calculator - by Hustler - 10-27-2010, 07:11 PM
RE: Multi Purpose Calculator - by Reality - 10-27-2010, 07:25 PM
RE: Multi Purpose Calculator - by Disease - 10-27-2010, 07:23 PM
RE: Multi Purpose Calculator - by Arеs - 11-01-2010, 09:10 AM
RE: Multi Purpose Calculator - by Disease - 11-01-2010, 09:45 AM
RE: Multi Purpose Calculator - by Reality - 11-01-2010, 09:43 AM
RE: Multi Purpose Calculator - by Reality - 11-01-2010, 09:48 AM
RE: Multi Purpose Calculator - by Bursihido - 12-13-2010, 10:50 PM
RE: Multi Purpose Calculator - by Buzz Lightyear - 12-14-2010, 06:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  my own calculator WHITE PANDA 8 2,191 07-14-2010, 03:19 PM
Last Post: Kondry
  Calculator v1 Brainless Control 21 5,221 01-18-2010, 10:34 PM
Last Post: Equinøx
  Calculator in C Liberty 4 1,318 12-10-2009, 11:45 PM
Last Post: Sagittarius

Forum Jump:


Users browsing this thread: 28 Guest(s)