Respuesta :
Answer:
// here is code in java.
import java.util.*;
// class definition
class BookstoreCredit
{
/* method that display descriptive message with name and grade point */
public static void fun(String name,double grade)
{
// multiply grade with 10
grade=grade*10;
// print the message
System.out.println(name+"\'s average grade is $"+grade);
}
// main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// scanner object to read innput
Scanner s=new Scanner(System.in);
// variables
String s_name;
double grade;
System.out.print("Please enter the name:");
s_name=s.nextLine();
System.out.print("Please enter the grade point:");
grade=s.nextDouble();
}catch(Exception ex){
return;}
}
}
Explanation:
Create variable s_name of string type and grade of double type.Read the student name and grade from user.call the fun() with these two parameter, where grade is multiplied by 10 and print the descriptive message which has student name and echoes the grade point average.
Output:
Please enter the name:john
Please enter the grade point:3.2
john's average grade is $32.0