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
A company uses the account code 669 for maintenance expense. However, one of the company's clerks often codes maintenance expens
kotegsom [21]

Answer:

The correct answer to the following question will be "Valid-code test".

Explanation:

Even though no significance labels (including a standardized test score parameter) exist, valid data input codes or protocols could still be defined by having to type the correct codes as well as ranges.

  • To diagnose the given mistake, a valid code review will be the strongest internal control audit to incorporate into the organization's computer program.
  • To insert valid code the syntax is: <Code or Range>. Throughout this scenario, each code is decided to enter on another step.
3 0
3 years ago
1. Do our shared social experiences lead us to think<br><br> communication is a cure-all?
egoroff_w [7]

Answer:

Yes

Explanation:

Shared social illustrations have always shown that any problem of any kind can be sorted by communication.

Eg : Whenever societies face any problem - eg recession, the competent people related to that area of problem (representing different interests of various groups also) sit & discuss (ie communicate in detail) about it.  

These communications have seen to be solution to all problems world has faced.

3 0
3 years ago
Who will help me with a test on Computer Science plz will help you level up and upvotes!!!!! plzzzzzzzzzzzzzzzzzzz
Diano4ka-milaya [45]
Sure, depends what you need help with!
5 0
3 years ago
Read 2 more answers
Tab stops are very useful when you want to A. align text into rows. B. add space between paragraphs. C. align text into columns.
Alenkasestr [34]
The best answer here is Answer C - Tab stops are useful when you want to "align text into columns".

All tab stops do is shift text a fixed amount to the left or right on the line. They are useful for improving the layout of text when you want to align multiple rows.

Answer A is incorrect because rows are vertical and not horizontal. B is also irrelevant because spaces between paragraphs are vertical. Answer D could also be correct because you can use tab stops to indent text aswell, but the more general answer is A. If you can have more than one answer, you could have A and D.
8 0
3 years ago
Read 2 more answers
Switches: Select one:
const2013 [10]

Answer:

b. connect two or more network segments that use different data link protocols

Explanation:

A switch is an analog device that allows to interconnect networks, it is possibly one of the devices with a higher level of scalability. It is important to clarify that a Switch does not only provide connectivity with other networks, nor does it provide connectivity with the Internet, for this purpose a router is necessary.  

6 0
3 years ago
Other questions:
  • You will be given a string, containing both uppercase and lowercase alphabets(numbers are not allowed).
    14·1 answer
  • Define the proposition in symbols using: p: The weather is bad. q: The trip is cancelled. r: The trip is delayed. Proposition in
    7·1 answer
  • Henry went to an IT software company for an interview he was offered a position in lower level management which positions could
    11·1 answer
  • Assume there is a variable , h already associated with a positive integer value. Write the code necessary to count the number of
    13·1 answer
  • Which of the following are documents that can help you to review and assess your organization’s status and state of security? Fi
    6·1 answer
  • What are the functions of super computer?<br> ​
    7·2 answers
  • Please help me please it's urgent​
    6·1 answer
  • ____ the most popular word processing applications software<br><br>​
    12·1 answer
  • What are common considerations businesses need to make before purchasing new computers? Check all of the boxes that apply.
    6·1 answer
  • Which are ways that technology keeps you hooked?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!