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
Advocard [28]
3 years ago
6

Write a program that reads a person's first and last names separated by a space, assuming the first and last names are both sing

le words. Then the program outputs last name, comma, first name. End with newline. Example output if the input is: Maya Jones
Computers and Technology
1 answer:
Dmitriy789 [7]3 years ago
7 0

<em>Complete Question:</em>

<em>Write a program that reads a person's first and last names, separated by a space. Then the program outputs last name, comma, first name. End with newline.  </em>

<em>Example output if the input is: Maya Jones </em>

<em>Jones, Maya</em>

<em></em>

<em>In C++</em>

<em></em>

Answer:

The program written in C++ is as follows

<em>#include<iostream></em>

<em>using namespace std;</em>

<em>int main(){</em>

<em>string lname, fname;</em>

<em>cout<<"First name: ";</em>

<em>cin>>fname;</em>

<em>cout<<"Last name: ";</em>

<em>cin>>lname;</em>

<em>cout<<lname<<", "<<fname;</em>

<em>return 0;</em>

<em>}</em>

<em />

Explanation:

This line declares lname, fname as string to get the user's last name and first name, respectively

<em>string lname, fname;</em>

This line prompts the user for first name

<em>cout<<"First name: ";</em>

This line gets the user first name

<em>cin>>fname;</em>

This line prompts the user for last name

<em>cout<<"Last name: ";</em>

This line gets the user last name

<em>cin>>lname;</em>

This line prints the desired output

<em>cout<<lname<<", "<<fname;</em>

You might be interested in
These factors limit the ability to attach files to e-mail messages. location of sender recipient's ability to open file size of
NeX [460]

The answer is

Recipient's ability to open file

Size of file

Sometimes, it might occur that the email message attachment you’ve sent to someone has an error or is corrupt and thus, limits the recipient ability to open the file. Another factor is the size of the file. All email servers limit the size of the file attached in an email that a recipient can receive mainly because of security reasons. Google Mail, for instance, only allows you to send 25MB only. This might limit the ability to attach files to e-mail messages as well.

3 0
2 years ago
Read 2 more answers
What are ways to access Tasks view in Outlook? Check all that apply. Select To-Do List or Task Folder. View daily task lists in
SVETLANKA909090 [29]

Answer:

A. B. D. E.

Explanation:

edg 2021

8 0
3 years ago
Read 2 more answers
For each of the following memory accesses indicate if it will be a cache hit or miss when carried out in sequence as listed. Als
nika2105 [10]

Answer:

Explanation:

Operation Address Hit? Read Value

Read 0x834 No Unknown

Write 0x836 Yes (not applicable)

Read 0xFFD Yes CO

6 0
3 years ago
Integrated circuits are made up of _____ that carry the electrical current.
brilliants [131]
Silicon.  Hope it helped.



~ThePirc
5 0
3 years ago
The sides of a ladder are called
adoni [48]

I think they are called stringers or rails.

3 0
3 years ago
Read 2 more answers
Other questions:
  • What was the first computer to defeat a world champion chess player?
    14·1 answer
  • What typically happens by default when a file is double clicked in Microsoft Windows?
    9·1 answer
  • You have a small company and want to keep your costs low, but it is important your employees share data. Which network would pro
    5·2 answers
  • You must. place a child in a federally approved child restraint device. if the child is
    5·2 answers
  • Why bootable installer preparation is important? explain
    9·1 answer
  • Why is it important to install updates? Why should you use the Power button on the Start menu instead of the Power button on you
    7·1 answer
  • What does a for loop look for in the sequence of data? Check all that apply.
    6·2 answers
  • Match the parts of the website address with its correct explanation. http://www.usa.gov/Agencies/federal.shtm/​
    5·2 answers
  • What to do if you click on a phishing link on iphone
    9·2 answers
  • TQ Sustainability &amp; Technology
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!