Hello everyone, I am developing an application which makes use of abstract classes.
I am trying to create a switch statement, which I have placed in the abstract class as all the subclasses can use this.
I would like to refer back to this statement in a scanner which is located in another class, so I can use the input (e.g., 1, 2, 3) to produce a value which can later be added to another value in the scanner.
I have this so far, the first is in an abstract class.
public double chooseScore (int score) {
switch (score) {
case 1: return 0.35;
case 2: return 0.48;
case 3: return 0.62;
default: return 0.00;
Then in another class the scanner, which does not seem to be finding the int score.
public class gradeTester
{
public static void main (String [] args){
Scanner in = new Scanner(System.in);
{
int chooseGrade;
System.out.print("Choose Grade ");
chooseGrade = in.nextInt();
system.out.println("Your grade is: + Grade);
Can anyone help me back on the right track, thanks!