Create a Hierarchy chart that will accurately represent the information in the scenario below: “A main programme calls three modules: getDetails(), calculateFees(), and register(). The calculateFees() module calls a module called courses() and a module called courseCost(). The register() module calls a module called printProof().”
import java.util.Scanner;
public class Main
{
static void getDetails(){
Scanner input=new Scanner(System.in);
System.out.println("Enter the student name");
String name=input.next();
System.out.println("Enter the course: ");
String course=input.next();
System.out.println(name+" the price of "+course+" is 5000");
}
static void calculateFees(){
Scanner input=new Scanner(System.in);
System.out.println("Enter the number of courses enrolled ");
int n=input.nextInt();
double price=n*5000;
System.out.print("Total fees is: "+price);
}
static void register(){
Scanner input=new Scanner(System.in);
System.out.println("Enter your name ");
String n=input.next();
System.out.println("Enter the number of courses you want to enroll ");
int c=input.nextInt();
for(int i=0;i<=c;i++){
System.out.print(i);
}
}
public static void main(String[] args) {
getDetails();
calculateFees();
register();
}
}
Comments
Leave a comment