Jump to content

Search the Community

Showing results for tags 'java'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Hardware
    • Overclocking and Cooling
    • Processors, Motherboards and Memory
    • Cases, Power Supplies and Modding
    • Video Cards and Monitors
    • Audio Hardware
    • Drives and Storage
    • Networking and Internet
    • System Builds
    • Miscellaneous Hardware
  • Operating Systems & Software Support
    • OS: Microsoft
    • OS: Non-Microsoft
    • Software
    • Benchmarks
    • Gaming
    • Programmer's Corner
    • Graphics and Photography
  • OCC Member's Area
    • OCC Member's Lounge
    • OCC n00bs
    • OCC Teams
    • OCC Market Place
  • OCC Command Central
    • OCC News & Announcements
    • OCC Front Page News
    • OCC Weekly Polls
    • Site Help & Feedback

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Yahoo


Website URL


Skype


ICQ


Jabber


Location


Interests


[email protected]


Computer Specs


Xfire


Steam


Raptr


GamerDNA


Xbox Live


PSN


Twitter


Facebook


Last.fm

Found 2 results

  1. Hi guys so here is a project i am working on , i have two arrays array "l1" and "s1" bacially "l1" holds the answers to the questions asked for the maths questions ,, when the person answers the question it is loaded into the other array "s1" from the scanner now i want to compare theses two arrays to see how much questions are right and how much are wrong therefore printing out some thing like "Wrong" and "Right", does any one have any ideas how i could go about it ? really stuck thanks guys for any help import java.util.Scanner; public class Math { public static void main(String[] args) { Scanner myScanner = new Scanner(System.in); boolean con = true; int level; // main values int l1[] ={1,2,3,4,5,6,7,8,9,10,11,12,2,4,6,8,10,12,14,16,18,20,22,24,3,6,9,12,15,18,21,24,27,30,33,36}; int s1[]= new int[36]; /////////////..................................................................... System.out.println("Hello Welcome To The Maths Test !!"); System.out.println(); System.out.println("Best Of Luck !!"); System.out.println(); System.out.println("Please Select Your Difficulity !!"); System.out.println(); System.out.print("Type 1 For Easy / Type 2 For Medium / Type 3 For Hard!!"); System.out.println(); ///////// choices..................................................... level = myScanner.nextInt(); // Easy if (level ==1 ) { while ( level ==1 ) { System.out.println("You Have Selected Stage 1 "); level =2; System.out.println("Best Of Luck In Stage 1 "); //////times one tables System.out.print("What is 1 x 1 = "); l1[0] = myScanner.nextInt(); System.out.print("What is 1 x 2 = "); l1[1] = myScanner.nextInt(); System.out.print("What is 1 x 3 = "); l1[2] = myScanner.nextInt(); System.out.print("What is 1 x 4 = "); l1[3] = myScanner.nextInt(); System.out.print("What is 1 x 5 = "); l1[4] = myScanner.nextInt(); System.out.print("What is 1 x 6 = "); l1[5] = myScanner.nextInt(); System.out.print("What is 1 x 7 = "); l1[6] = myScanner.nextInt(); System.out.print("What is 1 x 8 = "); l1[7] = myScanner.nextInt(); System.out.print("What is 1 x 9 = "); l1[8] = myScanner.nextInt(); System.out.print("What is 1 x 10 = "); l1[9] = myScanner.nextInt(); System.out.print("What is 1 x 11 = "); l1[10] = myScanner.nextInt(); System.out.print("What is 1 x 12 = "); l1[11] = myScanner.nextInt(); // Times 2 Tables ----------------------------------------------------------------------------------------------------------------------- System.out.print("What is 2 x 1 = "); l1[12] = myScanner.nextInt(); System.out.print("What is 2 x 2 = "); l1[13] = myScanner.nextInt(); System.out.print("What is 2 x 3 = "); l1[14] = myScanner.nextInt(); System.out.print("What is 2 x 4 = "); l1[15] = myScanner.nextInt(); System.out.print("What is 2 x 5 = "); l1[16] = myScanner.nextInt(); System.out.print("What is 2 x 6 = "); l1[17] = myScanner.nextInt(); System.out.print("What is 2 x 7 = "); l1[18] = myScanner.nextInt(); System.out.print("What is 2 x 8 = "); l1[19] = myScanner.nextInt(); System.out.print("What is 2 x 9 = "); l1[20] = myScanner.nextInt(); System.out.print("What is 2 x 10 = "); l1[21] = myScanner.nextInt(); System.out.print("What is 2 x 11 = "); l1[22] = myScanner.nextInt(); System.out.print("What is 2 x 12 = "); l1[23] = myScanner.nextInt(); // three times tables ---------------------------------------------------------------------------------------------------------------- System.out.print("What is 3 x 1 = "); l1[24] = myScanner.nextInt(); System.out.print("What is 3 x 2 = "); l1[25] = myScanner.nextInt(); System.out.print("What is 3 x 3 = "); l1[26] = myScanner.nextInt(); System.out.print("What is 3 x 4 = "); l1[27] = myScanner.nextInt(); System.out.print("What is 3 x 5 = "); l1[28] = myScanner.nextInt(); System.out.print("What is 3 x 6 = "); l1[29] = myScanner.nextInt(); System.out.print("What is 3 x 7 = "); l1[30] = myScanner.nextInt(); System.out.print("What is 3 x 8 = "); l1[31] = myScanner.nextInt(); System.out.print("What is 3 x 9 = "); l1[32] = myScanner.nextInt(); System.out.print("What is 3 x 10 = "); l1[33] = myScanner.nextInt(); System.out.print("What is 3 x 11 = "); l1[34] = myScanner.nextInt(); System.out.print("What is 3 x 12 = "); l1[35] = myScanner.nextInt(); }} /// maths here // // medium else if (level ==2) {while (level==2){ System.out.print("You Have Selected Stage 2"); level=3; } } // medium else if (level ==3) {while (level==3){ System.out.print("You Have Selected Stage 3"); level=4; } } else if (level !=1 && level!=2 && level!=3) {while (level !=1 && level!=2 && level!=3 ){ System.out.print("Please Select The Correct Stage Between 1-3"); level=1; }} }}
  2. hi guys thanks for the time im getting this error " error: illegal start of expression else if (grades >=40 && <=54) " i bascially want it to out put " d" if the grade is between 40 and 54 thanks again here is my code import java.util.Scanner; public class grade { public static void main(String[] args) { Scanner myScanner = new Scanner(System.in); int grades; System.out.print("Please Enter Your Grade Percentage -- "); grades = myScanner.nextInt(); if(grades <40) System.out.print("Congradulations You Are Awarded An F Mark "); else if (grades >=40 && <=54) System.out.println("d"); } }
×
×
  • Create New...