Advertisement
Spocoman

01. Student Information

Jan 10th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System;
  2.  
  3. namespace StudentInformation
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string name = Console.ReadLine();
  10.             int age = int.Parse(Console.ReadLine());
  11.             double grade = double.Parse(Console.ReadLine());
  12.  
  13.             Console.WriteLine($"Name: {name}, Age: {age}, Grade: {grade:F2}");
  14.         }
  15.     }
  16. }
  17.  
  18.  
  19. Bad practice!
  20.  
  21. using System;
  22.  
  23. namespace KeepCalm
  24. {
  25.     class Program
  26.     {
  27.         static void Main()
  28.         {
  29.             Console.WriteLine($"Name: {Console.ReadLine()}, Age: {Console.ReadLine()}, Grade: {Console.ReadLine()}");
  30.         }
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement