Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 4 [CLO-1] Consider the class Pen. It has a color (String) and a length (double). It has an initialization constru this class is given

image text in transcribed
image text in transcribed
Question 4 [CLO-1] Consider the class Pen. It has a color (String) and a length (double). It has an initialization constru this class is given (.e. do not write the class methods). Write a method readPens(String inputFileName) that does the following: 1. opens the input file name for reading 2. Reads the the color and the length of each pen in the file 3. creates an object of type Pen and fills it with the read information 4. then displays this object using the toString() method of the class pen. 5. Handel all possible exceptions Sample input file Blue 30.5 Red 20.2 Black 25.9 For the toolbar press AUT-F1 (PC) or ALT-FN-F10 (Mac) Bg S Paragraph Arial 14px 111 Question 4 of E 4 points Save Ar length (double). It has an initialization constructor, a default constructor, setters and getters, and a toString method. Assume the following: nformation Ef the class.pen 15 A 2 3 O QS

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

Focus On Geodatabases In ArcGIS Pro

Authors: David W. Allen

1st Edition

1589484452, 978-1589484450

More Books

Students also viewed these Databases questions