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
Sunny_sXe [5.5K]
3 years ago
7

Write a program that has the following String variables: firstName, middleName, and lastName. Initialize these with your first,

middle, and last names. The program should also have the following char variables: firstInitial, middleInitial, and lastInitial. Store your first, middle, and last initials in these variables. The program should display the contents of these variables on the screen.
Computers and Technology
1 answer:
Licemer1 [7]3 years ago
3 0

Answer:

The programming language is not stated; However, I'll answer your question using C++ programming language.

Comments are used for explanatory purpose

Program starts here

#include<iostream>

#include <string>

using namespace std;

int main()

{

//Declare Variables

string firstName, middleName, lastName;

char firstInitial, middleInitial, lastInitial;

/*Initialize firstName, middleName and lastName (Replace values with your details)*/

firstName = "First Name";

middleName = "Middle Name";

lastName = "Last Name";

 

// Get Initials

firstInitial = firstName.at(0);

middleInitial = middleName.at(0);

lastInitial = lastName.at(0);

 

//Print Results

cout<<"Lastname: "<<lastName<<endl;

cout<<"Firstname: "<<firstName<<endl;

cout<<"Middlename: "<<middleName<<endl;

cout<<"Last Initial: "<<lastInitial<<endl;

cout<<"First Initial: "<<firstInitial<<endl;

cout<<"Middle Initial: "<<middleInitial<<endl;

return 0;

}

You might be interested in
Please choose the correct answer please tell fast​
pav-90 [236]

Answer:

the answer might be 2......

7 0
3 years ago
Help with what the awnser is
wariber [46]
Flute on a boot ;) hope i helped

8 0
3 years ago
What is the abuse of electronic messaging systems to indiscriminately send unsolicited bulk messages, many of which contain hoax
Ilya [14]

I think the answer is spam
5 0
2 years ago
Usted repetir la pregunta?<br>O A. Es<br>B. Puede<br>C. Puedes<br>O D. Está​
puteri [66]

Answer:

I believe the answer is B. Puede

5 0
3 years ago
Read 2 more answers
Omar sends a PDF file to his teacher. He then prepares another copy of the presentation that includes only the slides he wants t
maria [59]

Answer:

D. Custom Slide Show

Explanation:

Correct on edg

7 0
3 years ago
Other questions:
  • In your opinion, is it more beneficial to have many folders or is it better to “nest” subfolders? Explain your response.
    10·2 answers
  • Type the correct answer in the box spell all words correctly
    8·1 answer
  • T F The exit function can only be called from main .
    10·1 answer
  • Which port must be open on your router to allow you to upload device configuration and firmware updates using trivial file trans
    13·1 answer
  • 460N of force is exerted on an object with a surface area of 2,5m.How much pressure is felt by the object?​
    11·2 answers
  • Was just testing how this works, no actual question; feel free to take the points anyways though. ​
    13·1 answer
  • Which of the following is true of functions?
    10·1 answer
  • Write a C# program named ProjectedRaises that includes a named constant representing next year’s anticipated 4 percent raise for
    15·1 answer
  • Explain the working principle of computer with suitable diagram​
    15·1 answer
  • How do I fix when it hits the second session it skips scanf.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!