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
Tools used to build a bridge<br>​
Sati [7]

Aerial Lifts,

Vertical Masts and Hydro Platforms,

Telehandlers,

Excavators,

Skid Loaders,

Backhoes,

Cranes,

Air Compressors.

If It was helpful, can you make me brainliest please?

6 0
2 years ago
Save As .csv .html Worksheet tab Format Cells SUM Function Destination cell Home tab AutoFit A. Applies a border or shading to s
stiv31 [10]

Answer and Explanation:

A.) Format Cells

When the format cells in an Excel then, change an appearance of the number without the changing a number itself. Apply the number formats (0.7, $0.70, 70%, etc) or other formatting (alignments, fonts, borders, etc).

1. Enter a value 0.7 into the cell B2.

By default, the Excel use the General formats (no specific numbers format) for the numbers To apply the number format, use a 'Format Cell' dialog box.  

2. Then, Select the cell B2.

3. Then, Right click, then click the Format Cell (or press the shortcut key CTRL + 1).

The 'Format Cell' dialog box will appears.

4. Then, For example, if you want - select Currency.

Note: The Excel give you the life preview of how a number will formatted.

5. After that, Click OK.

The Cell B2 will still contain the number 0.7. Then you only changed an appearance of the number. Most frequently used a formatting command that are available on Home tab.

6. On Home tab, in a Number group, click percentage symbol to apply the Percentage formats.

7. On Home tab, in Alignment group, center a numbers.

8. On Home tab, in Font group, add the outside border and change the fonts color to the blue.

B). Destination cell

Destination area or Destination cell - A range of the cells that is select to hold a summarized data in the consolidations. The destination area or cell can be on same worksheets as source data or on the different worksheets. Worksheet can contains only the one consolidation.

C). Save As

If you want to save workbook with the different name use File then click on Save As dialog box or use a shortcut key (Alt + F2).

Then, Select a folder that you wants to store a workbook in using Save in the drop-down lists.

Then, Enters a new filename in the File name box at bottom.

D.) .html

Extension of the web page workbooks is .html.

E). SUM

The SUM function is the built in function in the excel which is used to add all the numbers in the range of the cells and returns its result.

F). Home Tab

A clipboard group is on far left side of a Home Tab. It is an often used in the conjunctions with Editing group, which is on far right side of the tab.

G.) .csv

CSV stands for Comma Separated Value.

CSV is the simple file format that is used to store a tabular datas, such as the spreadsheet or the database. A File in the CSV formats can be imported and exported from the programs that stores data in the tables, such as the Microsoft Excel or the OpenOffice Calc.

H). Worksheet tab

.

To Show the Sheet tabs settings is turned off.

Firstly, ensure that Show Sheet tab is enabled or not.

To do, all the other Excel version, click the File >then Options >then Advanced, in the under Display option for the workbook, then ensures that there is the check in a Show sheet tabs box.

I). AutoFit

J). Sum, Product, Power, Sqrt, Quotient, Mod and many others.

There are 300+ formulas in Excel.

5 0
3 years ago
A (n) _______________ is a dot or other symbol positioned at the beginning of a paragraph
larisa86 [58]

Answer:

Bullet

Explanation:

I've written a paragraph before. I should know!

3 0
3 years ago
Read 2 more answers
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
Marina86 [1]
The correct answer for this question is this one: "She can rename the 2 worksheet by right clicking the sheet tab. After right clicking the mouse, select Rename Sheet and type the preferred name of the sheet."  Hope this helps answer your question and have a nice day ahead.
5 0
3 years ago
Read 2 more answers
Difference between website and web server
Volgvan

Answer:

a web server is a computer than runs websites

7 0
3 years ago
Read 2 more answers
Other questions:
  • How does limiting a company's scope benefit the company? A. It encourages the company to use division of labor. B. It makes it e
    10·2 answers
  • Which of the following is a collection of honeypots used to present an attacker aneven more realistic attack environment?a. Padd
    6·1 answer
  • A router is a device that addresses a packet on a network to the next router along the line. Under which layer of the OSI model
    5·1 answer
  • To save a document with a new name, click _______ in the navigation bar and enter a new filename.
    12·1 answer
  • Match the limits of the user with an appropriate design response. 1. severe arthritis, unable to type or use a mouse on a reliab
    11·1 answer
  • Which of the following is not an advantage of concurrent design?
    10·2 answers
  • What do you call the destination router on the network endpoint?
    7·1 answer
  • which of the following elements should be included within a screenplay (select all that apply) anwser choices provided in the pi
    14·1 answer
  • How to be fluent in computer
    10·2 answers
  • What is the most appropriate data type for each of these items?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!