Now, that I know that there can be more multiple constructors in a
class, try to solve this problem. One class is student and the other
class is showstudent. One constuctor is receiving three vars and the
other is an overload referencing two variables in the showstudent
class.
public class student{
public static void main(String[] args){
int id_no=3835;
double hrs=16;
double pts=64;
meth1(id_no,hrs,pts);
showstudent mav=new showstudent(id_no,hrs,pts);
mav.send();
showstudent frisky=new showstudent(9999,3.5);
frisky.send();}
public static void meth1(int id_no,double hrs,double pts){
avg=pts/hrs;
meth2(id_no,avg);
}
public static void meth2(int id_no, double avg){
System.out.println("ID number "+id_no+" has received an average grade
of "+avg);
}}
public class showstudent{
int id_no;
double avg;
showstudent(int idnum,double average){
id_no=idnum;
avg=average;}
public void send(){
System.out.println("ID number "+id_no+" has received an average grade
of "+avg);}
}
public void send(int id_no,double hrs,double pts){
avg=pts/hrs;
System.out.println("ID number "+id_no+" has received an average grade
of "+avg);}}
Can anyone show me where the errors are and how to correct it with
the right code?