I have to create a program that requires the user to enter the zip code. The zip code must be 5 digits. I know how to do that using if statement and string.length(). What I don't know how to do is how to make sure the program only inputs and accepts zip codes that start with 606 and 605.
Here's my code so far
#include <iostream>
#include <string>
using namespace std;
int main()
{
cout << "Please enter zip code: ";
string = zipCode;
getline(cin,zipCode);
if (zipCode.length() == 5 && )
{
}
else
cout << "Please enter a 5 digit Zip Code ";
I have to use a string function