Hi folks,,
I'm new here and having trouble to compile uppercase ....
and here is my code:
and this is the error knowing that I have Mingw as a compiler:
Please Help!!
I'm new here and having trouble to compile uppercase ....
and here is my code:
Code:
#include <iostream>
#include <string>
#include <iomanip>
#include <algorithm>
using std::cout;
using std::cin;
using std::endl;
using std::string;
using std::getline;
using std::fixed;
using std::setprecision;
using std::transform;
using namespace std;
int main()
{
//declaring a variable
string state="";
//getting the input
cout<<"Enter the State : "<<endl;
cin>>state;
//states=toupper(states);
transform(state.begin(), state.end(), state.begin(), toupper);
//determain the state that the user input
if (state=="HAWAII")
{
cout<<"The shipping charge for Hawaii is $30.00. "<<endl;
}//end if
else if (state=="OREGON")
{
cout<<"The shipping charge for Oregon is $30.00."<<endl;
}//end else if
else
{//end else
cout<<"Incorrect State..";
}
return 0;
}
Code:
----jGRASP exec: g++ -g C:\Users\Conan9\Desktop\ChargeStates.cpp C:\Users\ayman\Desktop\ChargeStates.cpp: In function `int main()': ChargeStates.cpp:29: error: no matching function for call to `transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unknown type>)' ChargeStates.cpp:46:2: warning: no newline at end of file ----jGRASP wedge2: exit code for process is 1. ----jGRASP: operation complete.
Please Help!!
Comment