Question

I NEED THE ANSWER IN C++ FORMAT


Your question has been answered Let us know if you got a helpful answer. Rate this answer Question: Suppose a string variable

I need the answer In C++ format

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Answer: here is the answer for your question :

CODE IN C++:

---------------------------------------------------------------------------------------------------------------------------------------------
#include <stdio.h>
#include<string>
#include<iostream>
using namespace std;
int main()
{
string fullName="Doe, John";

string delimiter = " ";
string token = fullName.substr( fullName.find(delimiter),fullName.length());
cout<<"Hello"<<token<<"!";
return 0;
}

---------------------------------------------------------------------------------------------------------------------------------------------

CODE SNIPPET:

main.cpp #include <stdio.h> 3 #include<string> 4 #include<iostream> 5 using namespace std; 6 int main() string fullName=Doe,

---------------------------------------------------------------------------------------------------------------------------------------------

CODE OUTPUT:

Hello John! ... Program finished with exit code o Press ENTER to exit console. I

---------------------------------------------------------------------------------------------------------------------------------------------

I hope this would help you out

If you have any doubt, you can provide comment /feedback below the answer

Thanks

Add a comment
Know the answer?
Add Answer to:
I NEED THE ANSWER IN C++ FORMAT I need the answer In C++ format Your question...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the...

    WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. --       Format this column with the last name, a comma, a space, and the first name like this: --       Doe, John --       Sort the result set by last name in ascending sequence. --       Return only the contacts whose last name begins with a letter from M to Z. --  ...

  • has to be done in c programming not c++ 5:28 . O Done Lab_Seven Lun, wuUULIVIL...

    has to be done in c programming not c++ 5:28 . O Done Lab_Seven Lun, wuUULIVIL - - - - - - - - Write a program that prompts the user to input their first name, from the keyboard and stores them in the variable "firstName". It does the same for last name and stores it in the variable "lastName". It then uses strcat to merge the two names, separates them by a space and stores the full name into...

  • Background information: : Implement your toString method. The output should be in the format ik Name:...

    Background information: : Implement your toString method. The output should be in the format ik Name: (Phone Number: ) *For example, if a contact has the first name John, last name Doe and middle name Xavier, and the phone number 123-456-7890, this should return: ik Name: Doe, John Xavier (Phone Number: 123-456-7890) *Do not insert new line character after the last digit of the phone number ik public String toStringO t

  • Write a C++ program that produces the following output: /* OUTPUT Enter your age: 21 Enter...

    Write a C++ program that produces the following output: /* OUTPUT Enter your age: 21 Enter the last name: Lee Hello Tom Lee. You are 21 years old. Press any key */   Declare an array named: firstName The array is a c_string, i.e., it is a null-terminated character array. The size of the array is 10. Assign a first name to it when it is declared.   Declare an array named: lastName The array is a c_string, The size of the...

  • Your app is computing and displaying tax for the user, in the format “Hello John Doe,...

    Your app is computing and displaying tax for the user, in the format “Hello John Doe, Your Tax is: ......” , where John Doe is the name entered, and .... indicates the tax amount as a dollar figure. Your form has two textboxes, where the user will enter his/her name, and income, and click a Submit button. Your app will store the name entered by the user into a variable of type String, and store the income into a variable...

  • the language i wan used in C# is visual basic.Create a console program that contains the...

    the language i wan used in C# is visual basic.Create a console program that contains the following ·         A Class named Account with the following properties: o   public int Id { get; set; } o   public string Firstname { get; set; } o   public string Lastname { get; set; } o   public double Balance { get; set; } o   public DateTime CreationDate { get; set; } o   Create a constructor that initializes all of the properties. o   Create a ToString...

  • Part 2: Processing Strings (Individual work) Processing user-entered data to follow a specific format is a...

    Part 2: Processing Strings (Individual work) Processing user-entered data to follow a specific format is a common task. Often this involves using string functions to manipulate a set of input strings. Create a MATLAB script named namephone.m and place these lines of code at the beginning: name  = input('Enter your first and last name: ','s'); phone = input('Enter your area code and phone number: ','s'); Tasks Here are useful string functions:  length, strcat, strtrim, lower, upper, strcmp, findstr, strrep As you work...

  • In C++, You are given a file of customer data with records in the following format...

    In C++, You are given a file of customer data with records in the following format : account number, last name, first name, middle name. Write a program to convert the input data and display it to the monitor in the following format : Accout Name     Logon ID Initial Pswd 21-88282712-B Keith S. Adams ADAM21 Adam88282 08-36847734-A John R. Sturm STUR08 Stur36847    etc. Notes :     1) The account number on the input is 10 digits     2)  The names on...

  • Please implement the following problem in basic C++ code and include detailed comments so that I...

    Please implement the following problem in basic C++ code and include detailed comments so that I am able to understand the processes for the solution. Thanks in advance. // personType.h #include <string> using namespace std; class personType { public: virtual void print() const; void setName(string first, string last); string getFirstName() const; string getLastName() const; personType(string first = "", string last = ""); protected: string firstName; string lastName; }; // personTypeImp.cpp #include <iostream> #include <string> #include "personType.h" using namespace std; void...

  • What is the problem with my Program ? also I need a Jframe that desplays the...

    What is the problem with my Program ? also I need a Jframe that desplays the original input on the left side and the sorted input of the left side. my program is supose to read the number for basketball players, first name, last name, and float number that is less than 0 . on the left sideit is supposed to sort all this input based on last name. This is my demo class : package baseball; import java.io.*; import...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT