Answer:
it is i got in troble for playing it so much lol
Explanation:
sorry for the spelling
Answer:
Table for Area codes are not missing;
See Attachment for area codes and major city I used
This program will be implemented using c++ programming language.
// Comments are used for explanatory purposes
// Program starts here
#include <iostream>
using namespace std;
int main( )
{
// Declare Variable area_code
int area_code;
// Prompt response from user
cout<<Enter your area code: ";
cin<<"area_code;
// Start switch statement
switch (area_code) {
// Major city Albany has 1 area code: 229...
case 229:
cout<<"Albany\n";
break;
// Major city Atlanta has 4 area codes: 404, 470 678 and 770
case 404:
case 470:
case 678:
case 770:
cout<<"Atlanta\n";
break;
//Major city Columbus has 2 area code:706 and 762...
case 706:
case 762:
cout<<"Columbus\n";
break;
//Major city Macon has 1 area code: 478...
case 478:
cout<<"Macon\n";
break;
//Major city Savannah has 1 area code: 912..
case 912:
cout<<"Savannah\n";
break;
default:
cout<<"Area code not recognized\n";
}
return 0;
}
// End of Program
The syntax used for the above program is; om
That is false. are you doing it on a computer course. <span />
Answer:
#include <bits/stdc++.h>
using namespace std;
int main() {
string email,username,host;//strings to store email,username,hostname..
cout<<"Enter the email address "<<endl;
cin>>email;//taking input of email address..
bool flag=1;
for(int i=0;i<email.length();i++)//iterating over the string email..
{
if(email[i]=='@')//if @ symbol is encountered make flag 0 skip this iteration.
{
flag=0;
continue;
}
if(flag==1)//add to username if flag is 1.
{
username+=email[i];
}
else//add tom host..
host+=email[i];
}
cout<<"The username is "<<username<<endl<<"The host name is "<<host;//printing the username and hostname..
return 0;
}
Explanation:
I have taken three strings to store the email address entered by user ,username and host to store username and host name respectively.Then I am iterating over the string email if @ is encountered then skip that iteration before that keep adding characters to username string and after that keep adding characters to host.