Advertisement
EconomicSerg

Meet two aliens!

Jan 10th, 2021
307
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Meet2Aliens
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             MeetAlien();
  10.             Console.WriteLine("-----------");
  11.             MeetAlien();
  12.  
  13.             // Wait before closing
  14.             Console.ReadKey();
  15.         }
  16.  
  17.         static void MeetAlien()
  18.         {
  19.             Random numberGen = new Random();
  20.  
  21.             string name = "X-" + numberGen.Next(10, 9999);
  22.             int age = numberGen.Next(10, 500);
  23.  
  24.             Console.WriteLine("Hi, I'm " + name + "!");
  25.             Console.WriteLine("I'm " + age + " years old!");
  26.             Console.WriteLine("Oh, and I'm an alien!");
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement