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]
4 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]4 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
A fast-food restaurant has four kinds of employees:
Marysya12 [62]

Answer:

Following is given the detailed solution of the given question.

I hope it will help you!

Explanation:

7 0
3 years ago
Which intel processor technology interconnects the processor, chipset, and wireless network adapter as a unit, improving laptop
Ira Lisetskai [31]
Apu?
....................
8 0
4 years ago
What do all social media sites have in common? (Must check all that apply)
Georgia [21]
* <span>They all engage users with fun or interesting features.
*</span><span>They encourage people to participate.</span>
3 0
3 years ago
To what health hazard are people working in offices most likely to be exposed.
Andrei [34K]

Answer:

Sickness

Explanation:

6 0
3 years ago
Sets of keywords and symbols that help refine internet search requests are called _____. boolean operators microsoft operators a
Kay [80]
Boolean operators, it uses the word "and","or" and "not" with keywords to control the search. For example if you search for health and food, the search engine will give a narrow search focusing on the two keywords. Using "or" with keywords will give much broader results. Using a "not" will remove one keyword from the search, ex. windy not rainy will give results of the keyword windy only. An asterisk on the other hand, gives wider results with variations.
3 0
3 years ago
Other questions:
  • Drag each storage device to its category.
    7·1 answer
  • To have the most impact when using email, you should structure your messages so that
    5·1 answer
  • Why is it important to be a good digital citizen??
    11·1 answer
  • Current versions of windows support file names up to ________ characters long
    5·1 answer
  • What is the benefit to displaying the merge codes in a document?
    9·1 answer
  • I want pizzzzzzzaaaaaaaaaaa
    9·1 answer
  • You have four DCs in your domain. Active Directory appears to be corrupted on one of the DCs, and you suspect a failing hard dri
    5·1 answer
  • Discuss what repetitions structures are, and how they differ from the vectorization approaches we have previously studied in the
    10·1 answer
  • What is the function of the NOS? Select all that apply.
    5·2 answers
  • Who is willam afton from five nights at freddy
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!