Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 2 0 pts ) Suppose someone wants to produce a menu prompt on - 5 creen cartography ( map - making ) application that

(20 pts) Suppose someone wants to produce a menu prompt on-5creen cartography (map-making) application that prints the five lines below: The main menu has three available options:
Press the "N" key to create a new map.
Press the "l" key to load an existing map.
Press the "Q" key to quit the application.
The default map storage directory is "CiMyMaps"
Create the above menu prompt using a single System.out.printlin statement.
(40 pts) The following changes deal with the Rectangle class from Week 2 material, available via BlackBoard under "Chapter 2 Code" in "Supplementary/Misc." Each part is worth 10 points.
i. Modify the dimension attributes of the Rectangie class to properly handle the double datatype instead of simple integers.
ii. Modify the Rectangle class to permit construction of rectangles using zero input arguments (in which case both height and width are set to 1) or one input argument (in which case the height is set to the input value, and the width is set to be 1). Hint you will need to employ overloading.
iii. Modify the Rectangle class to have method double PrintMaxSide(). which returns (not prints!) the largest available dimension between the height and width (i.e. if the height is larger, it should be returned, if the width is larger, it should be returned instead)
iv. Modify the Rectangle class to have method void IsValid() which either i. prints This is a valid rectangle." If height and width are both positive or ii. prints "This is not a valid rectangle." if either height or width is 0 or negative.
Note: parts iii and iv will almost certainly require if statements.
(40 pts) This problem deals with reading input from the kevboard and files and applying simple arithmetic calculations. Create class Product Cumulator with the i. void Product fromkeyboard():
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

T Sql Fundamentals

Authors: Itzik Ben Gan

4th Edition

0138102104, 978-0138102104

More Books

Students also viewed these Databases questions