944,165 Members | Top Members by Rank

Ad:
  • C++ Discussion Thread
  • Unsolved
  • Views: 832
  • C++ RSS
Oct 7th, 2009
0

Could not deduce template argument...

Expand Post »
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


C++ Syntax (Toggle Plain Text)
  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. }
Similar Threads
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
Ponomous is offline Offline
80 posts
since Oct 2009
Oct 7th, 2009
1
Re: Could not deduce template argument...
there is a lot of logic errors, but this one is a compile time error :
C++ Syntax (Toggle Plain Text)
  1. cin << yesorno;

you mean cin >> yesorno , right.
Reputation Points: 840
Solved Threads: 594
Senior Poster
firstPerson is offline Offline
3,865 posts
since Dec 2008
Oct 7th, 2009
0
Re: Could not deduce template argument...
haha woopse definitely flip flopped those by accident, thanks
Reputation Points: 10
Solved Threads: 1
Junior Poster in Training
Ponomous is offline Offline
80 posts
since Oct 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C++ Forum Timeline: vector <bool> and displaying elements
Next Thread in C++ Forum Timeline: Deleted memory still accessible?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC