Advertisement
Guest User

Problem 2.PrintCompanyInformation

a guest
Apr 1st, 2014
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class PrintCompanyInfo
  5. {
  6.     static void Main()
  7.     {    // Company info
  8.         Console.Write("Company name:\t");
  9.         string companyName = Console.ReadLine();
  10.         Console.Write("Company address:\t");
  11.         string companyAddress = Console.ReadLine();
  12.         Console.Write("Company number:\t");
  13.         string companyPhone = Console.ReadLine();
  14.         Console.Write("Company fax:\t");
  15.         string companyFax = Console.ReadLine();
  16.         if (companyFax == "") // Check is there a fax number
  17.         {
  18.             companyFax = "(No fax)";
  19.  
  20.         }
  21.         Console.Write("Web site:\t");
  22.         string webSite = Console.ReadLine();
  23.         // Manager's information
  24.         Console.Write("Manager's first name:\t");
  25.         string mangFirstName = Console.ReadLine();
  26.         Console.Write("Manager's second name:\t");
  27.         string mangSecondName = Console.ReadLine();
  28.         Console.Write("Manager's age:\t");
  29.         byte mangAge = byte.Parse(Console.ReadLine());
  30.         Console.Write("Manager's phone number:\t");
  31.         string mangPhone = Console.ReadLine();
  32.  
  33.         Console.Clear();
  34.         Console.WriteLine("{0}\nAddress: {1}\nTel. {2}\nFax: {3}\nWeb site: {4}",companyName,companyAddress,companyPhone,companyFax,webSite);
  35.         Console.WriteLine("Manager: {0} {1} (age: {2}, tel. {3}",mangFirstName,mangSecondName,mangAge,mangPhone);
  36.         Console.ReadLine();
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement