Student.java

Write a program that stores 5 grades. The program should also store t

Page 1 of 1

14 Replies - 5443 Views - Last Post: 13 February 2009 - 02:11 PM Rate Topic: -----

#1 jmuckey2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 14-October 08

Student.java

Posted 12 February 2009 - 03:31 PM

i need help everythnig that i have tried doesnt work i keep getting nosuchmethoderror
Is This A Good Question/Topic? 0
  • +

Replies To: Student.java

#2 Nykc   User is offline

  • Gentleman of Leisure
  • member icon

Reputation: 740
  • View blog
  • Posts: 8,654
  • Joined: 14-September 07

Re: Student.java

Posted 12 February 2009 - 03:47 PM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 mostyfriedman   User is offline

  • The Algorithmi
  • member icon

Reputation: 729
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Student.java

Posted 12 February 2009 - 04:23 PM

why dont you show us what you have written and we'll try to correct you
Was This Post Helpful? 0
  • +
  • -

#4 jmuckey2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 14-October 08

Re: Student.java

Posted 12 February 2009 - 04:47 PM

View Postmostyfriedman, on 12 Feb, 2009 - 03:23 PM, said:

why dont you show us what you have written and we'll try to correct you

public class Student {
	private String first;	 // first name
	private String last;	  // last name
	private String email;	 // email address
	private int	section;   // section number

	// construct a new student with given fields
	public Student(String first, String last, String email, int section) {
		this.first   = first;
		this.last	= last;
		this.email   = email;
		this.section = section;
	}
}


Was This Post Helpful? 0
  • +
  • -

#5 mostyfriedman   User is offline

  • The Algorithmi
  • member icon

Reputation: 729
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Student.java

Posted 12 February 2009 - 05:01 PM

ok, you're doing fine..where's the problem now??
Was This Post Helpful? 0
  • +
  • -

#6 jmuckey2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 14-October 08

Re: Student.java

Posted 12 February 2009 - 05:07 PM

View Postmostyfriedman, on 12 Feb, 2009 - 04:01 PM, said:

ok, you're doing fine..where's the problem now??


that's where o get the nosuchmethoderror
Was This Post Helpful? 0
  • +
  • -

#7 mostyfriedman   User is offline

  • The Algorithmi
  • member icon

Reputation: 729
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Student.java

Posted 12 February 2009 - 05:08 PM

where's your tester class that has the main method?
Was This Post Helpful? 0
  • +
  • -

#8 jmuckey2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 14-October 08

Re: Student.java

Posted 12 February 2009 - 05:18 PM

View Postmostyfriedman, on 12 Feb, 2009 - 04:08 PM, said:

where's your tester class that has the main method?


i don't know what you are talkiong about and besides it needs to be one file
Was This Post Helpful? 0
  • +
  • -

#9 mostyfriedman   User is offline

  • The Algorithmi
  • member icon

Reputation: 729
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Student.java

Posted 12 February 2009 - 05:30 PM

you need to provide a main method to run this program
public class Student {
	private String first;	 // first name
	private String last;	  // last name
	private String email;	 // email address
	private int	section;   // section number

	// construct a new student with given fields
	public Student(String first, String last, String email, int section) {
		this.first   = first;
		this.last	= last;
		this.email   = email;
		this.section = section;
	}

	public static void main(String[]args)
	{
		 Student s1 = new Student(/*your values here*/);
	}
}


This post has been edited by mostyfriedman: 12 February 2009 - 05:31 PM

Was This Post Helpful? 0
  • +
  • -

#10 jmuckey2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 14-October 08

Re: Student.java

Posted 12 February 2009 - 05:35 PM

View Postmostyfriedman, on 12 Feb, 2009 - 04:30 PM, said:

you need to provide a main method to run this program
public class Student {
	private String first;	 // first name
	private String last;	  // last name
	private String email;	 // email address
	private int	section;   // section number

	// construct a new student with given fields
	public Student(String first, String last, String email, int section) {
		this.first   = first;
		this.last	= last;
		this.email   = email;
		this.section = section;
	}

	public static void main(String[]args)
	{
		 Student s1 = new Student(/*your values here*/);
	}
}


   public static void main(String[]args)
	{
		 Student s1 = new Student(/*your values here*/);
	}
}



so i just add that to my student class and it will work?
Was This Post Helpful? 0
  • +
  • -

#11 mostyfriedman   User is offline

  • The Algorithmi
  • member icon

Reputation: 729
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Student.java

Posted 12 February 2009 - 05:38 PM

yes but you have to pass variables to initialize your student object..look you need to read about objects and classes to understand this
Was This Post Helpful? 0
  • +
  • -

#12 jmuckey2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 14-October 08

Re: Student.java

Posted 12 February 2009 - 05:42 PM

View Postmostyfriedman, on 12 Feb, 2009 - 04:38 PM, said:

yes but you have to pass variables to initialize your student object..look you need to read about objects and classes to understand this


i would really appreciate any hel p that i can get the only method that i know is the get method but i dont know how that would apply to a students name first name on one line and last name below it and sotreing 5 variables that are grades
Was This Post Helpful? 0
  • +
  • -

#13 mostyfriedman   User is offline

  • The Algorithmi
  • member icon

Reputation: 729
  • View blog
  • Posts: 4,473
  • Joined: 24-October 08

Re: Student.java

Posted 12 February 2009 - 05:45 PM

then you will need one more instance variable to store the grades, that is an array of doubles
Was This Post Helpful? 0
  • +
  • -

#14 jmuckey2   User is offline

  • D.I.C Head

Reputation: 0
  • View blog
  • Posts: 57
  • Joined: 14-October 08

Re: Student.java

Posted 12 February 2009 - 05:59 PM

View Postmostyfriedman, on 12 Feb, 2009 - 04:45 PM, said:

then you will need one more instance variable to store the grades, that is an array of doubles

no clue what you are talking about
Was This Post Helpful? 0
  • +
  • -

#15 johnmalloy   User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 40
  • Joined: 24-September 08

Re: Student.java

Posted 13 February 2009 - 02:11 PM

Read this

http://java.sun.com/...lts/arrays.html

This post has been edited by johnmalloy: 13 February 2009 - 02:12 PM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1