I am trying to create a program that displays shipping charges for two region codes. The region code has to have exactly 3 characters (the letter A or B followed by two numbers). Display a message if invalid region code is entered. use a sentinel value to exit program. shipping for region A is $25 and region B is $30

Here is what I have so far.
<code>
#include <iostream>
#include <string>
using namespace std;

int main()
{
string regionCode = "";

cout << "Please enter region code (-1 to exit): ";
getline(cin, regionCode);

while (regionCode != "-1")

if (regionCode.find('A', 0))
{
cout << "Shipping cost is $25" << endl;
}

else if (regionCode.find('B', 0));
{
cout << "Shipping cost is $30" << endl;
}
else if
{
cout << "Please enter a valid region code" << endl;
} //end if

cout << "Please enter region code (-1 to exit): ";
getline(cin, regionCode);

system("PAUSE");
return 0;
} //end of main function
</code>

2 answers

so, have you compiled and run it?
does it do the job?
It won't compile because it's saying the second "else if" isn't valid. I have tried changing things around and the best I can get is when I enter a value starting with"A" it returns nothing and a value starting with "B" returns and endless loop of $25, but it should be $30 and then wait for the user to enter a key to exit
Similar Questions
    1. answers icon 2 answers
  1. Using python write a program that does the following:•Create the logic for a program that calculates and displays the amount
    1. answers icon 0 answers
    1. answers icon 0 answers
  2. 00:00-06:5907:00-19:00 0.45 19:01-23:59 0.20 Write a program that asks for the starting time and the number of minutes of the
    1. answers icon 1 answer
more similar questions