Question

Create the pseudo-code/flowchart for an application class named Monogram. Its main() method inputs three variables that...

Create the pseudo-code/flowchart for an application class named Monogram. Its main() method inputs three variables that hold your first, middle, and last initials, respectively. Create a method(called Monogram()) to which you pass the three initials and that displays the initials twice—once in the order of first, middle, and last, and a second time in traditional monogram style (first, last, middle). Main inputs the data, you pass it to the Monogram Function, which will output the data

0 0
Add a comment Improve this question Transcribed image text
Answer #1

The code in language c++ is given below, I have commented in line for the explanation, which will act as pseudocode.

Code in c++

#include <iostream>

using namespace std;

class Monogram// class Monogram
{
public:// scope of this function is public
void monogram(string first, string middle, string last)
{
cout<<"\nName in normal form is: ";
// print first middle last
cout<<first<<" "<<middle<<" "<<last<<endl;
  
cout<<"\nName in monogram Style is: ";
// print first last middle
cout<<first<<" "<<last<<" "<<middle<<endl;
  
}
};

int main()
{
string first,middle,last;// variable to store names
cout<<"Enter the first name:";
cin>>first;
cout<<"Enter the middle name: ";
cin>>middle;
cout<<"Enter the last name: ";
cin>>last;
  
Monogram m;// initialize Monogram object
m.monogram(first,middle,last);// call the method
  

return 0;
}

Output:-

Hope it clears your doubt and you like it :)

Add a comment
Know the answer?
Add Answer to:
Create the pseudo-code/flowchart for an application class named Monogram. Its main() method inputs three variables that...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a Java program Named LB04 with a class name HardMonogram Input:   fullName Process: getInitial(separateName): extract the...

    Create a Java program Named LB04 with a class name HardMonogram Input:   fullName Process: getInitial(separateName): extract the first character string from each part of a full name and return it. getSeparateName(fullName): separate a full name into first name, middle name, and last name. setMonogram(): using getInitial(), generate the right monogram result, then display it. main(String[] args): driver method Output: - Using JOptionPane to get a first name, middle name, and last name at once, then, on a JOptionPane dialog, show the...

  • Create an application where the user inputs two double values. Pass both variables to a method...

    Create an application where the user inputs two double values. Pass both variables to a method named compucepercent ( that displays the two values and the value of the first number as a percent of the the second one. Then call the method a second time, passing the values in reverse order For example, if the numbers are 2 and 5, a typical output might be 2.0 is 40 percent of 5.0 5 0 is 250 percent of 2.0

  • Create a class named Module2. You should submit your source code file (Module2.java). The Module2 class...

    Create a class named Module2. You should submit your source code file (Module2.java). The Module2 class should contain the following data fields and methods (note that all data and methods are for objects unless specified as being for the entire class) Data fields: A String object named firstName A String object named middleName A String object name lastName Methods: A Module2 constructor method that accepts no parameters and initializes the data fields from 1) to empty Strings (e.g., firstName =...

  • Programming 5_1: Create a Java class named <YourName>5_1 In this class create a main method...

    Programming 5_1: Create a Java class named <YourName>5_1 In this class create a main method, but for now leave it empty. Then write a Java method getAverage which takes an array of integers as it’s argument. The method calculate the average of all the elements in the array, and returns that average. The method should work for an array of integers of any length greater than or equal to one. The method signature is shown below: public static double getAverage(...

  • Java 1. Create an application named NumbersDemo whose main() method holds two integer variables. Assign values...

    Java 1. Create an application named NumbersDemo whose main() method holds two integer variables. Assign values to the variables. In turn, pass each value to methods named displayTwiceTheNumber(), displayNumberPlusFive(), and displayNumberSquared(). Create each method to perform the task its name implies. 2. Modify the NumbersDemo class to accept the values of the two integers from a user at the keyboard. This is the base code given: public class NumbersDemo { public static void main (String args[]) { // Write your...

  • a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number,...

    a. Create a class named Lease with fields that hold an apartment tenant's name, apartment Number, monthly rent amount, and term of the lease in months. Include a constructor that initializes the name. "XXX", the apartment number to O, the rent to 1000, and the term to 12. Also include methods to get and set each of the fields. Include a nonstatic method named addPetFee() that adds $10 to the monthly rent value and calls a static method named explainPetPolicy...

  • Create a Console application for a library and name it FineForOverdueBooks. The Main( ) method asks...

    Create a Console application for a library and name it FineForOverdueBooks. The Main( ) method asks the user to input the number of books that are overdue and the number of days they are overdue. Pass those values to a method that displays the library fine, which is 10 cents per book per day for the first seven days a book is overdue, then 20 cents per book per day for each additional day. Grading criteria 1. Create a Console...

  • In this lab, you will create one class named ArrayFun.java which will contain a main method...

    In this lab, you will create one class named ArrayFun.java which will contain a main method and 4 static methods that will be called from the main method. The process for your main method will be as follows: Declare and create a Scanner object to read from the keyboard Declare and create an array that will hold up to 100 integers Declare a variable to keep track of the number of integers currently in the array Call the fillArray method...

  • Last name is Vhora 3. Write a java class named FinalyourLastName, which contains three methods: main,...

    Last name is Vhora 3. Write a java class named FinalyourLastName, which contains three methods: main, arrayMystery, and countTotalOdd. You need to create main method. Inside the main method...you need to create an integer array named myld that consists of each of the digits in your student ID, call arrayMystery method and print out myld, then call count TotaOdd method and print out the total number of odd digits in your ID. (8 points) The arrayMystery method is given as...

  • Create a Java file named Ch6Asg.java that contains a public class named Ch6Asg containing a main()...

    Create a Java file named Ch6Asg.java that contains a public class named Ch6Asg containing a main() method. Within the same file, create another class named Employee, and do not declare it public. Create a field for each of the following pieces of information: employee name, employee number, hourly pay rate, and overtime rate. Create accessor and mutator methods for each field. The mutator method for the hourly pay rate should require the value to be greater than zero. If it...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT