This is my code for some reason i keep getting this error. \"No user-defined-con
ID: 3643399 • Letter: T
Question
This is my code for some reason i keep getting this error."No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called"
#include <iostream>
#include <string>
#include <algorithm>
using std::cout;
using std::cin;
using std::endl;
using std::string;
int main()
{
//declare variables
string state = "";
int shipCharge = 0;
const int Hawaii = 30;
const int Oregon = 30;
//enter input item
cout << "Enter the state name: ";
cin >> state;
getline(cin, state);
//assign shipping charge
if (state == "Hawaii")
{
cout << shipCharge << "Hawaii" << endl;
}
else if (state = "Oregon")
{
cout << shipCharge << "Oregon" << endl;
}
// end if
//display shipping charge
cout << "Shipping charge: " << shipCharge << endl;
return 0;
} //end of main function
Explanation / Answer
you have assigned the value 0 for the ship charge and dint change it as you go along the program
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.