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 4 of 4

Thread: can someone plz help me...

  1. #1
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Angry can someone plz help me...

    Hi, just started java course, and will like to get some help here, this program runs in eclipse but not in web browser I dont know how to make it an Applet, I will appreciate if some one can look it and give me a hand, thank you..


    <import java.util.Scanner; // I'will use something external to my program
     
    	public class IT_And_Game_Design_Student {
     
    		// the name of program 
    		public static void main(String args[]){  //  declaration of a main method 
    	      Scanner Students = new Scanner (System.in);  //  creates a "scanner" that is used to read input data
     
    	      int possibility; // declaring a Options
    	      int failed = 0; // declaring 2 as failed Student
    	      int passed = 0; // declaring 1 as passed Student
     
    	      for(int i = 1; i<11;++i){ // it will only loop 10 times since i the first student is greater or equal to the 12 Student
    	      System.out.println ("Display if  " +i+ "º STUDENT PASSED (1) OR FAILED (2) and Ben Mondo's final result? ");
    	      possibility = Students.nextInt(); // next line
     
    	      if(possibility == 1) // when number 1 is pressed from keyboard 
    	      {  
     
     
     
    	          passed++; // the student passed
    	      }
     
    	      else if(possibility == 2) // when number 2 is pressed from keyboard 
    	      {
     
    	         failed++; // student failed
    	      }
    	      else
    	      {
    	         System.out.println("wrong number!!!!!" + "Please Try again, remember you can only type 1 Or 2 Thank you..."); //  print the argument 
    	         i--;
     
    	      }
    	      }
     
    	      System.out.println("The number of succesful students in IT and Game Design is  : " + passed);  // print the argument 
    	      System.out.println("the number of unsuccesful Students in IT and Game Design is: " + failed); //  print the argument 
     
    	      if(passed > 0)
    	           System.out.println(" And Ben Mondo was among the succesful Students, well done Ben"); //  print the argument 
    	      else
    	           System.out.println(" And Ben Mondo was not succesful this time");	  
    	      }
     
     
     
     
    	}// Ending the program>


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: can someone plz help me...

    how to make it an Applet
    Take a look at the tutorial: Lesson: Java Applets (The Java™ Tutorials > Deployment)

    Please edit your post and wrap your code with code tags:
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    benmondo (April 24th, 2013)

  4. #3
    Junior Member
    Join Date
    Apr 2013
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: can someone plz help me...

    Thanks Norm for Format.. hope u can see it clear

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,139
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: can someone plz help me...

    A note about applets: You won't be able to use the Scanner class for reading user input. You will need to use something like JOptionPane methods or add a GUI with text fields.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Help me plz ...
    By xxxxjayxxx in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 12th, 2011, 12:04 PM
  2. help me up plz
    By jatinrai199 in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 6th, 2011, 04:06 PM
  3. Help PLZ .. =(
    By Yazan in forum What's Wrong With My Code?
    Replies: 5
    Last Post: November 5th, 2010, 12:39 PM
  4. HELP ME HERE PLZ ... =(
    By Yazan in forum What's Wrong With My Code?
    Replies: 12
    Last Post: May 20th, 2010, 08:55 PM
  5. help me plz
    By jjhames in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 27th, 2010, 08:57 PM