Question

In: Computer Science

You have been asked to write program that allows the user to input a first name, middle initial (without the period)


You have been asked to write program that allows the user to input a first name, middle initial (without the period), and last name of a user and then display that person’s name with the first, middle initial followed by a period, and last name last.

BEFORE creating the program, use structured programming principles to document how you are going to develop the program. Use Microsoft Word to complete this part of the assessment. Answer each of the following areas:

Solve a problem by following the steps of the program development cycle.

Design the program in a modular fashion.

Design each module as a series of sequence control structures.

Use Microsoft Word to answer

Solutions

Expert Solution

/* It is a fairly simple program.Steps are as follows:
   1.Input module - This is responsible for obtaining the input in
     the required way.
     The input is taken in a single line with entries separted by spaces:
     first name middle initial last name.

     The inputs stored in string data types.

   2.Output module - This displays the output as expected.
*/

code in C++:

#include
#include

using namespace std;

int main(){


string first, middle, last; // variable declaration

cout << "Enter first name , middle initial and last name: "; // Input the name
cin >> first >> middle >> last;
cout << first << " " << middle[0] << "." << last << "\n";//Display the name
return 0;
}

Output:


Related Solutions

You have been asked to write program that allows the user to input a first name,...
You have been asked to write program that allows the user to input a first name, middle initial (without the period), and last name of a user and then display that person’s name with the first, middle initial followed by a period, and last name last. BEFORE creating the program, use structured programming principles to document how you are going to develop the program. Use Microsoft Word to complete this part of the assessment. Answer each of the following areas:...
Write a program that prompts the user to input their first name from the keyboard and...
Write a program that prompts the user to input their first name from the keyboard and stores them in the variable "firstName". It does the same for last name and stores it in the variable "lastName". It then uses strcat to merge the two names, separates them by a space and stores the full name into a string variable called "fullName". In the end, the program must print out the string stored within fullName. ANSWER IN C LANGUAGE ! You...
Create a program that allows a user to input customer records (ID number, first name, last...
Create a program that allows a user to input customer records (ID number, first name, last name, and balance owed) and save each record to a file. When you run the main program, be sure to enter multiple records. Once you create the file, open it and display the results to the user Save the file as  CustomerList.java
java programming write a program with arrays to ask the first name, last name, middle initial,...
java programming write a program with arrays to ask the first name, last name, middle initial, IDnumber and 3 test scores of 10 students. calculate the average of the 3 test scores. show the highest class average and the lowest class average. also show the average of the whole class. please use basic codes and arrays with loops the out put should look like this: sample output first name middle initial last name    ID    test score1 test score2...
Using RAPTOR create a program that allows the user to input a list of first names...
Using RAPTOR create a program that allows the user to input a list of first names in on array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. the output should be a list of email address where the address is of the following form: [email protected]
Write a Java program that allows the user to specify a file name on the command...
Write a Java program that allows the user to specify a file name on the command line and prints the number of characters, words, lines, average number of words per line, and average number of characters per word in that file. If the user does not specify any file name, then prompt the user for the name.
C++ Change the program to take user input for first name and last name for five...
C++ Change the program to take user input for first name and last name for five employees. Add a loop to read the first name and last name. // EmployeeStatic.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include <string> #include <iostream> #include <string> using namespace std; class Employee { public:    Employee(const std::string&, const std::string&); // constructor    ~Employee(); // destructor    std::string getFirstName() const; // return first name    std::string getLastName() const; // return...
JAVA Write a program that will accept user input for an initial deposit and a total...
JAVA Write a program that will accept user input for an initial deposit and a total amount the user wants to have, and will output the number of years it will take to reach his/her goal. For the basic program, the user will deposit the initial amount in a new account, and then the account will receive interest, compounded MONTHLY, at a rate of 0.5%.
Write a program that will accept user input for an initial deposit and a total amount...
Write a program that will accept user input for an initial deposit and a total amount the user wants to have, and will output the number of years it will take to reach his/her goal. For the basic program, the user will deposit the initial amount in a new account, and then the account will receive interest, compounded MONTHLY, at a rate of 0.5%.
Write a program that will accept user input for an initial deposit and a total amount...
Write a program that will accept user input for an initial deposit and a total amount the user wants to have, and will output the number of years it will take to reach his/her goal. For the basic program, the user will deposit the initial amount in a new account, and then the account will receive interest, compounded MONTHLY, at a rate of 0.5%. Then modify it by allowing the user to set a fixed amount to be deposited into...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT