Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2008
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Urgent...deadline tomorrow

    I am new to JAVA. I have to finish this by tomorrow. Can anyone help me finish this up. the req is Create 5 sets of QuestionAnswer. I would also need Java evaluator with it. Thank you...

    package com.ruhul.javaquiz;

    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.IOException;

    /**
    * This class contains all the sets of questions and answers
    * this class is to create 5 question answer.
    *
    * @
    * @version 1-1 27-dec-2008
    */
    public class JavaEvaluator
    {
    // -------------------------------------------------
    // DATA MEMBER(S)
    // -------------------------------------------------
    private String question[];
    private String answer[];
    private final static int TOTAL_QA = 5;

    // -------------------------------------------------
    // CONSTRUCTOR(S)
    // -------------------------------------------------


    // -------------------------------------------------
    // PUBLIC METHOD(S)
    // -------------------------------------------------
    public static void main(String[] args) //this is is to show questions
    throws Exception
    {
    System.out.println("Question");


    }
    public void getuserAnswer(int i) {

    question = new String[TOTAL_QA];

    System.out.println("Question 1");

    }

    // display question to the user:
    System.out.print(strQuestion);

    // Read from the console:
    BufferedReader userInput = new BufferedReader(new InputStreamReader(System.in));

    try
    {
    // get value from console:
    strAnswer = userInput.readLine();
    }
    catch (IOException ioe)
    {
    System.out.println("Error while trying to get input from user. Error=" + ioe.toString());
    // throw new Exception("Error reading input. Error=" + ioe.toString());
    }

    public boolean validateAnswer(String userAnswer) {
    }

    }

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    In the future, please use a more descriptive subject when posting a question. See posting guidelines. This is an example of exactly what not to use for a title >.<

    I have no idea what you're idea of QuestionAnswer object is. I also have no idea what you're looking to do with the JavaEvaluator.
    What I can tell you is this is kinda just hanging out in the middle of you're class. Gotta put it somewhere:
    Code:
    // display question to the user:
    System.out.print(strQuestion);
    
    // Read from the console:
    BufferedReader userInput = new BufferedReader(new InputStreamReader(System.in));
    
    try
    {
    // get value from console:
    strAnswer = userInput.readLine();
    }
    catch (IOException ioe)
    {
    System.out.println("Error while trying to get input from user. Error=" + ioe.toString());
    // throw new Exception("Error reading input. Error=" + ioe.toString());
    }
    I'm thinking in you're main method.

    Anyways, sounds like this is a homework assignment. Please check out our rules (http://www.codingforums.com/rules.htm) and refer to rule 1.5 regarding assignments. We can only direct specific problems, we cannot help you to program it.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •