Sign in to follow this  

Exception in Thread.... help!!!

This topic is 4378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello, I am trying to make a simple java program to calculate weighted grades. The program compiles fine but when I run it it gives the error message "Exception in thread "main" java.lang.NoClassDefFoundError: Gradesmain" Here is my code: Gradesmain.java
import java.util.Scanner;

public class Gradesmain
{
	public static void main (String[] args)
	{
		Scanner scan = new Scanner(System.in);
		System.out.println ("This program computes your percentage out of a 100 for weighted grades");
		System.out.println ("How many sections of 100%?");
		int rows = scan.nextInt();

		double [][] list = new double[rows][3];

		int i = 0;
		int sec= 1;
		while (i < rows)
		{
			System.out.println("Values for Section " + sec);
			System.out.println("What is this section's weight out of 100%?");
			list[rows][0] = scan.nextDouble();

			System.out.println("What is your actual points?");
			list[rows][1] = scan .nextDouble();

			System.out.println("What are the total points possible?");
			list[rows][2] = scan.nextDouble();

			sec++;
			i++;
		}

		double [] toSum = new double[rows];
		for(int r = 0;r<rows; r++)
		{
			double weight;
			double actual;
			double outOf;
			weight = list[rows][0];
			actual = list[rows][1];
			outOf = list[rows][2];
			//Grade gr = new Grade(list[r][0],list[r][1],list[r][2]);
			toSum[r] = ((actual/outOf))*weight;
		}
		double total=0.0;

		for (int s=0; s < sec; s++)
		{
			total += toSum[s];
		}
		System.out.println (total);
	}
}


thanks

Share this post


Link to post
Share on other sites

This topic is 4378 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this