Jump to content
  • Advertisement
Sign in to follow this  

Exception in Thread.... help!!!

This topic is 4720 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();


		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);


Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!