|
Recruit
Join Date: Feb 2007
Posts: 18
|
after making the changes:
#include <iostream>
using std:: cout;
using std:: cin;
using std:: endl;
int main()
{
//declare variables
int DOLLARS = 0.0;
int QUARTERS = 0.0;
int DIMES = 0.0;
int NICKELS = 0.0;
int PENNIES = 0.0;
//enter input items
cout << "Enter amount due: ";
cin >> amountDue;
cout << "Enter amount paid: ";
cin >> amountPaid;
//calculate change amount
QUARTERS = (dollars * 1) /.25 ;
DIMES = (changeAmount - (dollars * 1) - (quarters * .25) / .1 );
NICKELS = (changeAmount - (dollars * 1) - (quarters* .25) - (dimes* .1) / .05) ;
PENNIES = (changeAmount - (dollars * 1) - (quarters * .25) - (dimes * .1) - (nickels * .05)/.01) ;
//display change amount
cout << "dollars: " << Dollars << endl;
cout << "quarters: " << Quarters << endl;
cout << "dimes: " << Dimes << endl;
cout << "nickels: " << Nickels << endl;
cout << "pennies: " <<Pennies<< endl;
return 0;
//end of main function
}
these are the errors I 'm being given:
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(24): error C2065: 'amountDue' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(26): error C2065: 'amountPaid' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(32): error C2065: 'dimes' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(39): error C2065: 'Dimes' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(37): error C2065: 'Dollars' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(33): error C2065: 'nickels' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(40): error C2065: 'Nickels' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(41): error C2065: 'Pennies' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(31): error C2065: 'quarters' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(38): error C2065: 'Quarters' : undeclared identifier
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(39): error C2593: 'operator <<' is ambiguous
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(434): could be 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits>::_Mysb *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(414): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(38): error C2593: 'operator <<' is ambiguous
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(434): could be 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits>::_Mysb *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(414): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(41): error C2593: 'operator <<' is ambiguous
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(434): could be 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits>::_Mysb *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(414): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(394): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(long double)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(37): error C2593: 'operator <<' is ambiguous
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(434): could be 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits>::_Mysb *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(414): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(394): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(long double)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(374): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(double)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(354): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(float)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(333): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned __int64)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(313): or 'std::bas
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(40): error C2593: 'operator <<' is ambiguous
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(434): could be 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(std::basic_ostream<_Elem,_Traits>::_Mysb *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(414): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(const void *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(394): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(long double)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(374): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(double)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(354): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(float)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(333): or 'std::basic_ostream<_Elem,_Traits>::_Myt &std::basic_ostream<_Elem,_Traits>::operator <<(unsigned __int64)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\ostream(313): or 'std::bas
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(24): error C2593: 'operator >>' is ambiguous
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(413): could be 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_istream<_Elem,_Traits>::_Mysb *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(394): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(void *& )'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(376): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(long double &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(358): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(double &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(26): error C2593: 'operator >>' is ambiguous
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(413): could be 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(std::basic_istream<_Elem,_Traits>::_Mysb *)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(394): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(void *& )'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(376): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(long double &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(358): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(double &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(339): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(float &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(320): or 'std::basic_istream<_Elem,_Traits>::_Myt &std::basic_istream<_Elem,_Traits>::operator >>(unsigned __int64 &)'
with
[
_Elem=char,
_Traits=std::char_traits<char>
]
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\istream(301): or 'std:
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(33): error C3861: 'changeAmount': identifier not found, even with argument-dependent lookup
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(32): error C3861: 'changeAmount': identifier not found, even with argument-dependent lookup
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(33): error C3861: 'dimes': identifier not found, even with argument-dependent lookup
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(33): error C3861: 'dimes': identifier not found, even with argument-dependent lookup
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(33): error C3861: 'dollars': identifier not found, even with argument-dependent lookup
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(31): error C3861: 'dollars': identifier not found, even with argument-dependent lookup
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(32): error C3861: 'quarters': identifier not found, even with argument-dependent lookup
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(17): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(18): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(20): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(19): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(16): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
c:\Course Technology\21711-1\Cpp\Chap04\Ch4AppE10 Solution\Ch4AppE10 Project\Ch4AppE10.cpp(19): warning C4244: 'initializing' : conversion from 'double' to 'int', possible loss of data
These are the errors when I run the program how do I correct these errors I'm new to all this and I really can use the help.
|