Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package BasicSyntax;
- import java.util.Scanner;
- public class P01StudentInformation {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- String studentName = scanner.nextLine();
- int age = Integer.parseInt(scanner.nextLine());
- double avgGrade = Double.parseDouble(scanner.nextLine());
- String resultText = String.format("Name: %s, Age: %d, Grade: %.2f",
- studentName, age, avgGrade);
- System.out.println(resultText);
- //System.out.printf("Name: %s, Age: %d, Grade: %.2f",studentName, age, avgGrade);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement