Question: Below is a code that I keep getting an error code. Can you help? package chegg; import java.util.Scanner; //importing scanner from java utils public class
Below is a code that I keep getting an error code. Can you help?
package chegg; import java.util.Scanner; //importing scanner from java utils public class Harmosa{ // class name BookstoreCredit public static void main(String[] args) { Scanner scan = new Scanner(System.in); // creating scanner object System.out.print("Please enter the name: "); // prompting for user String name=scan.next();// scanning the input string and assigning to name System.out.print("Enter Grade point average: "); double average=scan.nextDouble(); // scanning the input average and assigning to average // Display method call display(name,average); }// display method with two arguments i.e name and avearge public static void display(String name,double avrg){ // displaying name average and credit description System.out.println("Student name is: "+name); System.out.println("Student gradepoint average is: "+avrg); double credit=(avrg*10);// credit is 10 times the students average gradepoint System.out.println("Students credit: "+credit); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
