Witam !
Napisałem kilka minut temu program, który "rejestruje" nowego użytkownika.
Czy kod jest poprawnie napisany i zrefaktoryzowany ?
Proszę o odpowiedź :)
Pozdrawiam !
#include <iostream>
#include <windows.h>
#include <stdio.h>
#include <time.h>
#include <cstdlib>
using namespace std;
string name, name2, log, pasw, pasw2, email;
int code, usercode;
int main()
{
cout<<"Zarejestruj sie!";
getchar();
system("cls");
cout<<endl<<"Imie : ";
getline(cin,name);
system("cls");
cout<<endl<<"Nazwisko : ";
getline(cin,name2);
system("cls");
cout<<endl<<"Nazwa Uzytkownika : ";
getline(cin,log);
system("cls");
do
{
cout<<endl<<"Haslo : ";
getline(cin,pasw);
cout<<endl<<"Powtorz haslo : ";
getline(cin,pasw2);
if(pasw==pasw2)
{
continue;
}
else
{
system("cls");
cout<<"Podane hasla sie nie zgadzaja...";
getchar();getchar();
}
system("cls");
}while(pasw!=pasw2);
system("cls");
cout<<endl<<"E-mail : ";
getline(cin,email);
system("cls");
do
{
srand(time(NULL));
code=rand()%900;
cout<<endl<<"Przepisz kod weryfikacyjny : "<<code<<endl;
cin>>usercode;
if(code==usercode)
{
continue;
}
else
{
system("cls");
cout<<"Podany kod jest nieprawidlowy...";
getchar();getchar();
}
system("cls");
}while(code!=usercode);
system("cls");
cout<<"KONTO ZOSTALO POMYSLNIE ZALOZONE !"<<endl<<endl;
cout<<"PODSUMOWANIE OPERACJI :"<<endl;
cout<<"Imie : "<<name<<endl;
cout<<"Nazwisko : "<<name2<<endl;
cout<<"Login : "<<log<<endl;
cout<<"Haslo : "<<pasw<<endl;
cout<<"E-mail : "<<email<<endl<<endl;
cout<<"Dziekujemy za rejestracje !";
getchar();getchar();
return 0;
}