#include <iostream>
#include <cstdio>
#include <cstdlib>
usingnamespace std;
int main (int nNumberofArgs, char* pszArgs[])
{
// This part will make all the int
int nYear = 0;
int nHigh = 0;
int nWeight = 0;
//BETA LOCK
int ncode = 0;
cout << "THIS IS A CLOSED BETA PLEASE ENTER A PASSWORD TO CONTINUE: ";
cin >> ncode;
if (ncode = 0000)
{
cout << "Access Granded" << endl;
//This part starts the game
cout << "Hello and Welcome to HOT OR NOT console edition" << endl;
cout << "I am your host GLADOS , and here are out judege's" << endl;
cout << "Host #1 : CYLIAN , Host #2 : Adrian and Host #3 : MAKSYMILIAN" << endl;
cout << "Lets START THE SHOW !!!! " << endl;
system ("PAUSE");
//This part asks the user for DOB HIGHT AND WEIGHT
cout << "L" << endl;
cout << "o" << endl;
cout << "a" << endl;
cout << "d" << endl;
cout << "i" << endl;
cout << "n" << endl;
cout << "g" << endl;
cout << "." << endl;
cout << "." << endl;
cout << "." << endl;
system ("PAUSE");
cout << "Please enter Your YEAR of birth: ";
cin >> nYear;
cout << "Please enter you hight in cm : ";
cin >> nHigh;
cout << "And finnaly enter your Weight in kg : ";
cin >> nWeight;
//This part will calculate is the user HOT OR NOT
cout << "Calculating Please Wait" << endl;
if ( ( nYear > 1980 ) && ( nHigh > 190 ) && ( nWeight >= 80 ) )
{
cout << "You are HOT" << endl;
}
else
{
cout << "You are not hot" << endl;
}
}
else
{
cout << "Incorrect";
}
system ("PAUSE");
return 0;
}
The Bold is the part of the code i hav a problem with
so if i input the code 0000 the game starts but if i input the wrong code the game starts aswell , any sugestions ?
Notice that numbers starting with 0 in C++ are read as octal numbers, not decimal. Because it's zero, that wouldn't make any difference in this case, but if you're working with decimal numbers, make a habit of not using leading zeros.