simeon_petrov

Homework 5 Problem 4

Sep 12th, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Problem_4_Rectangles
  8. {
  9. class Rectangles
  10. {
  11. static void Main()
  12. {
  13. Console.Write("Enter the weigh: ");
  14. double w = double.Parse(Console.ReadLine());
  15. Console.Write("Enter the height: ");
  16. double h = double.Parse(Console.ReadLine());
  17. double p = 2*w+2*h;
  18. double area = w*h;
  19.  
  20. Console.WriteLine("| width | height | perimeter| area |");
  21. Console.WriteLine("|{0,10}|{1,10}|{2,10}|{3,10}|", w, h, p, area);
  22.  
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment