dialog box

dialog box

hi.write an application containing three parallel arrays that hold 10 elements each.the first array holds four digits student ID numbers,the second holds first names and the third holds the students grade point averages. use dialog boxes to accept a student ID number and display the student's first ame and grade point average.if a match is to found,displays an error messege that includes the invalid ID number and allow the user to search for a new ID number

View Answers

April 10, 2012 at 11:59 AM

import java.util.*;
import javax.swing.*;

class ArrayExample
{
    int ide;
    String fname;
    int gradeAv;

    ArrayExample(int ide,String fname,int gradeAv){
        this.ide=ide;
        this.fname=fname;
        this.gradeAv=gradeAv;
    }
    public int getIde(){
        return ide;
    }

    public String getFname(){
        return fname;
    }

    public int getGradeAv(){
        return gradeAv;
    }
    public static void main(String[] args) 
    {
        ArrayList<ArrayExample> list=new ArrayList<ArrayExample>();

        int id[]=new int[10];
        String name[]=new String[10];
        int average[]=new int[10];
        for(int i=0;i<id.length;i++){
        id[i]=Integer.parseInt(JOptionPane.showInputDialog(null,"Enter ID :"));
        }

        for(int i=0;i<name.length;i++){
        name[i]=JOptionPane.showInputDialog(null,"Enter Name :");
        }

        for(int i=0;i<average.length;i++){
        average[i]=Integer.parseInt(JOptionPane.showInputDialog(null,"Enter Average :"));
        }
        for(int i=0;i<10;i++){
        list.add(new ArrayExample(id[i],name[i],average[i]));
        }
        int inputID=Integer.parseInt(JOptionPane.showInputDialog(null,"Enter ID to search:"));

        for(ArrayExample e:list){
            if(e.getIde()==inputID){
                JOptionPane.showMessageDialog(null,"Name is: "+e.getFname()+" and Average is: "+e.getGradeAv());
            }

        }

    }
}









Related Tutorials/Questions & Answers:
dialog box
dialog box  hello. write an application that displays a series of at least four interview questions and each question should have at least three possible numeric choice answers. at the end of the interview, use a dialog box
dialog box
dialog box  hello. write an application that displays a series of at least four interview questions and each question should have at least three possible numeric choice answers. at the end of the interview, use a dialog box
Advertisements
dialog box
dialog box  hello. write an application that displays a series of at least four interview questions and each question should have at least three possible numeric choice answers. at the end of the interview, use a dialog box
dialog box
dialog box  hello. write an application that displays a series of at least four interview questions and each question should have at least three possible numeric choice answers. at the end of the interview, use a dialog box
dialog box
dialog box  hello. write an application that displays a series of at least four interview questions and each question should have at least three possible numeric choice answers. at the end of the interview, use a dialog box
dialog box
dialog box  hello. write an application that displays a series of at least four interview questions and each question should have at least three possible numeric choice answers. at the end of the interview, use a dialog box
dialog box
dialog box to ask to quit or continue  hello. write an application that displays a series of at least four interview questions and each question... of the interview, use a dialog box to ask whether the user wants to - enter another set
dialog box
dialog box to show latest question  hello. write an application that displays a series of at least four interview questions and each question should... of the interview, use a dialog box to ask whether the user wants to - enter another set
dialog box
. at the end of the interview, use a dialog box to ask whether the user wants
dialog box
of the interview, use a dialog box to ask whether the user wants to - enter another set
dialog box
. at the end of the interview, use a dialog box to ask whether the user wants
dialog box
dialog box  hi.write an application containing three parallel arrays that hold 10 elements each.the first array holds four digits student ID numbers... averages. use dialog boxes to accept a student ID number and display the student's
jquery dialog box center
jquery dialog box center  How to create dialog box with center alignment in jquery..?   $('my-selector').dialog('option', 'position', 'center
Popup dialog box in java
Popup dialog box in java  How to display popup dialog box in java?   Dialog Box- A dialog box is an independent small window which appear... can create popup dialog box. Java swing toolkit provide tow types of dialog box
dialog box size allignment
dialog box size allignment  actually i have 1 button,when clicked on it has to show dialog box containing 14 rows and 3 columns(jtextfield and jlables). i added action listener.is it working fine.but when i resized the dialog
How to call print dialog box through JMenuItem?
How to call print dialog box through JMenuItem?  What is the way to call the print dialog box through JMenuItem to print the current page like we can do in javascript by calling window.print() function
how to call the print dialog box through JMenuItem
how to call the print dialog box through JMenuItem  What is the way to call the print dialog box through JMenuItem to print the current page...could you please help me by sending code
Show Dialog Box in Java
Show Dialog Box in Java - Swing Dialogs       Message dialog box is used to display informative... the message Dialog box. Our program display "Click Me" button on the window
Show input dialog box
Swing Input Dialog Box Example - Swing Dialogs       Input dialog box is very important... the text or the numeric values) in a normal window i.e. the Input Dialog Box
how to let img act as file dialog box?
how to let img act as file dialog box?  dear sir: I'm trying to add... which is the text box plus the button written in it browse,NO. what i want... upload box. so what's the code to do
Dojo Dialog Box
Dojo Dialog Box          In this section, you will learn about the dialog box with tool tips and how to create it in dojo. Try Online: Dialog BoxADS_TO_REPLACE_1 Dialog Box
Display a dialog box with Java Error
Display a dialog box with Java Error   ... you a code that help you in implementation of dialog box with Java Error... the execution of a program using javaw ,the program code display a dialog box name Java
JDialog to create a customized dialog box for entering text data
JDialog to create a customized dialog box for entering text data   Hello sir I wanted to know the code to generate a JDialog to create a customized dialog box for entering text data. The dialog can be split into panes, left pane
How can i Dispose Dialog box From LWUIT Component >
How can i Dispose Dialog box From LWUIT Component >  Hi All, i... to show a dialog when i press key "0". again if i press key "4" the Dialog should...*; public class javaForm extends Component implements ActionListener { Dialog
how to make an image act like upload dialog box
the upload dialog box to be accessed from an image, like an attachment image. i...how to make an image act like upload dialog box  dear sir: i have made HTML page, in that page the user shuuld be able to upload any type of file
how to make an image act like upload dialog box
the upload dialog box to be accessed from an image, like an attachment image. i...how to make an image act like upload dialog box  dear sir: i have made HTML page, in that page the user shuuld be able to upload any type of file
input type dialog box take text and search a list and focus that text - JSP-Servlet
input type dialog box take text and search a list and focus that text  i have a button..when i press it will prompt a dialog box with a text box... then it will search a list which contains data in the same page and if found
Show Font Dialog and Color Dialog
Show Font Dialog and Color Dialog       In this section, you will learn creating color dialog box and font dialog in Java. SWT allows to show Color Dialog and Font Dialog
Show message and confirm dialog box
Show Message and Confirm Dialog Box - Swing Dialogs... types of message box. There are three types of message dialog box that you can... on the second button then the confirm dialog box will open which asks for "
retaining save dialog box even after clicking save button - Java Beginners
retaining save dialog box even after clicking save button  I am... when i open save dialog box and input a file name that is already present... "no" to that dialog box i'm unable to get the save dialog box again.how coulg i
Java error dialog
; A Java dialog box is an independent sub window  that is used to notice a temporary message to the user. The dialog box find its extensive... create an error dialog box we need JOptionPane swing. Understand  with Example
Java Message Box
, customizing the component the dialog display and specify where message box...Java Message Box In this tutorials you will learn about how to create Message Box in Java. Java API provide a class to create a message Box in java
Flex Alert Box example
Flex Alert Box example       Alert box is a dialog box that appears on window with some... Box is also referred to as pop-up window.  Among these two words
Dojo Show and Hide Dialog
for showing and hiding the dialog box.  show(): This method is used to display the dialog box. hide(): This method is used to hide the dialog...Dojo Show and Hide Dialog        
Dojo Dialog Box
Dojo Dialog Box        ... box with tool tips and how to create it in dojo. Dialog Box : Dialog box is a rectangular GUI box that either requests or provides information. Some dialog
Dojo Dialog Box
Dojo Dialog Box        ... box with tool tips and how to create it in dojo. Dialog Box : Dialog box is a rectangular GUI box that either requests or provides information. Some dialog
jQuery UI Widget : Dialog
'). To create a dialog box containing text of a element like div, we... jQuery UI Widget : Dialog       jQuery UI Widget : Dialog This widget
ModuleNotFoundError: No module named 'dialog'
ModuleNotFoundError: No module named 'dialog'  Hi, My Python... 'dialog' How to remove the ModuleNotFoundError: No module named 'dialog'... to install padas library. You can install dialog python with following command
Dialog Frame focus - Framework
Dialog Frame focus  Is it possible somehow to focus/activate/select a modeless dialog, when the focus is lost? i.e. In the Modeless dialog I can visit the parent frame also. But on some event(like a button), I want my dialog
ModuleNotFoundError: No module named 'box-box'
ModuleNotFoundError: No module named 'box-box'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'box-box' How to remove the ModuleNotFoundError: No module named 'box-box
ModuleNotFoundError: No module named 'box-box'
ModuleNotFoundError: No module named 'box-box'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'box-box' How to remove the ModuleNotFoundError: No module named 'box-box
J2me AddCommands and Dialog problems
J2me AddCommands and Dialog problems  can u explain why "back" command is on left side? since it is added after "screen" and its priority is less... to place in right side, how to place it?" one more question "how to stop a dialog
HTML in the box
HTML in the box  Can I use any HTML in the box
input box
input box  give me the code of input box in core java
input box
input box  give me the code of input box in core java
Version of com.jaredrummler>blocking-dialog dependency
List of Version of com.jaredrummler>blocking-dialog dependency
Version of com.jrummyapps>blocking-dialog dependency
List of Version of com.jrummyapps>blocking-dialog dependency
Version of com.triangleleft>assert-dialog dependency
List of Version of com.triangleleft>assert-dialog dependency
ModuleNotFoundError: No module named 'mac-dialog'
ModuleNotFoundError: No module named 'mac-dialog'  Hi, My Python... 'mac-dialog' How to remove the ModuleNotFoundError: No module named 'mac-dialog' error? Thanks   Hi, In your python environment you
ModuleNotFoundError: No module named 'dialog-py'
ModuleNotFoundError: No module named 'dialog-py'  Hi, My Python... 'dialog-py' How to remove the ModuleNotFoundError: No module named 'dialog... have to install padas library. You can install dialog-py python with following

Ads