-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmain.cpp
More file actions
68 lines (58 loc) · 1.75 KB
/
Copy pathmain.cpp
File metadata and controls
68 lines (58 loc) · 1.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <iostream>
#include <string>
#include <cctype>
using namespace std;
bool isemail(string const& address) //testing for @
{
size_t at_index = address.find_first_of('@', 0);
return at_index != string::npos;
}
bool isdot(std::string const& address)// testing for the dot
{
size_t at_in = address.find_first_of('.', 0);
return at_in != string::npos;
}
int main()
{
string first, last, adress, a, s, p, e; //Input String Types
cout<<"Welcome To Extreme Gamers Registration System."<<endl;
cout<<"Please Notice That All Questions Have To Be Answered."<<endl;
cout<<"1.Your First Name?"<<endl; //Asking Questions 1-5
cin>>first;
cout<<""<<endl;
cout<<"2.Your Last Name?"<<endl;
cin>>last;
cout<<""<<endl;
cout<<"3.Type Your Age?"<<endl;
cin>>a;
cout<<""<<endl;
if(a>"18"){
cout<<"Sorry "<<first <<", Only Kids Can Access To This System"<<endl;
}
if(a<="18"){
cout<<"4.Your Phone Number?"<<endl;
cin>>p;
cout<<""<<endl;
cout << "5.Type your email address\n";
cin >> address;
cout<<""<<endl;
if (!isemail(address)) //Print Missing Symbol @
{
cout << "Missing @ symbol\n";
}
else if (!isdot(address))
{
cout << "Missing . symbol after @\n"; //Print Missing . Symbol After @
}
else
{
cout << "Email accepted.\n"; //Print Email Accepted
cout<<""<<endl;
cout<<"Thank You For Using Our Service"<<endl<<endl;
cout<<"You Are Successfully Registered To Coding For Fun 2020 Competition. You Will Get Your Confirmation Email Soon"<<endl<<endl;
cout<<"See You Soon "<<first<<"!!"<<endl; //Last Greetings
}
//End Of The Program
return 0;
}
}