1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
lyudmila [28]
3 years ago
13

Write a code segment that takes an emailaddress stored in the string email and stores theuser name in the string user and the ho

staddress in the string host. Remember that the user name and host address are separated by thecharacter @.
Computers and Technology
1 answer:
iragen [17]3 years ago
8 0

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.

You might be interested in
We have a user Sally Smith who we want to grant the ability to launch applications and browse folders. But we do not want her to
igomit [66]

Answer:

LIST

Explanation:

NTFS is A proprietary journaling file system developed by Microsoft. It started with windows 3.1.

List Folder Contents: Is what Gives authorized user the permission to viewing and listing of files and sub-folders as well as executing of files inherited by folders only.

NTFS permissions applies to every file and folder stored on a volume formatted with the NTFS file system. By default, permissions are inherited from a root folder to the files and sub-folders beneath it, although this inheritance can be disabled.

List Folder Contents will allow you to display the folder's contents and to display the data, attributes, owner, and permissions for files within the folder.

The NTFS permission that applies to the Domain Users group that will allow Sally to do what he wants without allowing more access than necessary is LIST.

8 0
3 years ago
You want to implement a mechanism that automates ip configuration, including ip address, subnet mask, default gateway, and dns i
telo118 [61]
You're probably looking for DHCP (Dynamic Host Configuration Protocol).
5 0
2 years ago
What is a tax exemption (also known as a tax allowance)?
KengaRu [80]
<span>Tax exemption refers to a monetary exemption which reduces taxable income. Tax exempt status can provide complete relief from taxes, reduced rates, or tax on only a portion of items.</span>
4 0
2 years ago
Which type of operating system requires a keyboard in order to issue commands?
kicyunya [14]

Answer:

I said CLI.

Explanation:

''A command-line interface (CLI) processes commands to a computer program in the form of lines of text.''- Wikipedia

4 0
3 years ago
6. Choose the TWO conditions that could be used for an IF-statement, without a compile-time error. Assume variable str is a Stri
KengaRu [80]

Answer:

  1. 4 ==5
  2. "six"== 6

Explanation:

3 0
3 years ago
Other questions:
  • Which expense is a bank least likely to extend a line of credit for?
    13·2 answers
  • What is one disadvantage of accessing the Internet through a public search engine such as Google or Yahoo?
    10·2 answers
  • The ____ command displays the last 10 lines of a text file.
    5·1 answer
  • Which actions should be taken so that transitions proceed automatically? Check all that apply.
    12·2 answers
  • Help giving points mark BRAINLEST
    5·1 answer
  • Who here would like to play among us with me? <br> Time: Friday, November 13
    14·1 answer
  • Which are examples of types of audio media that can support a presentation? Check all that apply.
    14·2 answers
  • Define the term visual as used in visual programming
    9·1 answer
  • A local pizza shop is selling a large pizza for $9.99. Given the number of pizzas to order as input, output the subtotal for the
    12·1 answer
  • Differenciate between foreign key and primary key in database.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!