Ask questions and get helpful answers.

Create the psuedocode for an application class named Monogram. Its main() method holds three variables that hold your first, middle, and last initials, respectively. Create a method 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).

  1. 👍
  2. 👎
  3. 👁
  4. ℹ️
  5. 🚩
2 answers
  1. import java.util.Scanner;

    public class Names {

    public static void main (String[]args) {

    //declare variables
    String firstName,
    String middleName,
    String lastName,
    String monogram;

    // Create a scanner class
    Scanner input = new Scanner (System.in);

    System.out.println("Enter your first name: ");
    firstName = input.nextLine();

    System.out.println("Enter your middle initial: ");
    middleName = input.nextLine();

    System.out.println("Enter your last name: ");
    lastName = input.nextLine();

    input.close();

    monogram = String.valueOf(first.charAt(0)).toLowerCase() +
    String.valueOf(middle.charAt(0)).toUpperCase() +
    String .valueOf(last.charAt(0)).toLowerCase();
    System.out.println(monogram);

    }
    }

    1. 👍
    2. 👎
    3. ℹ️
    4. 🚩
  2. import java.util.Scanner;

    public class Names {

    public static void main (String[]args) {

    //declare variables
    String firstName,
    String middleName,
    String lastName,
    String monogram;

    // Create a scanner class
    Scanner input = new Scanner (System.in);

    System.out.println("Enter your first name: ");
    firstName = input.nextLine();

    System.out.println("Enter your middle initial: ");
    middleName = input.nextLine();

    System.out.println("Enter your last name: ");
    lastName = input.nextLine();

    input.close();

    monogram = String.valueOf(first.charAt(0)).toLowerCase() +
    String.valueOf(middle.charAt(0)).toUpperCase() +
    String .valueOf(last.charAt(0)).toLowerCase();
    System.out.println(monogram);

    }
    }

    1. 👍
    2. 👎
    3. ℹ️
    4. 🚩

Answer this Question

Related Questions

Still need help?

You can ask a new question or browse existing questions.