I have to compile my code with a Testing Tool, however, when that testing tool calls my method, I receive this error:
"method getCourseDetails in class Course cannot be applied to given types;
required: java.lang.String,int,java.lang.String,boolean,java.lang.String.java.lang.String,double
found: no arguments
reason: actual and formal argument lists differ in length.
The operator that you use here cannot be used for the type of value that you are using it for. You are either using the wrong type here, or the wrong operator."
This is my method:
public static void getCourseDetails(String department, int number, String name, boolean isFull,
String SCHOOL_NAME, String motto, double price){
if (department.length() != (0) && number != 0 && name.length() != (0) && price != 0) {
System.out.print(department + " ");
} else if (department.length() == (0)){
System.out.print ("Sorry, there is an error with the course department.");
return;
}
if (number == 0) {
System.out.print("Sorry, there is an error with the course number.");
return;
} else if (number != 0 && department.length() != (0) && name.length() != (0) && price != 0){
System.out.print(number + " ");
}
if (name.length() != (0) && number!= 0 && department.length() != (0) && price != 0) {
System.out.println(name + ".");
} else if (name.length() == (0)) {
System.out.print("Sorry, there is an error with the course name.");
return;
}
if (price == 0){
System.out.print("Sorry, there is an error with the course price.");
return;
}
//System.out.println(department + " " + number + " is " + name);
if (isFull == true){
System.out.println("The course is currently full.");
} else if (isFull == false){
System.out.println("The course is currently not full.");
}
System.out.println("The course is currently run at " + SCHOOL_NAME +
" where their motto is " + "\"" + motto + "\"");