Advertisement
myrdok123

01. Student Information

May 15th, 2024
653
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. package ProgramingBasicsOverview;
  2.  
  3.  
  4. import java.util.Scanner;
  5.  
  6. public class P01_StudentInformation {
  7.  
  8.     public static void main(String[] args) {
  9.  
  10.         Scanner scanner = new Scanner(System.in);
  11.  
  12.         String studentName = scanner.nextLine();
  13.         int age = Integer.parseInt(scanner.nextLine());
  14.         double grade = Double.parseDouble(scanner.nextLine());
  15.  
  16.         System.out.printf("Name: %s, Age: %d, Grade: %.2f", studentName, age, grade);
  17.  
  18.     }
  19. }
  20.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement