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
Frank works for an organization that wishes to install a software program on a single server with multiple users connected. Whic
omeli [17]

Frank who want to install a software program on a single server with multiple users connected should consider cloud computing. This type of computing delivers convenient, on-demand, pay-as-you-go access for multiple customers to a shared pool of configurable computing resources, which is exactly what Frank needs.

3 0
3 years ago
Read 2 more answers
A Ground Fault Circuit Interrupter (GFCI) works by comparing the amount of current going to and returning from equipment along t
Shtirlitz [24]

As the name states, during a ground-fault (when the current going out is significantly different than the current going in) the GCFI interupts the current.  Usually by a switch of some sort.  (Pushing the "test" button produces that click, and cuts off the current)

7 0
3 years ago
Read 2 more answers
An acceptable website design is one that meets
Harman [31]

Answer:

i'd say b

Explanation:

5 0
2 years ago
Read 2 more answers
On "assignments" what does XMPT mean?
tresset_1 [31]

Exempt is what it means


3 0
3 years ago
Which of the following views would you use to see your Web page while working on it?
brilliants [131]
D) Alt Tags thats the answer i think
8 0
3 years ago
Other questions:
  • type the correct answer in the Box spell the words correctly Caleb is working on a simple logic base program to stimulate the ga
    5·2 answers
  • A(n) _______ created in Microsoft Word or another word-processing program works well as a shell for a PowerPoint presentation.a.
    9·1 answer
  • What type of account should you use fro signing in to your windows 8 computer if you want to synchronize your settings on other
    6·1 answer
  • Anyone free to inbox me plz....​
    6·2 answers
  • Write a program called DeliveryCharges for the package delivery service in Exercise 4. The program should again use an array tha
    9·1 answer
  • Czy FALL GUYS będzie działało szybko na i5 GH8? Na ilu FPS?
    13·1 answer
  • Write a test program that prompts the user to enter three sides of the triangle (make sure they define an actual triangle), a co
    5·1 answer
  • Who is he can anyone help me​
    14·2 answers
  • Here is something cool
    5·2 answers
  • Higher Order Functions used for simulations of dice rolls. Definition: An n-sided dice function takes no arguments and always re
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!