Create a package named reading_with_exceptions

Assignment Help JAVA Programming
Reference no: EM132076130

Need help with this java code. fill in lines where needed. Also, not sure how to make the text files and load them into program. Thanks!!

Create a package named "reading_with_exceptions". Write a class named: Reading_With_Exceptions with the following method:

void process(String inputFilename)

Your program will encounter errors, and we want you to gracefully handle them in such a way that you print out informative information and continue executing.

Your process routine will try to open a file with the name of inputFilename for input. If there is any problem (i.e. the file doesn't exist), then you should catch the exception, give an appropriate error and then return. Otherwise, your program reads the file for instructions.

Your process routine will read the first line of the file looking for an outputFilename String followed by an integer. i.e.:

outputFilename number_to_read

Your program will want to write output to a file having the name outputFilename. Your program will try to read from "inputFilename" the number of integers found in "number_to_read".

Your process method will copy the integers read from inputFilename and write them to your output file(i.e. outputFilename). There should contain 10 numbers per line of output in your output file.

If you encounter bad input, your program should not die with an exception. For example:

If the count of the numbers to be read is bad or < 0 you will print out a complaint message and then read as many integers as you find.

If any of the other numbers are bad, print a complaint message and skip over the data

If you don't have enough input numbers, complain but do not abort

After you have processed inputFilename, I would like your program to then close the output file and tell the user that the file is created. Then Open up the output file and copy it to the Screen.

Reference no: EM132076130

Questions Cloud

Creates an array capable of holding four shape objects : Create two subclasses of Shape: Circle and Square. Then, you should write a driver program with a main method .
Using recursion determine the number of tribble for any hour : Write a JAVA program that uses recursion to determine the number of tribble for any hour.
Write three overloaded methods that calculate averages : The first method takes two integer parameters, the second takes three integer parameters, and the third takes four integer parameters.
Write a recursive function called sumdigits : Write a recursive function called sumDigits with the following signature: public static long sumDigits(long n).
Create a package named reading_with_exceptions : Create a package named "reading_with_exceptions". Write a class named: Reading_With_Exceptions with the following method.
Find the work done hoisting : Find the work done hoisting a 1,500 pound generator 50 feet straight up into the air. Assume the force of gravity is acting straight downwards
What is the instantaneous rate of change : What is the instantaneous rate of change of the remaining amount of medication after 1 hour?
Calculate new dimensions for the textdraw panel : Calculate and save the difference between the two in both the height and width dimensions.
Create an array that holds hundred integers : Write a complete method (including a full method header) called contains.Create an array that holds 100 integers

Reviews

Write a Review

JAVA Programming Questions & Answers

  Enterprise java beans (ejb) in software development

Enterprise Java Beans (EJB) in software development, EJB technology, EJB application, Stateless Session Beans (SLSB), Stateful Session Beans (SFSB), Message Driven Bean (MDB), Entity Bean

  Write a method called writenums

Write a method called writeNums that takes an integer n as a parameter and prints to the console the first n integers starting with 1 in sequential order, separated by commas. For example, consider the

  Design into java code

As a design activity- the class diagram from a set of classes which form the basis for a simple project management tool. Your design should have the following classes: Employee Class, Project Class, Consultant Class, Manager Class, theAssignment Clas..

  Create a javafx application named bounce

Create a JavaFX Application named Bounce. In this Application you will use the Ball.java class to draw a red ball in the middle of a 500x500 window.

  Explain different vulnerabilities and attack

Calculate the messages sent in steps 1 to 4 if A is sending $ amount equals to your NYIT ID to C - Explain two different vulnerabilities and attack scenarios

  Prompt the user for a string that contains two strings

Prompt the user for a string that contains two strings separated by a comma - Store the strings in two separate variables and output the strings

  Part iyou have to write a computer program that will figure

part iyou have to write a computer program that will figure out the total of an order when given the amount of the

  How do i use an ejb to handle simple authentication

What is the difference between an Application server and a Portal server? How do I use an EJB to handle simple authentication to an LDAP directory?

  What would be an incorrect way of writing this equation

Jim develops 5 Java applications a year. Joe develops 10 Java applications a year. Jim gets paid $5000.00 per application, but Joe gets paid $10000.00 per application.

  Lydia runs a small nail salon in the town of new hope

1. Lydia runs a small nail salon in the town of New Hope. She is debating whether she should extend her hours of operation. Lydia figures that her sales revenue will depend on the number of hours the nail salon is open as shown in the table above. Sh..

  The user for number of letters

Write a java program that asks the user for number of letters in a word followed by those letters. Store those letters in an array. Then it calls a method called public static void toNumerals(char[] word) to determine the corresponding number for eac..

  Design an interface interactive game

First, design an interface InteractiveGame that generalizes the playing of any two-person game between a human player and the computer. Design two actual games, Nim and another game of your choice, except TicTacToe, that implement your Interactive..

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