Create a console-mode executable class

Assignment Help Programming Languages
Reference no: EM13332164

Create a console-mode executable class (no GUI in this project; let's keep it simple) using the following specifications:

  • Name your executable class RockFiles
  • Prompt the user to enter the full (absolute) path and filename of the input file to read

o  Read the path/file name from the keyboard and use it for opening and processing the input file
o  The input file will contain an unknown number of rows up to a maximum of 200 that will contain both good and bad data
o  Using ONLY File class supplied methods, test for file's existence and the fact that it is a file MUST be verified PRIOR to opening the file.
-  If file does not exist OR if the user entry is not a file, exit the program immediately (do not try opening the file) and supply an appropriate message to the screen explaining that they program is terminating and why.

  • Hard-code (do not prompt for & read) the absolute path and name of the first output file.

o  Must be called validRecords.csv and placed in the root directory of the "D:" drive.
-  Use code that will allow it to be used on as many platforms as you can; don't hard code the separator (\ or /)...demonstrated in class.
o  This is where you will write your "valid" records from your array of type Rocks (the interface from the last project)...yes, you again are using polymorphism.

  • Hard-code the absolute path and name of a second output file.

o  Must be called suspense.csv and must also be placed in the root directory of the "D:" drive.
-  This file will hold ALL records with formatting issues (wrong type of data in a field), and/or the wrong number of fields necessary to instantiate ANY of the 3 classes used.
-  Hint:  If a Monument object is to be instantiated and placed into the array, how many fields should be on the input line? What about the MonumentBase class?  You are still only to use the largest constructors of each class.

  • Create an array of type Rocks FROM THE VALID INPUT LINES ONLY (based upon the above two qualifiers) in the same manner as the supplied Project 03 executable class; after you validate the line and determine it is OK, just instantiate the appropriate object and add the object to the array.

o  You must determine if a line is valid by using exception processing (when appropriate) AND field (token) counting (when appropriate) and any bad data lines are to be written to suspense.csv EXACTLY AS THEY ARE/EXIST
IN THE INPUT FILE...just write the entire input String row itself without any changes.
-  For a full description of bad data, see below
-  The input file layout that must be used follows at the end of this document

  • Write to the "bad data" (suspense.csv) file, each line written EXACTLY as it exists in the input file, when a line contains:

o  The incorrect number of fields to instantiate EITHER of the 2 object types...Monument or MonumentBase
o  OR Character or String data in a numeric field (improper format)
o  OR float ing point data in an integer field (improper format)
-  Do not worry about any other data checks; the above three are sufficient for this project to cut down on
programming time.

  • Create a second file (validRecords.csv), WRITING IT FROM YOUR Rocks array AFTER THE ARRAY HAS BEEN

CREATED IN ITS ENTIRETY (entire input file processed), which contains all valid records/lines (and ONLY valid records) from the input file.
o  This must be the LAST function of your program and written only after the Rocks Array has been satisfactorily completed; write it from a single loop that does nothing else but write the file.
o  A record is valid when it passes the aforementioned data checks.

Reference no: EM13332164

Questions Cloud

Evaluate the molalities of the aqueous solutions : Calculate the molalities of the following aqueous solutions. (a) 2.26 M sugar (C12H22O11) solution (density of solution = 1.12 g/mL) m (b) 0.93 M NaOH solution (density of solution = 1.04 g/mL) m (c) 5.64 M NaHCO3 solution (density of solution = 1..
What is the change in kinetic energy of the racquet ball : A racquet ball with mass m = 0.237 kg is moving toward the wall at v = 12 m/s and at an angle of ? = 30° with respect to the horizontal. What is the change in kinetic energy of the racquet ball
Compute the percent by mass of the solute : Calculate the percent by mass of the solute in each of the following aqueous solutions. (a) 3.57 g of NaBr in 78.2 g of solution % (b) 31.0 g of KCl in 144 g of water % (c) 2.8 g of toluene in 29 g of benzene %
Financed by common shares and debt : Halifax Inc. is considering a project that requires an initial investment of $10 million and promises to generate an annual after-tax cash flow of $1 million perpetually. This firm is only financed by common shares and debt
Create a console-mode executable class : Create a console-mode executable class (no GUI in this project; let's keep it simple) using the following specifications.
Calculate how long does the trip take : A river has a steady speed of 0.482 m/s. A student swims upstream a distance of 1.00 km and swims back to the starting point. If the student can swim at a speed of 1.24 m/s in still water, how long does the trip take
Explain moles of ethylene glycol of water : Calculate the molality of each of the following solutions. (a) 13.7 g of sucrose (C12H22O11) in 671 g of water m (b) 7.24 moles of ethylene glycol (C2H6O2) in 3808 g of water
Find the velocity of the airplane relative to the ground : The pilot of an airplane notes that the compass indicates a heading due west. The airplane's speed relative to the air is 120 km/h. Find the velocity of the airplane relative to the ground
Uses under the lockbox system : What amount of cash will be made available for other uses under the lockbox system?

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd