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]
4 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]4 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
The cpu understands instructions written in a binary machine language. <br> a. true <br> b. false
Jet001 [13]

The CPU understands instructions written in a binary machine language: A. true.

<h3>What is a CPU?</h3>

CPU is an abbreviation for central processing unit and it can be defined as the main components of a computer because it acts as the “brain” of a computer and does all the processing, calculations, and logical control of the data entered through the keyboard into output that are displayed on the monitor.

This ultimately implies that, the central processing unit (CPU) performs most of the calculations, which enables a computer to function and is sometimes referred to as the “brain” of the computer.

Generally, the central processing unit (CPU) only understands instructions that are written in a binary machine language.

Read more on CPU here: brainly.com/question/5430107

#SPJ1

7 0
2 years ago
A(n) ___________________ process is initiated by individuals who are subjected to forensic techniques with the intention of hidi
dlinn [17]
A(n) anti-forensics process is initiated by individuals who are subjected to forensic techniques with the intention of hiding or obfuscating items or objects with evidentiary value.
4 0
3 years ago
In both direct flooding attacks and _____ the use of spoofed source addresses results in response packets being scattered across
Natali5045456 [20]

Answer:

SYN spoofing attacks.    

Explanation:

The Spoofing attack is used to access the personal information it is distributed the  viruses through infected links or file .The spoofing attacks has redistributed the traffic and the flow control in the denial-of-service attacks.

The SYN spoofing attacks is used the spoofed source in the result of giving response to packet The Spoofing attack  is distributed  across the Internet also it is detectable

6 0
3 years ago
___operating space means there is a restriction to the drivers line of sight
Harman [31]

Answer

Closed zone operating space means there is a restriction to the drivers line of sight

Explanation

The line of sight restriction to a driver or while driving is the visible path of travel from your vehicle to your targeted area towards your destination.It is also the area that's visible to a driver while driving.

Closed zone or condition means that there is a restriction to the drivers view or that the space is unavailable in a particular zone.

5 0
3 years ago
How can I find all the answers for the NWEA MAP Math, English, Reading, and Science tests? Please help!!!!! I found some answers
Gala2k [10]

Answer:

if its a test try to just do it on your own ,you got nothing to lose from a test, its just to understand what you know on the concepts, but if you would still like answers just search around the net or here and you can always post the questions to ask people for help someone would eventually answer your questions but then beware of bots that post links as answer!

Explanation:

6 0
3 years ago
Other questions:
  • In memory ads for DIMMs, you notice DDR 2400 CL15 in one ad and PC4 21300 CL9 in another. Which ad is advertising the faster mem
    12·1 answer
  • A ____ is a structure that allows repeated execution of a block of statements.
    13·2 answers
  • What inventor patented the first America movie projector
    13·2 answers
  • A _____________ is some text or data that is stored on your computer and used by a website to track how you use that site. quest
    8·2 answers
  • Please answer questions 34, 36 &amp; 37. <br><br>No explanation required. ​
    8·1 answer
  • Why do the holes at the top of parachutes make it go slower
    12·1 answer
  • What is pure carbon made of
    14·2 answers
  • Which camera required the photographer to project the image on paper
    9·2 answers
  • I WILL GIVS BRAINLIEST IF U ANSWER THIS
    9·1 answer
  • What is the purpose of a computer network needs assessment? to evaluate how to move from the current status to the desired goal
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!