Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: how to display item above....help me to do this...

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    6
    My Mood
    Cheerful
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation how to display item above....help me to do this...

    import java.util.Scanner;
    public class projek
    {
    public static void main (String [] args)
    {

    Scanner keyboard = new Scanner(System.in);
    int coursecode;
    String coursename;
    int coursekrdt;
    double coursetime;
    String venue,day,name;


    char displaycourse;


    {
    System.out.println("****************************** *********");
    System.out.println(" WELCOME ");
    System.out.println("****************************** *********");

    int menu;

    do
    {

    System.out.println("1: ADD COURSE");
    System.out.println("2: DISPLAY ALL COURSE");
    System.out.println("3: SEARCH");
    System.out.println("4: DELETE");
    System.out.println("5: EDIT");

    System.out.print("PLEASE CHOOSE A NUMBER STATED ABOVE : ");
    menu = keyboard.nextInt();
    if (menu == 1)
    System.out.println("YOU ARE EXECUTING ADD OPERATION");
    else if (menu == 2)
    System.out.println("YOU ARE EXECUTING DISPLAY OPERATION");
    else if (menu == 3)
    System.out.println("YOU ARE EXECUTING SEARCH OPERATION");
    else if (menu ==4)
    System.out.println("YOU ARE EXECUTING DELETE OPERATION");
    else if (menu ==5)
    System.out.println("YOU ARE EXECUTING EDIT OPERATION");
    else if (menu == 6)
    System.out.println("EXIT FOR MENU..");

    }while ( menu <= 0);

    switch (menu)
    {
    case 1:

    int course []=new int[7];
    System.out.print("ENTER THE COURSE CODE:");
    coursecode=keyboard.nextInt();


    System.out.print("ENTER THE COURSE NAME:");
    coursename=keyboard.next();

    System.out.print("ENTER THE COURSE CREDIT:");
    coursekrdt=keyboard.nextInt();

    System.out.print("ENTER THE COURSE TIME:");
    coursetime=keyboard.nextDouble();

    System.out.print("ENTER THE VENUE:");
    venue=keyboard.next();

    System.out.print("ENTER THE DAY:");
    day=keyboard.next();

    System.out.print("ENTER THE LECTURE NAME:");
    name=keyboard.next();

    break;

    case 2:
    System.out.print("DISPLAY COURSE :" );
    String display = keyboard.next();

    break;

    case 3:
    System.out.print("SEARCH COURSE :" );
    String search = keyboard.next();
    break;

    case 4:
    System.out.print("DELETE COURSE :" );
    String delete = keyboard.next();
    break;

    case 5:
    System.out.print("EDIT COURSE :" );
    String edit = keyboard.next();
    break;



    }
    }
    System.out.println("\n **********");
    System.out.println("\n thank you... (: ");
    System.out.println("\n **********");




    }
    }
    i want to display all item above....how to write a code...i forgot...


  2. #2
    Super Moderator curmudgeon's Avatar
    Join Date
    Aug 2012
    Posts
    1,130
    My Mood
    Cynical
    Thanks
    64
    Thanked 140 Times in 135 Posts

    Default Re: how to display item above....help me to do this...

    Your question is missing a lot of necessary information. Please give more information in your question telling us more about what you're trying to do, what's wrong with your current code, etc. Please edit your post above and wrap your code in [code] [/code] tags so that it retains its formatting and is readable.

  3. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    6
    My Mood
    Cheerful
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: how to display item above....help me to do this...

    This my Project Requirement – STIA 1013

    Course Information System

    1. Course information:
    a. Course code, course name, credit, time, venue, day, lecturer name

    2. Functions that need to be developed:
    a. Add course
    b. Display all courses
    c. Search – Search by course code and also lecturer name. Then, display only one record
    d. Delete – delete through course code
    e. Edit the course information

    3. Use an array of object
    4. Your system must be user friendly. It means that if record is not found, please display an appropriate message
    5. Use a menu concept like ATM machine

    import java.util.Scanner;
    public class projek
    {
    public static void main (String [] args)
    {

    Scanner keyboard = new Scanner(System.in);
    int coursecode;
    String coursename;
    int coursekrdt;
    double coursetime;
    String venue,day,name;


    char displaycourse;


    {
    System.out.println("****************************** *********");
    System.out.println(" WELCOME ");
    System.out.println("****************************** *********");

    int menu;

    do
    {

    System.out.println("1: ADD COURSE");
    System.out.println("2: DISPLAY ALL COURSE");
    System.out.println("3: SEARCH");
    System.out.println("4: DELETE");
    System.out.println("5: EDIT");

    System.out.print("PLEASE CHOOSE A NUMBER STATED ABOVE : ");
    menu = keyboard.nextInt();
    if (menu == 1)
    System.out.println("YOU ARE EXECUTING ADD OPERATION");
    else if (menu == 2)
    System.out.println("YOU ARE EXECUTING DISPLAY OPERATION");
    else if (menu == 3)
    System.out.println("YOU ARE EXECUTING SEARCH OPERATION");
    else if (menu ==4)
    System.out.println("YOU ARE EXECUTING DELETE OPERATION");
    else if (menu ==5)
    System.out.println("YOU ARE EXECUTING EDIT OPERATION");
    else if (menu == 6)
    System.out.println("EXIT FOR MENU..");

    }while ( menu <= 0);

    switch (menu)
    {
    case 1:

    int course []=new int[7];
    System.out.print("ENTER THE COURSE CODE:");
    coursecode=keyboard.nextInt();


    System.out.print("ENTER THE COURSE NAME:");
    coursename=keyboard.next();

    System.out.print("ENTER THE COURSE CREDIT:");
    coursekrdt=keyboard.nextInt();

    System.out.print("ENTER THE COURSE TIME:");
    coursetime=keyboard.nextDouble();

    System.out.print("ENTER THE VENUE:");
    venue=keyboard.next();

    System.out.print("ENTER THE DAY:");
    day=keyboard.next();

    System.out.print("ENTER THE LECTURE NAME:");
    name=keyboard.next();

    break;

    case 2:
    System.out.print("DISPLAY COURSE :" );
    String display = keyboard.next();

    break;

    case 3:
    System.out.print("SEARCH COURSE :" );
    String search = keyboard.next();
    break;

    case 4:
    System.out.print("DELETE COURSE :" );
    String delete = keyboard.next();
    break;

    case 5:
    System.out.print("EDIT COURSE :" );
    String edit = keyboard.next();
    break;



    }
    }
    System.out.println("\n **********");
    System.out.println("\n thank you... (: ");
    System.out.println("\n **********");




    }
    }

    so now i want to display all that item, i don know how to write a code....

Similar Threads

  1. [SOLVED] JCheckboxes Item Listener
    By remedys in forum What's Wrong With My Code?
    Replies: 9
    Last Post: December 4th, 2012, 08:14 AM
  2. Replies: 0
    Last Post: December 1st, 2012, 01:06 AM
  3. JcomboBox showing only one item
    By ishiro in forum What's Wrong With My Code?
    Replies: 6
    Last Post: May 31st, 2012, 09:29 AM
  4. drag item or insert item into new Jlabel in JPanel
    By qaromi in forum AWT / Java Swing
    Replies: 5
    Last Post: July 6th, 2010, 07:37 PM
  5. [SOLVED] how to delete an item from a form
    By mahdi in forum Java ME (Mobile Edition)
    Replies: 3
    Last Post: August 30th, 2009, 01:06 PM