Examlex
Programming
Write a static method named randomRects that calculates and displays the area of randomly-generated rectangles. The width and height of each rectangle should be a randomly generated integer between 1 and 10 inclusive. Your method should keep generating random rectangles until an increasing sequence of four areas is printed. In other words, if the last four rectangles generated have areas of a1, a2, a3 and a4 such that a1 < a2 < a3 < a4, the method should print the final message and stop. So your method will generate at least 4 total rectangles but possibly many more, stopping only when it sees 4 in a row with areas in increasing order.
The following calls demonstrate your method's behavior. Your method should match this output format exactly:
Generation Y
Also known as Millennials, this includes individuals born approximately between 1981 and 1996, known for their familiarity with digital technology, media, and communications.
Generation Z
The demographic cohort following Millennials, typically considered to be born between the mid-1990s to the early 2010s, noted for their digital nativism and diverse perspectives.
Smart Phone
A mobile phone that performs many of the functions of a computer, typically having a touchscreen interface, internet access, and an operating system capable of running downloadable apps.
Traditionalists
Individuals or societal groups who adhere to long-established customs, beliefs, or practices, resisting change or innovation.
Q1: Which English tradition of landscaping did Frederick
Q10: What Indian painting technique includes polishing pigments
Q16: Is faster economic growth unambiguously better?<br>A)No, because
Q23: Rosalba Carriera specialized in painting portraits with<br>A)ink.<br>B)acrylic.<br>C)pastels.<br>D)wood.
Q23: A large factory pours its toxic wastewater
Q48: Profits account for about 30 cents out
Q69: Government spending plays no role in meeting
Q113: If California were a separate economy, it
Q118: Most Americans<br>A)have accurate perceptions of the level
Q176: A vertical line always has a slope