Advertisement
Guest User

2D Task

a guest
Jan 21st, 2018
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.93 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 _2D_RectangleArea
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. Console.Write("x1= ");
  14. var x1 = double.Parse(Console.ReadLine());
  15. Console.Write("y1= ");
  16. var y1 = double.Parse(Console.ReadLine());
  17. Console.Write("x2= ");
  18. var x2 = double.Parse(Console.ReadLine());
  19. Console.Write("y2= ");
  20. var y2 = double.Parse(Console.ReadLine());
  21. var area = (x1 - x2) * (y2 - y1);
  22. var perimeter = (x1 - x2) +(y2 - y1)+ (x1 - x2) + (y2 - y1);
  23. {
  24. Console.Write("area= ");
  25. Console.WriteLine(area);
  26. Console.Write("perimeter= ");
  27. Console.WriteLine(perimeter);
  28. }
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement