Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Compete this class. The program output should contain 13 lines on input 6, and 19 lines on input 9 |Write a Java program A2p2.java with
Compete this class. The program output should contain 13 lines on input 6, and 19 lines on input 9
|Write a Java program A2p2.java with a unique class named A2p2 and no named packages that accepts one command line argument assumed to be a positive integer N. The program should generate widths and heights (random integers between 5 and 100 inclusive) for some rectangles and print the width and heights and areas for those rectangles whose area is greater than 2022. The program should stop generating the rectangles once N rectangles have been printed and finally report how many rectangles are discarded because their area is not greater than 2022. A sample run can look like the following: Large random rectangle 1: width: 93; height: 99; area: 9207. Large random rectangle 2: width: 82; height: 78; area: 6396. Large random rectangle 3: width: 43; height: 91; area: 3913. Large random rectangle 4: width: 82; height: 50; area: 4100. Number of discarded small rectangles is 7 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started