Results 1 to 4 of 4
  1. #1
    windywong is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default missing return statement need help!!

    sorry for the mistake
    Last edited by windywong; 03-27-2013 at 01:10 PM.

  2. #2
    windywong is offline Member
    Join Date
    Mar 2013
    Posts
    2
    Rep Power
    0

    Default Re: missing return statement need help!!

    sorry...for the mistake
    Attached Thumbnails Attached Thumbnails missing return statement need help!!-error.png   missing return statement need help!!-errror-2.png  
    Last edited by windywong; 03-27-2013 at 01:09 PM.

  3. #3
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: missing return statement need help!!

    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  4. #4
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default Re: missing return statement need help!!

    The original content at #1 was:
    the coding was ok but the is an error on missing return statement ... at the end of coding

    Java Code:
     /**
     * Write a description of class state here.
     * 
     * @author (your name) 
     * @version (a version number or a date)
     */
     import java.util.*;
     import java.io.*;
     import java.util.Scanner;
     public class state
     {
     public static Void main(String[]args) throws FileNotFoundException
     {
     Scanner input = new Scanner (System.in);
    
     String s =" ";
     String[] data, category, option,option2,option3,option4;
     data =new String [50];
     category = new String[50];
     option = new String [50];
     option2 = new String [50];
     option3 = new String [50];
     option4 = new String [50];
    
    
     int [] choice, answer;
     choice = new int[50];
     answer = new int[50];
    
    
     System.out.printf(" Welcome to Quiz Creator",s);
     System.out.printf("What to do?",s);
     System.out.printf("1]Specify number of question you want to do");
     System.out.printf("2]Enter the question CATEGORY");
     System.out.printf("3]Enter the QUESTION for each category");
     System.out.printf("4]Enter the OPTION for each question");
     System.out.printf("5]Provide the ANSWER for each question");
     System.out.printf("6]Then your QUIZ GAME is ready to be play by your friend");
     System.out.printf("Press any key to start the game..");
     System.out.println();
     input.nextLine();
    
    
     System.out.println("How many question you want to create:");
     choice[1]=input.nextInt();
     System.out.println();
     System.out.print('\u000C');
     input.nextLine();
     System.out.println("Please enter your question CATEGORY");
    
     for (int a=0; a<choice[1];a++){
     System.out.print(choice[2]+1+"] ");
     data[a]=input.nextLine();
     choice[2]=choice [2] + 1;
     }
     System.out.print('\u000C');
     System.out.println();
     System.out.println("Please enter your Question");
    
     for (int b=0; b<choice[1];b++){
    
     System.out.println();
     System.out.println(" Category: " + data[b]);
     System.out.printf(choice[3] + 1 +" ] ");
     category[b]=input.nextLine();
     choice[3]=choice[3]+ 1;
     }
     System.out.print('\u000C');
     System.out.println();
     System.out.println("Please enter your question option ");
    
     for (int c=0; c<choice[1];c++)
     {
     System.out.println();
     System.out.println("question : " + category [c]);
     System.out.println();
    
     System.out.printf("1]");
     option[c] = input.nextLine();
    
     System.out.printf("2]");
     option2[c] = input.nextLine();
    
     System.out.printf("3]");
     option3[c] = input.nextLine();
    
     System.out.printf("4]");
     option4[c] = input.nextLine();
    
     System.out.println();
     System.out.println("please set the answerto this question");
     System.out.print("the answer is ");
     answer[c]= input.nextInt();
     input.nextLine();
     System.out.println();
     }
     System.out.println("your quiz game is now ready...press the enter to start ");
     input.nextLine();
     System.out.print('\u000C');
    
     System.out.printf(" welcome to game quiz");
     System.out.printf("Game rule; 1] select 1 topic");
     System.out.printf("2] answer the mcq question");
     System.out.printf("3] each correct answer will given 10 point");
     System.out.printf("4] each incorrect answer will be deducted 10 point");
     System.out.printf("5] the game will be over once your answer the question wrongly");
     System.out.println();
     System.out.printf(" press the enter key to start the game...");
     input.nextLine();
     System.out.print('\u000C');
    
     }
     }
    And at #2:
    i did try to delete or add "}" but i give the same error..

    THREAD CLOSED
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Missing return statement
    By Aenohe in forum New To Java
    Replies: 8
    Last Post: 03-07-2012, 01:03 PM
  2. Missing return statement... but there is one
    By Eleeist in forum New To Java
    Replies: 4
    Last Post: 02-05-2012, 07:24 PM
  3. Missing Return statement =[
    By avirunes in forum New To Java
    Replies: 6
    Last Post: 02-12-2011, 10:34 AM
  4. Missing return statement
    By gkoef in forum New To Java
    Replies: 8
    Last Post: 01-01-2011, 02:52 AM
  5. missing return statement
    By bayan in forum New To Java
    Replies: 6
    Last Post: 04-26-2010, 03:15 PM

Posting Permissions

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