GradeBook displayMessage error

I am using jdk.5.0_18 but still I am getting the error that GradeBook class symbol not found in this simple code.
public class DataGradeBook{
  public static void main(String args []){
    GradeBook xGradeBook = new GradeBook();
    xGradeBook.displayMessage();
}

"My fridge is broken."
"Try plugging it in."
"Oh, don't worry... It's a Kelvinator."
"WTF?"
You need to start communicating much more clearly or nobody will bother to help you. It's up to you.
* Don't even talk to me until you've:
    (a) [googled it|http://www.google.com.au/] and
    (b) looked it up in [Sun's Java Tutorials|http://java.sun.com/docs/books/tutorial/] and
    (c) read the relevant section of the [API Docs|http://java.sun.com/javase/6/docs/api/index-files/index-1.html] and maybe even
    (d) referred to the JLS (for "advanced" questions).
* [Good questions|http://www.catb.org/~esr/faqs/smart-questions.html#intro] get better Answers. It's a fact. Trust me on this one.
    - Lots of regulars on these forums simply don't read badly written questions. It's just too frustrating.
      - FFS spare us the SMS and L33t speak! Pull your pants up, and get a hair cut!
    - Often you discover your own mistake whilst forming a "Good question".
    - Many of the regulars on these forums will bend over backwards to help with a "Good question",
      especially to a nuggetty problem, because they're interested in the answer.

Similar Messages

  • How to verify version of SDK being used

    Hi, I just installed the Studio Creator a few days ago. I'm new to Java, and in my first Java class they have us using JCreator, and I never had any problems with that. But now, I seem to be having a problem with the printf function that I wasn't having in JCreator. I've read up on it, and understand that a lot of the printf problems were caused by having the wrong platform version installed, but I have the most recent update and am still getting the printf error. As it seems to be related specifically to the Studio Creator I put it here. I can't figure out how to 1) verify the platform version that Studio Creator may be referencing and 2) How to update it.
    Just to give some background on the error, here is the basic program that I was trying out just to make sure it worked:
    public class GradeBook {
    /** Creates a new instance of GradeBook */
    public void displayMessage(String courseName){
    System.out.printf("Welcome to the gradebook for\n%s!",
    courseName);
    }//end method displayMessage
    }//end class GradeBook
    The error occurring here is:
    Cannot find Symbol
    symbol  : method printf(java.lang.String,java.lang.String)
    location: class java.io.PrintStream
    System.out.printf("Welcome to the gradebook for\n%s!",
    *1 error*
    Sun creator seems to be reading the Java 2 Platform Standard Edition 5.0. At least that's what comes up when I look at Dynamic Help. When I looked up the printf method there, it appears that there is no method that just accepts a single string, or even seems to work anything like the printf method in JCreator.
    Here is the Test program that I was using to call it.
    import java.util.Scanner;
    public class GradeBookTest {
    //main method begins program execution
    public static void main( String args[]){
    /** Creates a new instance of GradeBook*/
    Scanner input = new Scanner (System.in);
    GradeBook myGradeBook = new GradeBook();
    System.out.println("Please enter the course name: ");
    String nameOfCourse = input.nextLine();
    System.out.println();
    //call myGradeBook's displayMessage method
    myGradeBook.displayMessage(nameOfCourse);
    If this needs to be in a different area or if I left out some pertinent information, please tell me. I'm genuinely stumped. Thanks.

    In the main menu go to Help -> About
    In the About window click on 'Details' tab. You'll see the Java version listed. You'll also see the Java Home variable value.
    To add another Java version:
    Right click on the Project node -> Properties . In the properties window select libraries node. You'll see Java Platform dropdown list. You can choose another another Java version here. If the list does not show the java version you are looking for, click the Manage Platform button, and then Add Platform. (Ofcourse you need to have ther version of Java you want to use already installed on your computer first)
    Radhika
    http://blogs.sun.com/Radhika

  • Help with Declaring a Class with a Method and Instantiating an Object

    hello all i am having trouble understanding and completing a lab tutorial again!
    im supposed to compile an run this code then save work to understand how to declare aclass with a method an instantiate an object of the class with the following code
    // Program 1: GradeBook.java
    // Class declaration with one method.
    public class GradeBook
    // display a welcome message to the GradeBook user
    public void displayMessage()
    System.out.println( "Welcome to the Grade Book!" );
    } // end method displayMessage
    } // end class GradeBook
    // Program 2: GradeBookTest4.java
    // Create a GradeBook object and call its displayMessage method.
    public class GradeBookTest
    // main method begins program execution
    public static void main( String args[] )
    // create a GradeBook object and assign it to myGradeBook
    GradeBook myGradeBook = new GradeBook();
    // call myGradeBook's displayMessage method
    myGradeBook.displayMessage();
    } // end main
    } // end class GradeBookTest4
    i saved above code as shown to working directory filename GradeBookTest4.java
    C:\Program Files\Java\jdk1.6.0_11\bin but recieved error message
    C:\Program Files\Java\jdk1.6.0_11\bin>javac GradeBook4a.java GradeBookTest4.java
    GradeBookTest4.java:2: class, interface, or enum expected
    ^
    GradeBookTest4.java:27: reached end of file while parsing
    ^
    2 errors
    can someone tell me where the errors are because for class or interface expected message i found a solution which says 'class? or 'interface' expected is because there is a missing { somewhere much earlier in the code. i dont know what "java:51: reached end of file while parsing " means or what to do to fix ,any ideas a re appreciated                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Doesn't solve your problem, but this works for me...
    public class GradeBook
      public void displayMessage() {
        System.out.println( "Welcome to the Grade Book!" );
      public static void main( String args[] ) {
        try {
          GradeBook gradeBook = new GradeBook();
          gradeBook.displayMessage();
        } catch (Exception e) {
          e.printStackTrace();
    }

  • Trying to get the input parameter of a web service fxn based on table value

    Hello--
    I am new to ADF and Jdev 11g (I am a forms developer). I had created a web service from a pl/sql stored db package. I can successfully execute a function with an input parameter from ADF Faces.
    Instead of the input parameter being enterable by the user, I would like it to be based on a selected ADF table column value. How would I correlate the selected row column value as the function input parameter?
    I played with an ADF output text based on the ADF table column with the PartialTriggers value set to the ADF table...which updates the output text based on the column selected. Do I use some sort of partial trigger on the input parameter?
    From a forms point of view, I am looking for the "Copy Value from Item" property :)

    Hi,
    Not sure if this would help you.
    But if your table is bound to a ViewObject, it will be easier to get the current selection.
    Supose your table is bound to iterator1.
    In your backBean code:
    DCBindingContainer dcBindings = (DCBindingContainer)getBindings();
    DCIteratorBinding iterator =dcBindings.findIteratorBinding("iterator1");
    Row row = iterator.getCurrentRow();
    Object selectedValue = row.getAttarbute(<value of the column you are looking for>);
    public BindingContainer getBindings() throws Exception {
    try {
    if (this.bindings == null) {
    FacesContext fc = FacesContext.getCurrentInstance();
    this.bindings =
    (BindingContainer)fc.getApplication().evaluateExpressionGet(fc,
    "#{bindings}",
    BindingContainer.class);
    return this.bindings;
    } catch (Exception ex) {
    displayMessage("Error occurred. Please contact your IT Adminstrator.");
    return this.bindings;
    Let me know if this helps.
    -Makrand

  • How i can make the code execute after file finish downloading

    Hi,
    i have a code that downloads a file
    then some code after , my problem is that code after does not wait to the file finish downloading
    how i can achieve that
    code is:
    String contentType = "application/x-download" ;
    FacesContext fc = FacesContext.getCurrentInstance();
    HttpServletResponse response =
    (HttpServletResponse)fc.getExternalContext().getResponse();
    response.setHeader("Content-Disposition",
    "attachment; filename=" + l_patch_name + ".zip");
    response.setContentType(contentType);
    try
    FileInputStream fis=new FileInputStream("c:\\patches\\"+ l_patch_name + ".zip");
    OutputStream os= response.getOutputStream();
    int byteRead;
    while(-1 != (byteRead = fis.read()))
    os.write(byteRead);
    os.close();
    if (fis != null)
    fis.close();
    catch(Exception e){
    DisplayMessage("Error in downloading the file");
    // now update the token
    OperationBinding operationBinding2 =
    bindings.getOperationBinding("UpdateTokenField");
    String UpdateTokenResult = (String)operationBinding2.execute();
    DisplayMessage(UpdateTokenResult);
    // now refresh the table
    OperationBinding operationBinding3 =
    bindings.getOperationBinding("RefreshPatches");
    Object result3 = operationBinding3.execute();

    Hi,
    the above code is excuted succesfully, but if i have
    return "Navigation" ;
    it is not working
    any idea why??????????

  • Applet socket problem in client-server, urgent!

    Dear All:
    I have implemented a client server teamwork environment. I have managered to get the server running fine. The server is responsible for passing messages between clients and accessing Oracle database using JDBC. The client is a Java Applet. The code is like the following. The problem is when I try to register the client, the socket connection get java.security.AccessControlException: access denied(java.net.SocketPermission mugca.its.monash.edu.
    au resolve)
    However, I have written a Java application with the same socket connection method to connect to the same server, it connects to the server without any problem. Is it because of the applet security problem? How should I solve it? Very appreciate for any ideas.
    public class User extends java.applet.Applet implements ActionListener, ItemListener
    public void init()
    Authentication auth = new Authentication((Frame)anchorpoint);
    if(auth.getConnectionStreams() != null) {
    ConnectionStreams server_conn = auth.getConnectionStreams();
    // Authenticates the user and establishes a connection to the server
    class Authentication extends Dialog implements ActionListener, KeyListener {
    // Object holding information relevant to the server connection
    ConnectionStreams server_conn;
    final static int port = 6012;
    // Authenticates the user and establishes connection to the server
    public Authentication(Frame parent) {
    // call the class Dialog's constructor
    super(parent, "User Authentication", true);
    setLocation(parent.getSize().width/3, parent.getSize().height/2);
    setupDialog();
    // sets up the components of the dialog box
    private void setupDialog() {
    // create and set the layout manager
    //Create a username text field here
    //Create a password text field here
    //Create a OK button here
    public void actionPerformed(ActionEvent e) {
    authenticateUser();
    dispose();
    // returns the ConnectionStreams object
    public ConnectionStreams getConnectionStreams() {
    return(server_conn);
    // authenticates the user
    private void authenticateUser() {
    Socket socket;
    InetAddress address;
    try {
    // open socket to server
    System.out.println("Ready to connect to server on: " + port);
    socket = new Socket("mugca.its.monash.edu.au", port);
    address = socket.getInetAddress();
    System.out.println("The hostname,address,hostaddress,localhost is:" + address.getHostName() + ";\n" +
    address.getAddress() + ";\n" +
    address.getHostAddress() + ";\n" +
    address.getLocalHost());
    catch(Exception e) {
    displayMessage("Error occured. See console");
    System.err.println(e);
                                  e.printStackTrace();
    }

    Hi, there:
    Thanks for the help. But I don't have to configure the security policy. Instead, inspired by a message in this forum, I simply upload the applet to the HTTP server (mugca.its.monash.edu.au) where my won server is running. Then the applet is download from the server and running fine in my local machine.
    Dengsheng

  • Errors in the program

    Hi all,
    Im doing the extension of controller by adding additional functionality of submitting a concurrent program from OAF page. but im getting following errors .pls help
    Code:
    package petrofac.oracle.apps.ota.admin.enrollment.webui;
    import com.sun.java.util.collections.Vector;
    import oracle.apps.fnd.cp.request.ConcurrentRequest;
    import oracle.apps.fnd.cp.request.RequestSubmissionException;
    import oracle.apps.fnd.framework.OAException;
    import oracle.apps.fnd.framework.server.OADBTransaction;
    import oracle.apps.fnd.framework.server.common.OAApplicationModule;
    import oracle.apps.fnd.framework.webui.OAPageContext;
    import oracle.apps.fnd.framework.webui.beans.OAWebBean;
    import oracle.apps.ota.admin.enrollment.webui.LrnrEnrollmentMassUpdateCO;
    import oracle.jbo.ApplicationModule;
    public class ExtLrnrEnrollmentMassUpdateCO extends LrnrEnrollmentMassUpdateCO {
    public ExtLrnrEnrollmentMassUpdateCO() {
    * @param pagecontext
    * @param webbean
    public void processRequest(OAPageContext pagecontext, OAWebBean webbean)
    super.processRequest(pagecontext, webbean);
    public void processFormRequest(OAPageContext pageContext, OAWebBean webBean)
    super.processFormRequest(pageContext, webBean);
    if (pageContext.getParameter("Apply") != null)
    String status = pageContext.getParameter("Enrollment Status");
    String CRname = pageContext.getParameter("Course Name");
    String CLname = pageContext.getParameter("Class Name");
    OAApplicationModule am = (OAApplicationModule)pageContext.getApplicationModule(webBean);
    OADBTransaction tx = am.getOADBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(pConncection);
    if (status.equals("Attended"))
    public int submitCPRequest(String CRname,String CLname) {
    try {
    String applnName = "OTA"; //Application that contains the concurrent program
    String cpName = "XXCERT"; //Concurrent program name
    String cpDesc = "Certifcate Program"; // concurrent Program description
    Vector cpParams = new Vector();
    cpParams.addElement(CRname);
    cpParams.addElement(CLname);
    int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpParams);
    tx.commit();
    return requestId;
    catch (RequestSubmissionException e)
    OAException oe = new OAException(e.getMessage());
    oe.setApplicationModule((ApplicationModule)this);
    throw oe;
    else if (status.equals("Enrolled"))
    public int submitCPRequest(String CRname,String CSname)
    try {
    String applnName = "OTA"; //Application that contains the concurrent program
    String cpName = "XXJOINDTL"; //Concurrent program name
    String cpDesc = "Joining Details Program"; // concurrent Program description
    Vector cpParams = new Vector();
    cpParams.addElement(CRname);
    cpParams.addElement(CSname);
    int requestId = cr.submitRequest(applnName, cpName, cpDesc, null, false, cpParams);
    tx.commit();
    return requestId;
    catch (RequestSubmissionException e)
    OAException oe = new OAException(e.getMessage());
    oe.setApplicationModule((ApplicationModule)this);
    throw oe;
    Errors:
    Error(42,12): modifier public not allowed here
    Error(42,31): ; expected
    Error(14,49): Constants not found in interface oracle.apps.ota.common.Constants in interface oracle.apps.ota.admin.common.Constants in interface oracle.apps.ota.shared.enrollment.common.Constants in class oracle.apps.ota.shared.enrollment.webui.EnrollmentCO in class oracle.apps.ota.shared.enrollment.webui.EnrollmentUpdateCO in class oracle.apps.ota.admin.enrollment.webui.LrnrEnrollmentMassUpdateCO

    Ankit wrote:
    hi all i have a program which is written in the book but when i am writing it in Netbeans IDE then the program is showing lots of errors. Here is the program
    Please tell me what is the problem why it is creating an error.
    Package declaration missing here
    import java.util.Scanner;
    // Gradebook class that contains a courseName instance variable and methods to get and set its value.
    public class GradeBook
    private String courseName; // course name for this grade book
    // method to set the course name
    public void setCourseName(String name)
    courseName = name; // store the course name
    }//End method setCourseName
    //Method to retrieve the courseName
    public String getCourseName()
    return courseName;
    }//End method getCourseName
    //display a welcome message to the gradeBook user
    public void displayMessage()
    //This statement calls getCourseName to get the
    //name of the course this gradebook represents
    System.out.printf("Welcome to the gradeBook for\n%s!\n", getCourseName());
    package declaration/required imports missing here
    public class GradeBookTest
    public static void main(String []args)
    Scanner input = new Scanner( System.in );
    GradeBook myGradeBook = new GradeBook();
    System.out.printf("Initial course name is:%s\n\n",
    myGradeBook.getCourseName());Extra curly brace
    }//prompt for and read course name
    System.out.println("Please enter the course name:");Typo in method name. Its nextLine, not nextline
    String theName = input.nextline();Typo here, it should be myGradeBook (as instantiated above) and not myGradebook
    myGradebook.setCourseName(theName);
    System.out.println();
    myGradeBook.displayMessage();
    }Next time, try reading the errors the compiler throws, it has all the information you need to fix errors in your program.
    Edited by: maheshguruswamy on Dec 9, 2011 8:52 AM

  • Catch error in javascript when using SAP script

    All,
    I have a issue when using Javascript to control the SAP GUI in that I get a "syntax Error" raised by Internet Explorer if I attempt to get the SAPGUI runtime object from the runtime object table if SAP is not already running.
    For example:
    I have a javascript function embedded in a web page as follows:
    <script type="text/javascript">
    function displaymessage()
    var sapgui;
    var application;
    var connection;
    if (typeof(application) == "undefined")
       sapgui      = GetObject("SAPGUI");
       application = sapgui.GetScriptingEngine();
    if (typeof(connection) == "undefined")
       connection = application.children(0);
    if (typeof(session) == "undefined")
       session = connection.children(0);
    if (typeof(WScript) != "undefined")
       WScript.connectObject(session, "on");
       WScript.connectObject(application, "on");
    session.findById("wnd[0]/tbar[0]/okcd").text = "fb50";
    session.findById("wnd[0]").sendVKey(0);
    session.findById("wnd[1]/usr/ctxtBKPF-BUKRS").text = "0001";
    session.findById("wnd[1]/usr/ctxtBKPF-BUKRS").caretPosition = 4;
    session.findById("wnd[1]").sendVKey(0);
    </script>
    I have a simple HTML page with a button on it that calls the function.
    If I have already launched SAP GUI and logged in the code works fine and atuomatically navigates me to FB50.
    If SAP is not active and logged in then I get a syntax error!  The error is raised by IE when the GetObject("SAPGUI") is executed.
    Can anyone please help by either:
    a) explaining how I can catch this error in javascript
    b) suggesting a different way to call the GetObject
    c) suggesting a way that I can auto launch SAP to log people in if it is not already active.
    Note - Using VB is not an option as I need to embed the working Javascript code in a Siebel thin client application which only uses Javascript.
    All help welcome. Thanks

    Hey Gunter,
    Thanks much, that did work.
    The other error I spoke of was fixed with the new database, so apparently the two errors I spoke of weren't related.
    You seem to be a good help to this forum, thank you for that.... fixing my problem relieved me from much stress.
    Cheers,
    Derek Miller
    Dreamweaver Enthusiast

  • VLookup formula contains reference error:

    I am using a spreadsheet to grade playing tests based on a series of rubrics.  I have a cell that adds up the total of points the student earns for the test.  In another table, I have a chart that converts the rubric score to a 100 point based scale to enter in my gradebook.  I am trying to write a formula that looks at the cell where the total number of points is and then looks at the table and matches that total to the converted grade.  (Example: student receives a total of 35 points based on the rubrics - it converts to an 80 for the gradebook). I  have the following formula:
    =VLOOKUP(N39,Table 2 :: A1:A51,Table 2 :: B1:B51,FALSE)
    N39 has a SUM formula that adds up the rubric points
    Table 2 column A has the rubric grades
    Table 2 column B has the converted grades
    I put FALSE, as I need an exact match
    I am getting an error: "the formula contains an invalid reference"  I'm not used to using this formula and I just can't figure out what I am doing wrong.  I would like to get this working so I can send the test form to the students via e-mail and not kill as many trees.  Suggestions would be welcome

    Hi cslviola,
    I see two issues here.
    You wrote:
    "N39 has a SUM formula that adds up the rubric points
    Table 2 column A has the rubric grades
    Table 2 column B has the converted grades
    I put FALSE, as I need an exact match"
    Does your lookup table include every possible value of the sum of the rubric grades?
    A "close match" in these functions means "the largest value that is less than or equal to the search value."
    If every possible search value is included in column a of the lookup table, then a close match will alway be a match to the value that is equal to the search value (ie. an exact match).
    If there are possible rubric point sums that are not included in the table, then a function requiring an exact match will return an error if he search vaue (the rubric point sum) is one of the values mising from column A of the Lookup table. Unless that is your expected result, you do not need (and do not want) an exact match.
    Regarding your formula:
    I see some confusion here between the syntax requirements of LOOKUP and those of VLOOKUP.
    =VLOOKUP(N39,Table 2 :: A1:A51,Table 2 :: B1:B51,FALSE)
    Here's the LOOKUP syntax:
    LOOKUP(search-for, search-where, result-values)
    As a LOOKUP formula, your formula above would be:
    =LOOKUP(N39,Table 2::A1:A51,Table 2::B1:B51)
    LOOKUP always requires only a close match, which is the better choice for your issue.
    The syntax for VLOOKUP is a bit different:
    VLOOKUP(search-for, columns-range, return-column, close-match)
    search-for is the same as for LOOKUP, but the next argument is different.
    columns range must specify all of the columns and rows making up the lookup table. In your case, that's columns A and B of Table 2. The search column is always the leftmost column of the Lookup table.
    return column is specified as the number corresponding to the position if the return column in the Lookup table. For your case, the return column is column 2 (NOT because it is column B, but because it is the second column of the Lookup table. If your Lookup table consisted of cells J1:K51, the return column (K) would still be column 2)
    close value, if set as FALSE, requires an exact match of the search value and the value it finds in the search column; set to TRUE, or omitted from the formula means a close match (as defined above) is aceptable.
    Your formula as a VLOOKUP formula, would look like this:
    =VLOOKUP(N39,Table 2::A1:B51,2,FALSE)   (requiring an exact match)
    OR
    =VLOOKUP(N39,Table 2::A1:B51,2)   (requiring a close match, as defined above)
    Personally, I'd go for the LOOKUP version here.
    Regards,
    Barry

  • Help Finding Compiler error solution please

    When I type in Javac at C prompt to this code I receive the following errors
    Code:
    public class PayrollExecute
    // main method
    public static void main( String args[] )
    // Display welcome message
    Payroll myPayroll = new Payroll( "Payroll " );
    mypayroll.displayMessage(); // display first message
    myPayroll.determineWeeklyRate(); // find weekly rate
    } // end main method
    } // end class
    Error:
    C:\>Javac Payroll.java
    Payroll.java:1: class PayrollExecute is public, should be declared in a file named PayrollExecute.java
    public class PayrollExecute
    ^
    .\Payroll.java:1: class PayrollExecute is public, should be declared in a file named PayrollExecute.java
    public class PayrollExecute
    ^
    Payroll.java:13: cannot access Payroll
    bad class file: .\Payroll.java
    file does not contain class Payroll
    Please remove or make sure it appears in the correct subdirectory of the classp
    th.
    Payroll myPayroll = new Payroll( "Payroll " );
    ^
    3 errors
    C:\>

    The name of the file you are compiling needs to be PayrollExecute.java OR remove the "public" before public class PayrollExecute.
    Either choice should do the trick.

  • Average Grade using If else..1 error please help

    Hi all..Okay I have to do this program that lets you input student info and 3 grades, figures out the average, and the letter grade using if else statements. I have only one error and cannot figure it out. Here is the error and a copy of my program. If someone can help me figure it out, I would appreciate it; I have tried everything I can think of. Thank you.
    Error: Illegal start of expression for this line           {if (avg >=80)&&(avg <90)
    Here is my program:
    class my_main
         public static void main (String [] args) throws IOException
         String Name;
         String ID;
         double grade1;
         double grade2;
         double grade3;
         BufferedReader stdin;
         stdin= new BufferedReader (new InputStreamReader (System.in));
         System.out.println ("Please enter the following information: ");
         System.out.print ("Student Name: ");
         Name= stdin.readLine();
         System.out.print ("Student ID: ");
         ID= stdin.readLine();
         System.out.print ("Grade One: ");
         grade1= Double.parseDouble(stdin.readLine());
         System.out.print ("Grade Two: ");
         grade2= Double.parseDouble(stdin.readLine());
         System.out.print ("Grade Three: ");
         grade3=Double.parseDouble(stdin.readLine());
         gradebook pt= new gradebook (grade1, grade2, grade3, Name, ID);
         pt.display ();
    class gradebook
         int LG;
         double gr1;
         double gr2;
         double gr3;
         double avg;
         String SName;
         String IDNO;
         public gradebook (double grade1, double grade2, double grade3, String Name, String ID) throws ArithmeticException
         gr1= grade1;
         gr2= grade2;
         gr3= grade3;
         IDNO=ID;
         SName=Name;
         avg=(gr1+gr2+gr3)/3;
              if (avg >= 90)
              LG='A';
              else
              {if (avg >=80)&&(avg <90)
                 LG='B';
              else
              {if (avg >=70)&&(avg <80)
                       LG='C';
              else
              {if (avg >=60)&&(avg <70)
                 LG='D';
              else
              {if (avg <= 59)
                 LG='F';
         void display()
         System.out.println ("Student Grades for "+SName);
         System.out.println ("Student ID Number: "+IDNO);
         System.out.println ("Grade One: "+gr1);
         System.out.println ("Grade Two: "+gr2);
         System.out.println ("Grade Three: "+gr3);
         System.out.println ("Average: "+avg);
         System.out.println ("Letter Grade: "+LG);
    }

    Hi ,
    There were some problems like you have defined any main method etc. I have corrected your code, and it is working....
    Sandeep
    * my_main.java
    * Created on October 6, 2003, 12:53 PM
    import java.io.*;
    * @author sandeep
    public class my_main {
    public static void main(String args[]) throws IOException {
    String Name;
    String ID;
    double grade1;
    double grade2;
    double grade3;
    BufferedReader stdin;
    stdin= new BufferedReader(new InputStreamReader(System.in));
    System.out.println("Please enter the following information: ");
    System.out.print("Student Name: ");
    Name= stdin.readLine();
    System.out.print("Student ID: ");
    ID= stdin.readLine();
    System.out.print("Grade One: ");
    grade1= Double.parseDouble(stdin.readLine());
    System.out.print("Grade Two: ");
    grade2= Double.parseDouble(stdin.readLine());
    System.out.print("Grade Three: ");
    grade3=Double.parseDouble(stdin.readLine());
    gradebook pt= new gradebook(grade1, grade2, grade3, Name, ID);
    pt.display();
    class gradebook {
    int LG;
    double gr1;
    double gr2;
    double gr3;
    double avg;
    String SName;
    String IDNO;
    public gradebook(double grade1, double grade2, double grade3, String Name, String ID) throws ArithmeticException {
    gr1= grade1;
    gr2= grade2;
    gr3= grade3;
    IDNO=ID;
    SName=Name;
    avg=(gr1+gr2+gr3)/3;
    if (avg >= 90) {
    LG='A';
    } else if ((avg >=80)&&(avg <90)) {
    LG='B';
    } else if ((avg >=70)&&(avg <80)) {
    LG='C';
    } else if ((avg >=60)&&(avg <70)) {
    LG='D';
    } else if (avg <= 59) {
    LG='F';
    void display() {
    System.out.println("Student Grades for "+SName);
    System.out.println("Student ID Number: "+IDNO);
    System.out.println("Grade One: "+gr1);
    System.out.println("Grade Two: "+gr2);
    System.out.println("Grade Three: "+gr3);
    System.out.println("Average: "+avg);
    System.out.println("Letter Grade: "+LG);

  • MacBook Air update error

    I updated my MacBook Air yesterday and can no longer access my Pearson Powerschool gradebook without an error.
    java.lang.ClassNotFoundException:com.pearson.powerschool.system.Startup
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at com.sun.jnlp.JNLPClassLoader.findClass(JNLPClassLoader.java:348)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:171)
        at org.xito.reflect.Reflection.findClass(Reflection.java:87)
        at org.xito.reflect.Reflection.findClass(Reflection.java:74)
        at com.pearson.powerschool.gradebook.ServiceManager.initialize(ServiceManager.java :94)
        at com.pearson.powerschool.gradebook.Main.startUI(Main.java:112)
        at com.pearson.powerschool.gradebook.Main.main(Main.java:382)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.ja va:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.javaws.Launcher.executeApplication(Launcher.java:1953)
        at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1886)
        at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1648)
        at com.sun.javaws.Launcher.run(Launcher.java:141)
        at java.lang.Thread.run(Thread.java:695)
    Any thoughts on what this means and how I can fix it?
    Or any thoughts as to why I sometimes get this message too: "launchGradeBook.jnlp" can't be opened because it is from an unidentified developer?

    Hi lasabeth14,
    If you are having Java issues after upgrading to Mavericks, you may want to make sure you have installed the most recent Java update for OS X. You may find the following page helpful:
    Apple Support: Java for OS X 2013-005
    http://support.apple.com/kb/dl1572
    Regards,
    - Brenden

  • Unsatisfied Link error.

    Hello ,
    I am new to JNI.
    I am getting an Unsatified link error.
    My code is
    public class DisplayMessage {
         static {
               Runtime.getRuntime().loadLibrary("MessaageHandler") ;
                         public static void main(String args[]) {
                                     printMessage() ;
                      public static native void printMessage() ;
    }I have checked the path of my dll. there dont seem to be problem in that. It seems as if the system is not able to find method printMessag() present in the dll.
    Here is the error that I am getting.
    Exception in thread "main" java.lang.UnsatisfiedLinkError: printMessage
         at DisplayMessage.printMessage(Native Method)
         at DisplayMessage.main(DisplayMessage.java:11)Please point me out, what mistake i am doing.

    Hi Oven,
    Thanks for your reply.
    But I have already tried what you had suggested.
    I tried runing my program with the -D option. I have also tried including my dll in the system path.
    I tried running the program after copying my dll at all places like the current directory, Systems directory, The JRE directory, the lib/ext directory and severel other possibl;e places. But still I get the same error.
    I was getting a different error initially which said.
    "No main found in MessageHandler"
    This I suppose I was getting because the path of the Dll was not set properly.
    But now the error is related to the method defined in the dll "printMessage()".
    I have also checked the signature of the method. Everything seems to be fine.
    Please anybody suggest me a way.
    Also If anyone can tell me how I can call a win32 API through java. I hope the way to call a win32 API is the same as calling printMessage() .
    For example I want to call a API InitiateSystemShutDown() in a dll. advapi32.dll.

  • GradeBook class

    I am creating a void method which accepts nams and grades from 1 to 20 students. The condition is that this should stop when the user is finished or when the array is full. I need to validate the grades to be only A, B, C, D, OR F
    When I made the condition it shows me an error:
    exception in thread "main" java.lang NullPointerException
    at GradeBook.input(GradeBook.java:29)
    at Program4.main(Program4.java:8)
    my methods is as follow:
    public void input()
    final String LIMIT = "QUIT";
    int index = 0;
    System.out.println("\nPlease enter grades and names (Enter QUIT to stop). ");
    System.out.println("\nStudent # " index " :");
    names[index] = Keyboard.readString();
    index++;
    while (!(names[index].equals(LIMIT)))
    count++;
    System.out.print("Exam Score: ");
    grades[index] = Keyboard.readChar();
    while((grades[index] < 'A') && (grades[index] > 'D')||(grades[index]!=('F')))
    System.out.println("\nINVALIDE GRADE. PLEASE REENTER. ");
    grades[index] = Keyboard.readChar();
    System.out.println("\nStudent # " index " : ");
    names[index] = Keyboard.readString();
    names[index] = names[index].toUpperCase();
    index++;
    Cold you help me to see the errors...?

    Hi
    Why do i get this error when trying to run a code like
    this:By 'run' I assume you mean you are entering a command like "java App" and you get the error. That's because the code you posted does not include a "public static void main(String[] args)" method. A class must contain this method to be launched as an application using the java command. The code you posted is an Applet, normally run using a web browser and HTML code.

  • Untrusted Connection error message on home computer, but can connect fine from work

    I have been connecting to this site for a while without problems (an online gradebook for son's school), but yesterday when I tried to log in from home machine, I got the "This connection is Untrusted" error message. However, I was able to log in without a problem from work today, but having the same problem at home again. Is it an indication that my home connection is somehow compromised? How do I check? Other sites seem to working fine.

    It is usually better to install missing certificates by visiting another website that sends them then by making an exception.<br />
    You can check the certificate chain on the working computer by clicking the Site Identity Button (favicon) on the location bar > More Information > View Certificate > Details and export missing intermediate certificates and import them on the other computer.
    You can remove exceptions on the Servers tab in the Certificate Manager.
    *Tools > Options > Advanced : Encryption: Certificates - View Certificates

Maybe you are looking for

  • Adding a keyword to several images in A2 - not working

    I imported new RAW files into A 2 today for the first time. I then started my normal routine of adding some of keywords to all of the images at once. I did a select all, dragged over "Wildlife Refuge", but it was only applied to that one image instea

  • Can I use the iPad charger as a live USB hub?

    If i was to use my iPad charger (after removing the cable), as a live USB hub for my external speakers, would that cause damage to the charger? Would this set up work? I've blown up a mac charger before with these experiments, don't wanna do another.

  • Urgent help needed-----Internet Gateway & VPN Gateway---???---

    Hi All, First of all apologies as I am new to Cisco. I have 2 sites Main site routers 1 is configured for internet having IP address 10.10.10.48. 2nd router is configured for VPN on separate data link configured with bgp protocol having ip address 10

  • Final cut pro x lost

    I recently had my Mac laptop cleaned for running slow, however, I had final cut installed bt it's not there now. How to redownload it?

  • Adjustment brushes just plain stinks....

    Really disappointed in both CR and LR2 as the adjustment brush is unusable. If I open a raw image in Photoshop CS4 and try to use the adjustment brush it consistently crashes PS. If I use the adjustment brush in LR2 after a couple of strokes the prog