Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java Question Completion Status: Question 3 Consider the class Pen. It has a color (String) and a length (double) and a price (double) Write

in java image text in transcribed
Question Completion Status: Question 3 Consider the class Pen. It has a color (String) and a length (double) and a price (double) Write a method countPens that receives an input file name, and does the following: public int countPens(String inputFileName) 1. opens the input file name for reading 2. reads until the end of the input file the information of a pen object 3. Creates an object of type Pen 4.counts and returns the number of pen objects read from the file Sample input file: Red 10.0 20.0 Blue 12.0 50.0 Green 9.0 30.0 Black 12.0 10.0 The methos should return 4 For the toolbar, press ALT-E10 (PC) or ALT+FN+F10 (Mac), BIUS Paragraph Arial 14px Question Completion Status: Question 3 Consider the class Pen. It has a color (String) and a length (double) and a price (double) Write a method countPens that receives an input file name, and does the following: public int countPens(String inputFileName) 1. opens the input file name for reading 2. reads until the end of the input file the information of a pen object 3. Creates an object of type Pen 4.counts and returns the number of pen objects read from the file Sample input file: Red 10.0 20.0 Blue 12.0 50.0 Green 9.0 30.0 Black 12.0 10.0 The methos should return 4 For the toolbar, press ALT-E10 (PC) or ALT+FN+F10 (Mac), BIUS Paragraph Arial 14px

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

Database Programming With Visual Basic .NET

Authors: Carsten Thomsen

2nd Edition

1590590325, 978-1590590324

More Books

Students also viewed these Databases questions

Question

LO5 Highlight five external recruiting sources.

Answered: 1 week ago