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
Where can the container code be found in Google Tag Manager? (select all answers that apply) a. In a pop-up window after you cre
saveliy_v [14]

Answer:

Option A and C.

Explanation:

The container code can be located in Google Tag Manager inside a pop-up window when they set up an account as well as container and Under "Admin" through choosing that container and clicking Installing Google Tag Manager.

The main advantage for Google Tag Manager, ever though, would be that it create it in much easier manner for marketing companies to execute identifiers without depends on developers to use it. Developers tend to also be preoccupied with some other high-priority initiatives so tagging mostly finishes up on the other side burner

7 0
3 years ago
Which of the following is not a responsibility of an operating system?
FromTheMoon [43]
The answer would be “automatically upgrade the computer’s RAM”. RAM is a computer part that would need to be bought and placed in the computer by the user.
5 0
3 years ago
Read 2 more answers
What are the default left and right margins in Word? ​
Serga [27]

Answer:

The default margins for Microsoft Word from version 2007 onward have been 1 inch (25.4 mm) all around; in Word 2003, the default top and bottom margins were 1 inch (25.4 mm), but 1.25 inches (31.7 mm) were given at the left and the right.

6 0
3 years ago
Read 2 more answers
Which element always appears to start on a new line in the browser window
pantera1 [17]
C hope this helps bye
5 0
3 years ago
Which type of footwear should be worn while working on a hybrid vehicle?
Dmitrij [34]

Hello there!

Shoes with rubber souls would be the best bet.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Write c++ code that prints: usernum ... 2 1 blastoff! your code should contain a for loop. print a newline after each number and
    12·1 answer
  • give 2 reasons why u think that technology will be bigger in the future and why do we need it not for school need your perspecti
    12·2 answers
  • Your company has an external database of payment information that they wish to populate in Salesforce. They have decided to use
    13·1 answer
  • Who said "BAM WHAT?!" On disney channel?
    5·2 answers
  • The engineering firm you work for is submitting a proposal to create an amphitheater at a state park. Proposals must be submitte
    15·1 answer
  • Universal Containers sells its products online using a system built on Force Sites. The orders are captured and processed in Sal
    7·1 answer
  • Techniques that shape material without removing material.​
    6·1 answer
  • Will has been asked to recommend a protocol for his company to use for a VPN connection to the cloud service provider that his c
    6·1 answer
  • 10<br> Which of the following is not one of the most popular Spreadsheet software applications?
    6·1 answer
  • Manufactured computers and cell phones are part of which industry? Electronics Chemicals Machinery Metal products
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!