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
AnnyKZ [126]
3 years ago
10

A String variable, fullName, contains a name in one of two formats:last name, first name (comma followed by a blank), orfirst na

me last name (single blank)Extract the first name into the String variable firstName and the last name into the String variable lastName. Assume the variables have been declared and fullName already initialized. You may also declare any other necessary variables.
Computers and Technology
1 answer:
Volgvan3 years ago
8 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   char fullname[30];

   string fname="",lname="";

   int i,j;

   cout<<"Enter fullname\n";

   cin.getline(fullname,30); //so that blank can be read

   for(i=0;fullname[i]!=' ';i++)

       fname+=fullname[i];   //fistname will be saved

      cout<<"\n";

   for(j=i;fullname[j]!='\0';j++)

       lname+=fullname[j];    //lastname will be saved

   cout<<"\nFirstname : "<<fname<<"\nLastname : "<<lname;

   return 0;

}

OUTPUT :

Enter fullname

John thomson

Firstname : John

Lastname : thomson

Explanation:

cin.getline() should be used instead of cin in case of strings so that space can be read otherwise after blank string will be ignored.

You might be interested in
Why a management-focused program provides a more appropriate learning path for you than a program based heavily on technical con
AlekseyPX
The program makes more money
3 0
3 years ago
A Pool charges $4 each visit,or you can buy a membership. Write and solve an inequality to find how many times a person should u
MAXImum [283]
$4 x number of visits (V)> price of membership (M)
V > M/4
8 0
3 years ago
What is the promotion and advertising stage of a product or service called?
Eddi Din [679]

Answer:

Marketing

Explanation:

8 0
3 years ago
Tightly.
Radda [10]

Answer:

AG 6.

AG 1.

AG 3.

AG 4.

AG 7.

AG 5.

AG 2.

Explanation:

Chronology can be defined as an arrangement of data, items or documents in the order in which they occurred or happened (in time), from the earliest to the most recent or latest.

Simply stated, ordered events are organized in order of time and this process is known as chronology.

Generally, a chronology can be used as a filing process in various areas such as schools, hospitals, hotels, and business firms to help put data (informations) in order by time or date.

In Computer networking, a cable can be defined as a wired connector used for connecting and transmitting signals between two or more network devices such as CAT-5, CAT-6 and fiber optic cables. These cables which are either twisted or untwisted pair are to be crimped in order to make them eligible and appropriate for use in connecting network devices.

Furthermore, there are two (2) color codes used for the arrangement of the wires in a network cable based on the type of network connection;

I. For straight-through, host device to a router or switch;

Color code: white-orange, orange, white-green, blue, white-blue, green, white-brown, brown.

II. For cross-over, network device to a network device e.g router or router;

white-green, green, white-orange, blue, white-blue, orange,

5 0
2 years ago
Write a program that asks the user to enter a number of seconds and then printsthe same amount of time in days, hours, minutes,
MariettaO [177]

Answer:3363 seconds

Explanation:3363 is equivalent to 0days 1 hour, 1 min, and 7 sec

8 0
3 years ago
Other questions:
  • If you know about 3D printers could you help me fix mine?
    8·1 answer
  • To begin importing data from an excel spreadsheet, click on the ____ tab on the ribbon.
    11·1 answer
  • Write a function to sum the following series:
    8·1 answer
  • which one of the following word process feature saves you the most time when you keying in a document
    9·1 answer
  • What is the purpose of OPPA<br>​
    13·1 answer
  • True or false when a host gets an IP address from a DHCP server it is said to be configured manually
    15·1 answer
  • After you have located a program name from the Start menu, in order to create a shortcut on the desktop.
    8·1 answer
  • Two technicians are discussing Newton's first law of motion. Technician A says that a lightweight vehicle requires as
    8·1 answer
  • Please help with question
    14·1 answer
  • You have a filtered dataset for Customer Sales with some null value rows. You want to remove these rows completely. How will you
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!