Advertisement
coasterka

RectAreaPerimeter

Mar 11th, 2014
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RectAreaPerimeter
  4. {
  5.     class RectAreaPerimeter
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             Console.WriteLine("Enter a random whole number for side A: ");
  10.             int A = int.Parse(Console.ReadLine());
  11.             Console.WriteLine("Enter a random whole number for side B: ");
  12.             int B = int.Parse(Console.ReadLine());
  13.             //calculations
  14.             int S = A * B;
  15.             Console.WriteLine("The rectangle's surface is: " + S);
  16.             int P = (2 * A) + (2 * B);
  17.             Console.WriteLine("The rectangle's perimeter is: " + P);
  18.         }
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement