So, my assignment is to write a program that puts a password input from the user through various tests and output its level of security. I've not had much training in this as my teacher doesn't really help much, and I'm supposed to do this over spring break.

#include <iostream>
#include <string>
bool is_even(string); //prototype

using namespace std;

int main()
	string password, verbose;
	int sec1, sec2;
	cout << "Passowrd Strength Checker!"<<endl;
	cout << endl;
	cout << "Enter the password to check: ";
	cin >>password;
	cout << "Enter the two security codes: ";
	cin >>sec1>>sec2;
	cout << "Verbose? (y/n) ";
	cin >>verbose;
	cout << "--------------------------------------"<<endl;
    return 0;

bool is_even(string password)
	if((password.size() >=8) && (password.size()<=14))
		return true;
		return false;

I'm using XCode on my Mac, and when I try to compile this it says that string wasn't declare in the scope and that bool is_even(string password) was redeclared as a different kind of symbol. I can't find an example of doing what exactly what I want to do. Basically, this part of the code needs to take the password from the user, and see that it's between 8 and 14 characters, and also even. Any help is very appreciated.

7 Years
Discussion Span
Last Post by vmanes
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.