-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGetUserInfoTest.java
37 lines (32 loc) · 1.13 KB
/
GetUserInfoTest.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import java.util.Scanner;
public class GetUserInfoTest
{
public static void main (String[] args)
{
String name;
String course;
int numberofunits;
float rate;
int misc;
float tuition;
float amount;
Scanner inputDevice = new Scanner (System.in);
System.out.print("Name: ");
name = inputDevice.nextLine();
System.out.print("Course: ");
course = inputDevice.nextLine();
System.out.print("Number of Units: ");
numberofunits = inputDevice.nextInt();
System.out.print("Rate: ");
rate = inputDevice.nextFloat ();
System.out.print ("Misc: ");
misc = inputDevice.nextInt();
tuition = numberofunits * rate;
amount = tuition + misc;
System.out.println("=======================================");
System.out.println("Name: " + name + " \tCourse:" + course);
System.out.println("Tuition Fee: " +tuition);
System.out.println("Total Amount: " +amount);
System.out.println("======================================");
}
}