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
How is IT related to new business initiatives?
wlad13 [49]

Answer:

Key Driver

Explanation:

Its undoubtedly the information that is most important for any new business initiatives. All these decisions are taken by Board of directors, and are being executed by the Chief Executive of the company.However, these are higher officials and are well educated to take decision from given refined information. The data need to be more clean for the Board of Directors as compared to the CEOs. The data must be more precise and more accurate for the higher authority, and like more precise for management as compared to the technical team. The reason is shortage of time.  Also what is information for technical team, is data for the management. And all this is made possible through IT, and subjects like Information Science, and various IT technologies.

7 0
3 years ago
what is a massive online storage that allows for Access by any internet-connected device running web browser. use for Less priva
Paladinen [302]
I recommend Google Drive, it allows up to 15gb of free storage. You can access it anywhere since it is fromGoogle. Another one you can try is Dropbox which only allows up to 2gb.
8 0
3 years ago
Instead of typing out each co-worker's email address individually, you can use the Office Online People application to create a
arsen [322]

The answer is D) group

7 0
3 years ago
Read 2 more answers
How does beamforming improve network service?
fenix001 [56]

Beamforming can improve network service by using device locations to better target service signals.

This is because, beamforming helps to deliver higher signal quality to the target receiver.

<h3>What is beamforming?</h3>

beamforming can be regarded as application of different radiating elements that is transmitting the same signal.

This signal is usually identical in wavelength and phase, and  by reinforcing the waves in a specific direction the goal can be acheived.

Learn more about beamforming at:

brainly.com/question/12809344

7 0
2 years ago
Can you structure this code in if-statements?
Naddika [18.5K]
Not sure what quizScore1-5 is, but here it is. Also, I'm not entirely sure what language you're working with here, but null can't be returned as an integer. If it were a string, for example, it'd be possible as string is an object reference type.

public int getData(int dataNumber)
{
    if (dataNumber == 1)
        return quizScore1;
    else if (dataNumber == 2)
        return quizScore2;
    else if (dataNumber == 3)
        return quizScore3;
    else if (dataNumber == 4)
        return quizScore4;
    else if (dataNumber == 5)
        return quizScore5;
    else
        return 0;
}
3 0
3 years ago
Other questions:
  • Why are prepositions, conjunctions, and pronouns usually considered poor choices to use as key words?
    5·2 answers
  • Insert the components that the computer uses to perform the tasks of each of the parts:
    13·1 answer
  • What are the pasting options in Outlook 2016? Check all that apply.
    10·2 answers
  • A lamp outside a front door comes on automatically when it is dark, and when someone stands on the doormat outside the front doo
    7·1 answer
  • if a second system failure occurs while the first recovery is in progress, what needs tobe done after the system recovers for th
    11·1 answer
  • Implement the Tollable interface. It provides one method, pay, that accepts an int (how many dollars to pay), and returns an int
    8·1 answer
  • In this paper https://arxiv.org/pdf/2008.10150.pdf, I'm having a hard time understanding how the assignment in the picture is de
    10·2 answers
  • How many MB are there in 1000 KB?
    11·2 answers
  • Can someone help me debug this please
    6·1 answer
  • Software is in -----language​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!