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.

Page 5 of 5 FirstFirst ... 345
Results 101 to 110 of 110

Thread: Help me PLEASe! I need to submit by 8.30am tmr!

  1. #101
    Member
    Join Date
    Jul 2012
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    [case=java]
    /*================================================= =================================
    * FSP 2012 Assignment
    * Student ID : S10122534C
    * Student Name : Leonard Laura Rachel M
    * Module Group : FI05
    *
    * ================================================== ================================*/

    import java.util.Scanner;

    public class S10122534c_Assignment
    {
    public static void main(String[] args)
    {
    final int MAXSIZE = 50; // maximum number of students
    String[] name = new String[MAXSIZE]; // array to store the names of the students
    double[] caMark = new double[MAXSIZE]; // array to store the Continuous Assessment marks
    double[] ctMark = new double[MAXSIZE]; // array to store the Common Test marks
    double[] asgMark = new double[MAXSIZE]; // array to store the Assignment marks
    double[] finalMark = new double [MAXSIZE]; // array to store the Final marks
    int count = 0;
    Scanner input = new Scanner(System.in);
    // initialize the array with students
    count = initialization(name, caMark, ctMark, asgMark,finalMark);
    int choice;

    do
    {
    choice = input.nextInt();
    switch (choice)
    { case 1: displayStudentResults( name, caMark, ctMark, asgMark, finalMark[0],finalMark[1],finalMark[2],finalMark[3],finalMark[4], count);break;
    case 2: diplayFailedStudents( name, caMark, ctMark, asgMark, finalMark, count);break;
    case 3: addNewStudent(count);break;
    case 4: updateMarks( asgMark, count);break;
    case 5: exit();break;
    default:System.out.print("Thank you.");
    }
    }while (choice != 0);

    }
    // method to initialize the arrays with students
    public static int initialization(String[] name, double[] caMark, double[] ctMark, double[] asgMark, double[] finalMark)
    {
    name [0] = "Agnes Tan";
    caMark [0] = 75;
    ctMark [0] = 68;
    asgMark [0] = 82;

    name [1] = "Benny Ong";
    caMark [1] = 66;
    ctMark [1] = 30;
    asgMark [1] = 35;

    name [2] = "Denise Ng";
    caMark[2] = 55;
    ctMark [2] = 42;
    asgMark [2] = 50;

    name [3] = "Jimmy Tay";
    caMark [3] = 80;
    ctMark [3] = 76;
    asgMark[3] = 82;

    name [4] = "Evelyn Low";
    caMark [4] = 70;
    ctMark [4] = 60;
    asgMark [4] = 65;

    return 5;

    }
    public static void displayMenu()
    {
    String[] nameArr; double[] caMarkArr; double[] ctMarkArr; double[] asgMarkArr; double[] finalMarkArr;
    {
    System.out.println ("MENU");
    System.out.println ("========================================");
    System.out.println (" [1]. Display the results of all students");
    System.out.println (" [2]. Display the students who have failed");
    System.out.println (" [3]. Add a new student");
    System.out.println (" [4]. Update assignment mark of a student");
    System.out.println (" [0]. Exit");
    System.out.println ("Enter your option: _____ ");
    System.out.println ("=========================================");
    }
    }
    public static void displayStudentResults(String[] nameArr, double[] caMarkArr, double[] ctMarkArr, double[] asgMarkArr, double[] finalMarkArr)
    { int [] numArr = new int[50];
    System.out.println("Student Name" + "CA" + "CT" + "ASG" + "FINAL" + "GRADE");
    for (int i=0; i<numArr.length; i++)
    { System.out.println(nameArr[i] + caMarkArr[i] + ctMarkArr[i] + asgMarkArr[i] + finalMarkArr[i]);
    numArr[i]=i+1;
    }
    }
    //Calculate Final marks to compute whether the student has passed & to know the grades
    public static double calculatefinalMark(int count, double[] caMark, double[] ctMark, double[] asgMark)
    {
    {
    int a = count;
    finalMark[0] = (0.4 * caMark[a]) + (0.3 * ctMark[a]) + (0.3 * asgMark[a]);
    System.out.print(finalMark);
    count++;
    return finalMark[0];

    }
    {
    int b=count;
    finalMark[1]= (0.4 * caMark[b]) + (0.3 * ctMark[b]) + (0.3 * asgMark[b]);
    System.out.print (finalMark);
    count++;
    return finalMark[1];
    }

    {
    int c =count;
    finalMark[2]= (0.4 * caMark[c]) + (0.3 * ctMark[c]) + (0.3 * asgMark[c]);
    System.out.print (finalMark);
    count++;
    return finalMark[2];
    }

    {
    intd=count;
    finalMark[3]= (0.4 * caMark[d]) + (0.3 * ctMark[d]) + (0.3 * asgMark[d]);
    System.out.print (finalMark);
    count++;
    return finalMark[3];
    }

    {
    inte=count;
    finalMark[4]= (0.4 * caMark[e]) + (0.3 * ctMark[e]) + (0.3 * asgMark[e]);
    System.out.print (finalMark);
    count++;
    return finalMark[4];
    }
    {
    name[0]= finalMark[0];
    name[1]= finalMark[1];
    name[2]= finalMark[2];
    name[3]= finalMark[3];
    name[4]= finalMark[4];

    }
    }










    public static void displayfailedStudents (String[] name, double[] caMark, double[] ctMark, double[] asgMark, double[] finalMark)
    {
    System.out.println("No" + "Student Name" + "CA" + "CT" + "ASG" + "FINAL" + "GRADE");
    for (int l=0; l<count; l++)



    if (finalMark < 50)
    System.out.print(name[l], caMark[l], ctMark[l], asgMark[l], finalMark[l]);
    }


    public static void addNewStudent(int count)
    {
    System.out.println("Option 3: Add New Student");
    System.out.println("Enter Student Name: ");
    String name = input.next();
    System.out.println("Enter CA Marks: ");
    double caMark = input.nextDouble();
    System.out.println("Enter CT Marks: ");
    double ctMark = input.nextDouble();
    System.out.println("Enter ASG Marks: ");
    double asgMark = input.nextDouble();
    System.out.println("One Student Added.");
    count++;
    }
    public static void updateMarks(int count, double asgMark)
    { int i = count;
    System.out.println("Option 4: Update Assignment Mark of a Student: ");
    System.out.println("Enter the serial number of the student to update : ");
    i = input.nextInt();
    System.out.println("Enter new assignment mark : ");
    double asgMark = input.nextDouble();
    System.out.println("The assignment mark is updated. ");
    asgMark[count-1] = asgMark;
    }
    public static char gradeMark( double finalMark)
    {
    char gradeMark = 0;
    if (finalMark >=80)
    System.out.println("Grade A");
    if ((finalMark >=70) && (finalMark < 80))
    System.out.println("Grade B");
    if ((finalMark >=60) && (finalMark < 70))
    System.out.println("Grade C");
    if ((finalMark >= 50) && (finalMark < 60))
    System.out.println("Grade D");
    if (finalMark < 50)
    System.out.println("Grade F");

    return gradeMark;
    }
    }








    [/case]

  2. #102
    Member
    Join Date
    Jul 2012
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    tis is my new edited version
    [case=java]

    /*================================================= =================================
    * FSP 2012 Assignment
    * Student ID : S10122534C
    * Student Name : Leonard Laura Rachel M
    * Module Group : FI05
    *
    * ================================================== ================================*/

    import java.util.Scanner;

    public class S10122534c_Assignment
    {
    public static void main(String[] args)
    {
    final int MAXSIZE = 50; // maximum number of students
    String[] name = new String[MAXSIZE]; // array to store the names of the students
    double[] caMark = new double[MAXSIZE]; // array to store the Continuous Assessment marks
    double[] ctMark = new double[MAXSIZE]; // array to store the Common Test marks
    double[] asgMark = new double[MAXSIZE]; // array to store the Assignment marks
    double[] finalMark = new double [MAXSIZE]; // array to store the Final marks
    int count = 0;
    Scanner input = new Scanner(System.in);
    // initialize the array with students
    count = initialization(name, caMark, ctMark, asgMark,finalMark);
    int choice;

    do
    {
    choice = input.nextInt();
    switch (choice)
    { case 1: displayStudentResults( name, caMark, ctMark, asgMark, finalMark[0],finalMark[1],finalMark[2],finalMark[3],finalMark[4], count);break;
    case 2: diplayFailedStudents( name, caMark, ctMark, asgMark, finalMark, count);break;
    case 3: addNewStudent(count);break;
    case 4: updateMarks( asgMark, count);break;
    case 5: exit();break;
    default:System.out.print("Thank you.");
    }
    }while (choice != 0);

    }
    // method to initialize the arrays with students
    public static int initialization(String[] name, double[] caMark, double[] ctMark, double[] asgMark, double[] finalMark)
    {
    name [0] = "Agnes Tan";
    caMark [0] = 75;
    ctMark [0] = 68;
    asgMark [0] = 82
    finalMark [0]= name {0];

    name [1] = "Benny Ong";
    caMark [1] = 66;
    ctMark [1] = 30;
    asgMark [1] = 35;
    finalMark[1]= name [1];

    name [2] = "Denise Ng";
    caMark[2] = 55;
    ctMark [2] = 42;
    asgMark [2] = 50;
    finalMark[2]=name[2];

    name [3] = "Jimmy Tay";
    caMark [3] = 80;
    ctMark [3] = 76;
    asgMark[3] = 82;
    finalMark[3]=name[3];

    name [4] = "Evelyn Low";
    caMark [4] = 70;
    ctMark [4] = 60;
    asgMark [4] = 65;
    finalMark[4]=name[4];
    return 5;

    }
    public static void displayMenu()
    {
    String[] nameArr; double[] caMarkArr; double[] ctMarkArr; double[] asgMarkArr; double[] finalMarkArr;
    {
    System.out.println ("MENU");
    System.out.println ("========================================");
    System.out.println (" [1]. Display the results of all students");
    System.out.println (" [2]. Display the students who have failed");
    System.out.println (" [3]. Add a new student");
    System.out.println (" [4]. Update assignment mark of a student");
    System.out.println (" [0]. Exit");
    System.out.println ("Enter your option: _____ ");
    System.out.println ("=========================================");
    }
    }
    public static void displayStudentResults(String[] nameArr, double[] caMarkArr, double[] ctMarkArr, double[] asgMarkArr, double[] finalMarkArr)
    { int [] numArr = new int[50];
    System.out.println("Student Name" + "CA" + "CT" + "ASG" + "FINAL" + "GRADE");
    for (int i=0; i<numArr.length; i++)
    { System.out.println(nameArr[i] + caMarkArr[i] + ctMarkArr[i] + asgMarkArr[i] + finalMarkArr[i]);
    numArr[i]=i+1;
    }
    }
    //Calculate Final marks to compute whether the student has passed & to know the grades
    public static double calculatefinalMark(int count, double[] caMark, double[] ctMark, double[] asgMark)
    {
    {
    int a = count;
    finalMark[0] = (0.4 * caMark[a]) + (0.3 * ctMark[a]) + (0.3 * asgMark[a]);
    System.out.print(finalMark[0]);
    count++;
    return finalMark[0];

    }
    {
    int b=count;
    finalMark[1]= (0.4 * caMark[b]) + (0.3 * ctMark[b]) + (0.3 * asgMark[b]);
    System.out.print (finalMark[1]);
    count++;
    return finalMark[1];
    }

    {
    int c =count;
    finalMark[2]= (0.4 * caMark[c]) + (0.3 * ctMark[c]) + (0.3 * asgMark[c]);
    System.out.print (finalMark[2]);
    count++;
    return finalMark[2];
    }

    {
    intd=count;
    finalMark[3]= (0.4 * caMark[d]) + (0.3 * ctMark[d]) + (0.3 * asgMark[d]);
    System.out.print (finalMark[3]);
    count++;
    return finalMark[3];
    }

    {
    inte=count;
    finalMark[4]= (0.4 * caMark[e]) + (0.3 * ctMark[e]) + (0.3 * asgMark[e]);
    System.out.print (finalMark[4]);
    count++;
    return finalMark[4];
    }
    }
    public static void displayfailedStudents (String[] name, double[] caMark, double[] ctMark, double[] asgMark, double[] finalMark)
    {
    System.out.println("No" + "Student Name" + "CA" + "CT" + "ASG" + "FINAL" + "GRADE");
    for (int l=0; l<count; l++)



    if (finalMark < 50)
    System.out.print(name[l], caMark[l], ctMark[l], asgMark[l], finalMark[l]);
    }


    public static void addNewStudent(int count)
    {
    System.out.println("Option 3: Add New Student");
    System.out.println("Enter Student Name: ");
    String name = input.next();
    System.out.println("Enter CA Marks: ");
    double caMark = input.nextDouble();
    System.out.println("Enter CT Marks: ");
    double ctMark = input.nextDouble();
    System.out.println("Enter ASG Marks: ");
    double asgMark = input.nextDouble();
    System.out.println("One Student Added.");
    count++;
    }
    public static void updateMarks(int count, double asgMark)
    { int i = count;
    System.out.println("Option 4: Update Assignment Mark of a Student: ");
    System.out.println("Enter the serial number of the student to update : ");
    i = input.nextInt();
    System.out.println("Enter new assignment mark : ");
    double asgMark = input.nextDouble();
    System.out.println("The assignment mark is updated. ");
    asgMark[count-1] = asgMark;
    }
    public static char gradeMark( double finalMark)
    {
    char gradeMark = 0;
    if (finalMark >=80)
    System.out.println("Grade A");
    if ((finalMark >=70) && (finalMark < 80))
    System.out.println("Grade B");
    if ((finalMark >=60) && (finalMark < 70))
    System.out.println("Grade C");
    if ((finalMark >= 50) && (finalMark < 60))
    System.out.println("Grade D");
    if (finalMark < 50)
    System.out.println("Grade F");

    return gradeMark;
    }
    }






    [/case]

  3. #103
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    the tag is code, not case.

  4. #104
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,067
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    Edit your post and wrap your code with
    [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.

  5. #105
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    displayStudentResults( name, caMark, ctMark, asgMark, finalMark[0],finalMark[1],finalMark[2],finalMark[3],finalMark[4], count);
    Not exactly...

    What you want to do is pass only one set of values to the calculatefinalMark method. ....from inside a loop. ....where the index of the loop counter is the index of the arrays you are sending.
    Here is a sample loop for doing such a thing.

    for(int i = 0; i < numberOfElementsToWorkOn; i++) {
        finalMarks[i] = calculatefinalMarks( markOne[i], markTwo[i], markThree[i] );
    }

  6. #106
    Member
    Join Date
    Jul 2012
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    Okayy i have edited
     
    *==================================================================================
     * FSP 2012 Assignment
     * Student ID	 : S10122534C  
     * Student Name : Leonard Laura Rachel M
     * Module Group :  FI05
     * 
     * ==================================================================================*/
     
    import java.util.Scanner;
     
    public class S10122534c_Assignment
    {
    	public static void main(String[] args)
    	{
    		final int MAXSIZE = 50; 						// maximum number of students	
    		String[] name   = new String[MAXSIZE];		// array to store the names of the students
    		double[] caMark = new double[MAXSIZE];		// array to store the Continuous Assessment marks
    		double[] ctMark = new double[MAXSIZE];		// array to store the Common Test marks
    		double[] asgMark = new double[MAXSIZE];	// array to store the Assignment marks
    		double[] finalMark = new double [MAXSIZE]; // array to store the Final marks
    		int count = 0;
    		Scanner input = new Scanner(System.in);
    		// initialize the array with students
    		count = initialization(name, caMark, ctMark, asgMark,finalMark);
    		int choice;
    		finalMark = calculateFinalMark(count,caMark, ctMark, asgMark);
     
     
    		for(int i=0;i<4;i++)
    		{
    		finalMark[i]= calculatefinalMark(markone[i],marktwo[i],markthree[i],markfour[i],markfive[i]);
    		}
     
    		do
    	  {	
    	  choice = input.nextInt();								
    	  switch (choice)
    	  { case 1: displayStudentResults( name,  caMark,  ctMark, asgMark, count);break;
           case 2: diplayFailedStudents( name,  caMark, ctMark, asgMark, finalMark, count);break;
    		 case 3: addNewStudent(count);break;
    		 case 4: updateMarks( asgMark, count);break;
    		 case 5: exit();break;
    		 default:System.out.print("Thank you.");
    	   }
        }while (choice != 0);
     
    	 }
    	  // method to initialize the arrays with students
    	  public static int initialization(String[] name, double[] caMark, double[] ctMark, double[] asgMark, double[] finalMark)
    	 { 
    	   name [0] = "Agnes Tan";
    		caMark [0] = 75;
    		ctMark [0] = 68;
    		asgMark [0] = 82;
     
     
    		name [1] = "Benny Ong";
    		caMark [1] = 66;
    		ctMark [1] = 30;
    		asgMark [1] = 35;
     
     
    		name [2] = "Denise Ng";
    		caMark[2] = 55;
    		ctMark [2] = 42;
    		asgMark [2] = 50;
     
     
    		name [3] = "Jimmy Tay";
    		caMark [3] = 80;
    		ctMark [3] = 76;
    		asgMark[3] = 82;
     
     
    		name [4] = "Evelyn Low";
    		caMark [4] = 70;
    		ctMark [4] = 60;
    		asgMark [4] = 65;
     
    		return 5;	
     
    	  } 
    	  public static void displayMenu()
    	 {
    	  String[] nameArr; double[] caMarkArr; double[] ctMarkArr; double[] asgMarkArr; double[] finalMarkArr;
    	  {
    	  System.out.println ("MENU");
    	  System.out.println ("========================================");
    	  System.out.println (" [1]. Display the results of all students");
    	  System.out.println (" [2]. Display the students who have failed");
    	  System.out.println (" [3]. Add a new student");
    	  System.out.println (" [4]. Update assignment mark of a student");
    	  System.out.println (" [0]. Exit");
    	  System.out.println ("Enter your option: _____ ");
    	  System.out.println ("=========================================");
    	  } 	 
       }
       public static void displayStudentResults(String[] nameArr, double[] caMarkArr, double[] ctMarkArr, double[] asgMarkArr, double[] finalMarkArr)
    	{  int [] numArr = new int[50];
    	   System.out.println("Student Name" + "CA" + "CT" + "ASG" + "FINAL" + "GRADE"); 
    	   for (int i=0; i<numArr.length; i++)
    		{ System.out.println(nameArr[i] + caMarkArr[i] + ctMarkArr[i] + asgMarkArr[i] + finalMarkArr[i]);
    		  numArr[i]=i+1;
    		}
    	  }
    	  //Calculate Final marks to compute whether the student has passed & to know the grades
    	  public static double calculatefinalMark(int count, double[] caMark, double[] ctMark, double[] asgMark) 
    	 {
    	  {
    		int a = count;
    		finalMark[0] = (0.4 * caMark[a]) + (0.3 * ctMark[a]) + (0.3 * asgMark[a]);
    		System.out.print(finalMark[0]);
    		count++;
    		return finalMark[0];
     
    	}
    	{
    	  int b=count;
    	  finalMark[1]= (0.4 * caMark[b]) + (0.3 * ctMark[b]) + (0.3 * asgMark[b]);
    	  System.out.print (finalMark[1]);
    	  count++;
    	  return finalMark[1];
    	  }
     
    	{
    	int c =count;
    	finalMark[2]= (0.4 * caMark[c]) + (0.3 * ctMark[c]) + (0.3 * asgMark[c]);
    	System.out.print (finalMark[2]);
    	count++;
    	return finalMark[2];
    	}
     
    	{
    	intd=count;
    	finalMark[3]= (0.4 * caMark[d]) + (0.3 * ctMark[d]) + (0.3 * asgMark[d]);
    	System.out.print (finalMark[3]);
    	count++;
    	return finalMark[3];
    	}
     
    	{
    	inte=count;
    	finalMark[4]= (0.4 * caMark[e]) + (0.3 * ctMark[e]) + (0.3 * asgMark[e]);
    	System.out.print (finalMark[4]);
    	count++;
    	return finalMark[4];
    	}
    	}
    	   public static void displayfailedStudents (String[] name, double[] caMark, double[] ctMark, double[] asgMark, double[] finalMark) 
    	   {
    	    System.out.println("No" + "Student Name" + "CA" + "CT" + "ASG" + "FINAL" + "GRADE");
    		 for (int l=0; l<count; l++)
     
     
     
    		   if (finalMark < 50)
    		     System.out.print(name[l], caMark[l], ctMark[l], asgMark[l], finalMark[l]);
    		 }
     
     
    		public static void addNewStudent(int count)
    		{
    		  System.out.println("Option 3: Add New Student");
    		  System.out.println("Enter Student Name:  ");
    		  String name = input.next();
    		  System.out.println("Enter CA Marks:  ");
    		  double caMark =  input.nextDouble();
    		  System.out.println("Enter CT Marks:   ");
    		  double ctMark = input.nextDouble();
    		  System.out.println("Enter ASG Marks:  ");
    		  double asgMark = input.nextDouble(); 
    		  System.out.println("One Student Added.");
    		  count++;
    		}
    		public static void updateMarks(int count, double asgMark)
    		{ int i = count;
    		  System.out.println("Option 4: Update Assignment Mark of a Student:   ");
    		  System.out.println("Enter the serial number of the student to update : ");
    		  i = input.nextInt();
            System.out.println("Enter new assignment mark : ");
    		  double asgMark = input.nextDouble();
            System.out.println("The assignment mark is updated. ");
    		  asgMark[count-1] = asgMark;
    		}
          public static char gradeMark( double finalMark)
    		{ 
    			char gradeMark = 0;
    			if (finalMark >=80)
    			   System.out.println("Grade A");
    			if ((finalMark >=70) && (finalMark < 80))
    			   System.out.println("Grade B");
    			if ((finalMark >=60) && (finalMark < 70))
    			   System.out.println("Grade C");
    			if ((finalMark >= 50) && (finalMark < 60))
    			   System.out.println("Grade D");
    			if (finalMark < 50)
    			   System.out.println("Grade F");
     
    			  return gradeMark;
    		 }
    }

  7. #107
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,067
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    You forgot to post the error messages you are getting.
    If you don't understand my answer, don't ignore it, ask a question.

  8. #108
    Member
    Join Date
    Jul 2012
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    S10122534c_Assignment.java:26: incompatible types
    found : double
    required: double[]
    finalMark = calculatefinalMark(count,caMark, ctMark, asgMark);
    ^
    S10122534c_Assignment.java:30: cannot find symbol
    symbol : variable markone
    location: class S10122534c_Assignment
    finalMark[i]= calculatefinalMark(markone[i],marktwo[i],markthree[i],markfour[i],markfive[i]);
    ^
    S10122534c_Assignment.java:30: cannot find symbol
    symbol : variable marktwo
    location: class S10122534c_Assignment
    finalMark[i]= calculatefinalMark(markone[i],marktwo[i],markthree[i],markfour[i],markfive[i]);
    ^
    S10122534c_Assignment.java:30: cannot find symbol
    symbol : variable markthree
    location: class S10122534c_Assignment
    finalMark[i]= calculatefinalMark(markone[i],marktwo[i],markthree[i],markfour[i],markfive[i]);
    ^
    S10122534c_Assignment.java:30: cannot find symbol
    symbol : variable markfour
    location: class S10122534c_Assignment
    finalMark[i]= calculatefinalMark(markone[i],marktwo[i],markthree[i],markfour[i],markfive[i]);
    ^
    S10122534c_Assignment.java:30: cannot find symbol
    symbol : variable markfive
    location: class S10122534c_Assignment
    finalMark[i]= calculatefinalMark(markone[i],marktwo[i],markthree[i],markfour[i],markfive[i]);
    ^
    S10122534c_Assignment.java:37: displayStudentResults(java.lang.String[],double[],double[],double[],double[]) in S10122534c_Assignment cannot be applied to (java.lang.String[],double[],double[],double[],int)
    { case 1: displayStudentResults( name, caMark, ctMark, asgMark, count);break;
    ^
    S10122534c_Assignment.java:38: cannot find symbol
    symbol : method diplayFailedStudents(java.lang.String[],double[],double[],double[],double[],int)
    location: class S10122534c_Assignment
    case 2: diplayFailedStudents( name, caMark, ctMark, asgMark, finalMark, count);break;
    ^
    S10122534c_Assignment.java:40: updateMarks(int,double) in S10122534c_Assignment cannot be applied to (double[],int)
    case 4: updateMarks( asgMark, count);break;
    ^
    S10122534c_Assignment.java:41: cannot find symbol
    symbol : method exit()
    location: class S10122534c_Assignment
    case 5: exit();break;
    ^
    S10122534c_Assignment.java:110: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    finalMark[0] = (0.4 * caMark[a]) + (0.3 * ctMark[a]) + (0.3 * asgMark[a]);
    ^
    S10122534c_Assignment.java:111: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    System.out.print(finalMark[0]);
    ^
    S10122534c_Assignment.java:113: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    return finalMark[0];
    ^
    S10122534c_Assignment.java:118: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    finalMark[1]= (0.4 * caMark[b]) + (0.3 * ctMark[b]) + (0.3 * asgMark[b]);
    ^
    S10122534c_Assignment.java:119: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    System.out.print (finalMark[1]);
    ^
    S10122534c_Assignment.java:121: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    return finalMark[1];
    ^
    S10122534c_Assignment.java:126: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    finalMark[2]= (0.4 * caMark[c]) + (0.3 * ctMark[c]) + (0.3 * asgMark[c]);
    ^
    S10122534c_Assignment.java:127: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    System.out.print (finalMark[2]);
    ^
    S10122534c_Assignment.java:129: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    return finalMark[2];
    ^
    S10122534c_Assignment.java:133: cannot find symbol
    symbol : variable intd
    location: class S10122534c_Assignment
    intd=count;
    ^
    S10122534c_Assignment.java:134: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    finalMark[3]= (0.4 * caMark[d]) + (0.3 * ctMark[d]) + (0.3 * asgMark[d]);
    ^
    S10122534c_Assignment.java:134: cannot find symbol
    symbol : variable d
    location: class S10122534c_Assignment
    finalMark[3]= (0.4 * caMark[d]) + (0.3 * ctMark[d]) + (0.3 * asgMark[d]);
    ^
    S10122534c_Assignment.java:134: cannot find symbol
    symbol : variable d
    location: class S10122534c_Assignment
    finalMark[3]= (0.4 * caMark[d]) + (0.3 * ctMark[d]) + (0.3 * asgMark[d]);
    ^
    S10122534c_Assignment.java:134: cannot find symbol
    symbol : variable d
    location: class S10122534c_Assignment
    finalMark[3]= (0.4 * caMark[d]) + (0.3 * ctMark[d]) + (0.3 * asgMark[d]);
    ^
    S10122534c_Assignment.java:135: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    System.out.print (finalMark[3]);
    ^
    S10122534c_Assignment.java:137: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    return finalMark[3];
    ^
    S10122534c_Assignment.java:141: cannot find symbol
    symbol : variable inte
    location: class S10122534c_Assignment
    inte=count;
    ^
    S10122534c_Assignment.java:142: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    finalMark[4]= (0.4 * caMark[e]) + (0.3 * ctMark[e]) + (0.3 * asgMark[e]);
    ^
    S10122534c_Assignment.java:142: cannot find symbol
    symbol : variable e
    location: class S10122534c_Assignment
    finalMark[4]= (0.4 * caMark[e]) + (0.3 * ctMark[e]) + (0.3 * asgMark[e]);
    ^
    S10122534c_Assignment.java:142: cannot find symbol
    symbol : variable e
    location: class S10122534c_Assignment
    finalMark[4]= (0.4 * caMark[e]) + (0.3 * ctMark[e]) + (0.3 * asgMark[e]);
    ^
    S10122534c_Assignment.java:142: cannot find symbol
    symbol : variable e
    location: class S10122534c_Assignment
    finalMark[4]= (0.4 * caMark[e]) + (0.3 * ctMark[e]) + (0.3 * asgMark[e]);
    ^
    S10122534c_Assignment.java:143: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    System.out.print (finalMark[4]);
    ^
    S10122534c_Assignment.java:145: cannot find symbol
    symbol : variable finalMark
    location: class S10122534c_Assignment
    return finalMark[4];
    ^
    S10122534c_Assignment.java:151: cannot find symbol
    symbol : variable count
    location: class S10122534c_Assignment
    for (int l=0; l<count; l++)
    ^
    S10122534c_Assignment.java:155: operator < cannot be applied to double[],int
    if (finalMark < 50)
    ^
    S10122534c_Assignment.java:156: cannot find symbol
    symbol : method print(java.lang.String,double,double,double,double )
    location: class java.io.PrintStream
    System.out.print(name[l], caMark[l], ctMark[l], asgMark[l], finalMark[l]);
    ^
    S10122534c_Assignment.java:164: cannot find symbol
    symbol : variable input
    location: class S10122534c_Assignment
    String name = input.next();
    ^
    S10122534c_Assignment.java:166: cannot find symbol
    symbol : variable input
    location: class S10122534c_Assignment
    double caMark = input.nextDouble();
    ^
    S10122534c_Assignment.java:168: cannot find symbol
    symbol : variable input
    location: class S10122534c_Assignment
    double ctMark = input.nextDouble();
    ^
    S10122534c_Assignment.java:170: cannot find symbol
    symbol : variable input
    location: class S10122534c_Assignment
    double asgMark = input.nextDouble();
    ^
    S10122534c_Assignment.java:178: cannot find symbol
    symbol : variable input
    location: class S10122534c_Assignment
    i = input.nextInt();
    ^
    S10122534c_Assignment.java:180: asgMark is already defined in updateMarks(int,double)
    double asgMark = input.nextDouble();
    ^
    S10122534c_Assignment.java:180: cannot find symbol
    symbol : variable input
    location: class S10122534c_Assignment
    double asgMark = input.nextDouble();
    ^
    S10122534c_Assignment.java:182: array required, but double found
    asgMark[count-1] = asgMark;
    ^
    44 errors

    ----jGRASP wedge2: exit code for process is 1.
    ----jGRASP: operation complete.

  9. #109
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    finalMark = calculateFinalMark(count,caMark, ctMark, asgMark);


    for(int i=0;i<4;i++)
    {
    finalMark[i]= calculatefinalMark(markone[i],marktwo[i],markthree[i],markfour[i],markfive[i]);
    }
    Honestly I am short for words friend. You have failed to grasp concepts presented long before an assignment like this. Between Norm's post and my previous post, you were given almost word for word code to correct this issue. Ask some questions. You have got to have some. You have got to get an understanding out of this and not a suitable pile of code.

  10. #110
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,067
    Thanks
    47
    Thanked 2,146 Times in 2,119 Posts

    Default Re: Help me PLEASe! I need to submit by 8.30am tmr!

    finalMark = calculateFinalMark(count,caMark, ctMark, asgMark);

    finalMark = calculatefinalMark(count,caMark, ctMark, asgMark);

    The error messages do NOT match the posted code.
    The top line is from the program posted in post #106
    The second line is from the error messages posted in post #108

    Notice the different spellings. One has F and the other f
    If you don't understand my answer, don't ignore it, ask a question.

Page 5 of 5 FirstFirst ... 345

Similar Threads

  1. Replies: 1
    Last Post: January 31st, 2013, 03:55 AM
  2. Replies: 6
    Last Post: December 6th, 2011, 07:46 AM
  3. Notepad is opening on click of submit instead navigating to other page
    By pb60705 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: November 10th, 2011, 06:23 AM
  4. unable to go to next page...while clicking submit button
    By javaking in forum JavaServer Pages: JSP & JSTL
    Replies: 0
    Last Post: April 29th, 2010, 02:55 AM
  5. vending machine submit button help
    By maybach230 in forum Java Applets
    Replies: 3
    Last Post: April 23rd, 2010, 10:16 AM