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
HELP PLEASE!!! Which development method is best explained in this way: a creation of a prototype model that will eventually be d
DerKrebs [107]

Answer:

Not sure but I think its Rapid Prototyping Method

4 0
3 years ago
Aubrey uses the following formula to calculate a required value. Which elements of the formula use mixed cell referencing?
iris [78.8K]

Answer:

$1A

brainiest plz

Explanation:

The elements of a formula only can have the following format:

1) Letter Number as C1

2) Letter $ Number as A$1

3) $ Letter Number as $A1

4) $ Letter $ Number as $A$1

The element $1A is not in the format

5 0
3 years ago
Read 2 more answers
Why is computer called information processing machine....?​
mixer [17]

Answer:

Since the computer accepts raw data as input and converts into information by means of data processing

Explanation:

helping!!!

3 0
2 years ago
Read 2 more answers
When I Plug my logitech G Pro keyboard into my ps4 slim it lights up and recognizes it as a keyboard but i can not use it, can y
Lera25 [3.4K]

Answer: it is an error

Explanation: Even though it recognizes it it will not work because an error in the system

6 0
3 years ago
The people who perform jobs and tasks are part of which factor of production?
wel
The answer is D. Labor
7 0
3 years ago
Other questions:
  • Having some prior knowledge about your topic is helpful when conducting internet research. please select the best answer from th
    7·2 answers
  • Which of the following will affect the size of your monthly mortgage payment
    8·2 answers
  • Which utility would you use to return the common name of the computer you're at? Execute this command and submit screen shots.
    11·1 answer
  • 3. By default, Blender® remembers your last 32 actions and allows you to undo them one at a time by pressing CTRL+Z. (1 point)
    9·1 answer
  • How long does it take a packet of length 1,000 bytes to propagate over a link of distance 2,500 km, propagation speed 2.5 · 108
    8·2 answers
  • In attempts to improve their contribution to the environment, a company decided to adapt to green computing. Which of these tech
    15·1 answer
  • Outputting all combinations. Output all combinations of character variables a, b, and c using this ordering abc acb bac bca cab
    7·1 answer
  • Which type of operating system is usually used in personal computers?
    12·2 answers
  • While checking your work e-mail, you have received an e-mail warning you about a virus that is currently doing the rounds. What
    8·1 answer
  • This line of code is in your program.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!