All pastes #90619 Raw Edit

Untitled

public text v1 · immutable
#90619 ·published 2006-07-17 21:26 UTC
rendered paste body
// The "Changingnames" class.
import java.awt.*;
import hsa.Console;

public class Changingnames
{
    static Console c;  // The output console
    static String first;
    static string mid;
    static string last;
    
    public static void main (String[] args)
    {
        c = new Console ();
        int choice;
        c.println("Please Write your first name");
        first=c.readString();
        c.println("Please Insert your middle intial");
        mid=c.readString();
        c.println("Please Insert your last name");
        last=c.readString();
        
        do
        {
             c.println("/t/t Main Menu");
             c.println("/t/t **********************");
             c.println("/t/t 1. First name, lastname ");
             c.println("/t/t 2. Last name, Firstname middle intial");
             c.println("/t/t 3. All names ");
             c.println("/t/t 4. Last name, First name");
             c.println("/t/t 5. Exit");
             c.println("/t/t **********************");
              do
        { 
        c.print("/t/t What is your choice? ");
        choice=c.readInt();
        if ( (choice < 1) || (choice > 4) )
        c.println("/t/t/t Invalid ... enter 1-4");
       }
        while ( (choice < 1) || (choice > 5) );
        if (choice == 1) option1();
        else if (choice == 2) 
        option2();
        else if (choice == 3) 
        option3();
        else if (choice == 4) 
        option4();
    }
        while (choice !=5);
        c.println("/t/t Thank you for using our program. Goodbye!!");

        } 
        // Place your program here.  'c' is the output console
    } // main method
  
   
    public static void option1 ()
    {
    c.clear ();
    c.println(first+" "+last);
   }
    public static void option2()
    {
    c.clear ();
    c.println(last+", "+first+" "+mid+".");
    }
    public static void option3()
    {
    c.clear ();
    c.println(first+" "+mid+". "+last);
    }
    public static void option4()
    {
    c.clear ();
    c.println(last+", "+first);
    }
} // Changingnames class