Could not deduce template argument...

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2009
Posts: 43
Reputation: Ponomous is an unknown quantity at this point 
Solved Threads: 0
Ponomous Ponomous is offline Offline
Light Poster

Could not deduce template argument...

 
0
  #1
Oct 7th, 2009
So I am trying to write a program that will give creditcard balance information and it is aparent when I compile that there is some sort of error ( error c2784 ). I think that I might not be including something that I need but I am not sure what it is. Everything else seems to be fine but I cant figure this out for the life of me. Any ideas?

Thanks


  1.  
  2. # include <iostream>
  3. # include <fstream>
  4. # include <cstdlib>
  5. # include <string>
  6. # include <cmath>
  7.  
  8. using namespace std;
  9.  
  10. int main ()
  11. {
  12.  
  13.  
  14. double balance, interest, minpayment;
  15.  
  16. int month(0);
  17.  
  18. cout << " Enter your account balance: " << endl;
  19. cin >> balance;
  20.  
  21.  
  22. do
  23. {
  24.  
  25. if (balance <= 1000)
  26. {
  27. interest = balance * .015;
  28. balance = balance * 1.015;
  29. }
  30. else
  31. {
  32.  
  33. interest = balance * .01;
  34. balance = balance * 1.01;
  35.  
  36. }
  37.  
  38.  
  39. if (balance <= 10)
  40. {
  41. minpayment = balance;
  42.  
  43. }
  44.  
  45. else if (balance * .1 < 10)
  46. {
  47. minpayment = 10;
  48.  
  49. }
  50.  
  51. else
  52. {
  53. minpayment = balance * .1;
  54. }
  55.  
  56.  
  57.  
  58. month = month++;
  59.  
  60.  
  61.  
  62.  
  63.  
  64. cout << " Month " << month << endl;
  65. cout << " Interest is: " << interest << endl;
  66. cout << " Account balance is: " << balance << endl;
  67. cout << " Minimum payment is: " << minpayment << endl;
  68.  
  69.  
  70.  
  71. cout >> " Would you like to see the next months figures? Y/y or N/n " << endl;
  72. char yesorno;
  73. cin << yesorno;
  74.  
  75. }
  76.  
  77. while (yesorno == y);
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84.  
  85.  
  86. return(0);
  87.  
  88. }
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 1,176
Reputation: firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice firstPerson is just really nice 
Solved Threads: 147
firstPerson's Avatar
firstPerson firstPerson is online now Online
Veteran Poster
 
1
  #2
Oct 7th, 2009
there is a lot of logic errors, but this one is a compile time error :
  1. cin << yesorno;

you mean cin >> yesorno , right.
I give up! 
1) What word becomes shorter if you add a letter to it? [ Solved by : niek_e ]
2) What does this sequence  equal to :  (.5u - .5a)(.5u-.5b)(.5u-.5c) ...
3) What is the 123456789 prime numer?
Ask4Answer
Reply With Quote Quick reply to this message  
Join Date: Oct 2009
Posts: 43
Reputation: Ponomous is an unknown quantity at this point 
Solved Threads: 0
Ponomous Ponomous is offline Offline
Light Poster
 
0
  #3
Oct 7th, 2009
haha woopse definitely flip flopped those by accident, thanks
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC