I'm new to coding (total novice) and i am having trouble with the following program. (see below and question attached)
How do I print out my assignGrade method??? I had to initialise it in Main manually. The rest of the program works fine?
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
package Lab8;
import java.util.Scanner;
public class ClassTest2Retry {
static Scanner input = new Scanner(System.in);
//method enterName()
public static String enterName(){
System.out.println("Enter name");
return input.nextLine();
}
//method enterMark()
public static int enterMark(String value){
System.out.println(value);
return input.nextInt();
}
//method calculateAverage()
public static int calculateaverage(int solo, int prose, int poem){
return ((solo + prose + poem) /3);
}
// method assignGrade
public static String assignGrade(int overall){
if (overall <40){
return "Fail";
}else if (overall >40) {
return "Pass";
}
else{
return "Distinction";
}
}
//method output results
public static void outputResults (String name, int solo, int prose, int poem, int average, String grade){
System.out.println("Name\t\t\t\t Solo\t\t\t\t Prose\t\t\t\t Poem\t\t\t\t Avg\t\t\t\t Grade");
System.out.println(name + "\t\t" + solo+ "\t\t\t\t\t"+ prose+"\t\t\t\t\t" + poem + "\t\t\t\t\t"+ average);
}
public static void main(String[] args) {
String nameMain, gradeMain;
int soloMarkMain, proseMarkMain, poemMarkMain, averageMain, overallMain = 70;
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
-Mike Kapnisakis, Warner Bros
With your subscription - you'll gain access to our exclusive IT community of thousands of IT pros. You'll also be able to connect with highly specified Experts to get personalized solutions to your troubleshooting & research questions. It’s like crowd-sourced consulting.
We can't always guarantee that the perfect solution to your specific problem will be waiting for you. If you ask your own question - our Certified Experts will team up with you to help you get the answers you need.
Our certified Experts are CTOs, CISOs, and Technical Architects who answer questions, write articles, and produce videos on Experts Exchange. 99% of them have full time tech jobs - they volunteer their time to help other people in the technology industry learn and succeed.
We can't guarantee quick solutions - Experts Exchange isn't a help desk. We're a community of IT professionals committed to sharing knowledge. Our experts volunteer their time to help other people in the technology industry learn and succeed.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.