I had thought I was finally done with this program, it finally ran but then realized that it wasn't doing the right thing mean LOGIC error :(
Can someone plz help me correct this error I have been messing around with it but keep running across errors
Here is the original MAIN:
import java.util.Scanner;
public class Birthdate
{
public static void main (String[] args)
{
Profile p= new Profile();
Profile oldestStudent = new Profile(1999,12, 31);
Profile base = new Profile (02, 29);
p.readData();
while (!(p.studentId.equals("000")))
{
if (Profile.dataValid(p))
{
Profile.totalStudents();
if (base.ckBirthDate(p))
p.updateBirthDateTotal();
if (base.ckOldestBirthDate(p,oldestStudent))
oldestStudent.updateBirthDateTotal();
p.formatMonth();
Profile.writeStudentData(p);
p.readData();
}
}
System.out.println(p.getStudentId());
System.out.println(p.getBirthDateDay());
System.out.println(p.getBirthDateMonth());
System.out.println(p.getBirthDateYear());
Profile.writeOutcome(p);
}
}
I changed this portion, hoping it would fix the problem:
while (!(p.studentId.equals("000")))
{
if (Profile.dataValid(p))
{
Profile.totalStudents();
if (base.ckBirthDate(p))
p.updateBirthDateTotal();
if (oldestStudent.ckOldestBirthDate(p,oldestStudent))
p.updateBirthDate(student);
p.formatMonth();
Profile.writeStudentData(p);
p.readData();
}
}
but i ended up with these errors:
ckOldestBirthDate(Profile,Profile) in Profile cannot be applied to (Profile)
if (oldestStudent.ckOldestBirthDate(p))
updateOldestBirthDate(Profile,Profile) in Profile cannot be applied to ()
p.updateOldestBirthDate();
here's the pseudocode for that portion:
DOWHILE studentId =/= '000'
Validate data (method)
IF valid data = true THEN
countStudents(method)
IF ckBirthDate(method) THEN
updateBirthDate (method)
ENDIF
IF ckOldestBirthDate(method) THEN
updateOldestBirthDate(method)
ENDIF
ENDIF
can someone please help me, i have been struggling with this program over a week now..getting really frustrated. Please help me. what am I doing wrong?? :(
Let me know if you need me to provide you more information (fyi this is a little urgent :( )