Exception in Thread.... help!!!

Started by
0 comments, last by joanusdmentia 18 years, 4 months ago
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;
		}
		System.out.println (total);
	}
}


</pre></div><!–ENDSCRIPT–>

thanks
Advertisement
My guess would be that wherever your compile .class file is located isn't on the class path.
"Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is a vestige of the vox populi, now vacant, vanished. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose, so let me simply add that it's my very good honor to meet you and you may call me V.".....V

This topic is closed to new replies.

Advertisement