Write a java program that reads the width and length for a set
of rectangles (unknow numbers) from input file (input.txt). The
program should compute the area for each rectangle and show the
result on the run screen as shown bellow.
Also, you need to consider the following cases:
Input.txt:
6.0 2.0
4.0 4.0
2.0 4.0
-4.0 5.0
Output/run screen :
Rectangle(1) - Area = 12.0
Rectangle(2) - ERROR, this is square not rectangle!
Rectangle(3) - Area = 8.0
Rectangle(4) – ERROR, Invalid width or length number!!
Write a java program that reads the width and length for a set of rectangles (unknow numbers) from input file (input.txt
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am