Write a java for file processing according to rules

Assignment Help Basic Computer Science
Reference no: EM13308270

File processing

Write a Java for file processing according to the following rules. The program requested for this project must have a text menu like this:

0 - Exit

1 - Select file

2 - Display

3 - Reverse

Select option:

The menu is displayed and the user must select an option (a number between 0 and 3). The action corresponding to the selection is performed, then the menu is displayed again and the user can choose another option. This cycle is repeated until the user selects 0, which exits the loop and ends the program.

The options are:

0 - Exit

This options ends the program

1 - Select file

The user is prompted for a file name. This is the first options that must be selected by the user. All the options below are working on the file selected here. After performing several operations on the selected file, the user can select another file and work on it.

2 - Display

This option displays the content of the selected file on the screen. If no file was selected an error message is displayed.

3 - Reverse

The file is read into memory, all of it in one buffer, and the buffer is reversed, then the file is overwritten. For simplicity, we may assume that the maximum size of the file is 200000 bytes. If no file was selected an error message is displayed.

Reference no: EM13308270

Questions Cloud

What is the fundamental frequency of the air column : One of the harmonics of a column of air open at one end and closed at the other has a frequency of 448 Hz, What is the fundamental frequency of the air column
List the set of all possible combinations of vehicles : The traffic that makes a left turnat an intersection consists of two types of vehicles, Type A andB. A type A vehicle is twice the length of the type B. THe left turn lane can accommodate ten vehicles of type B, five oftype A.
How many hits does the sequence exhibit : Assume LRU replacement policy, for each sequence, how many hits does the sequence exhibit?
Define a 1-d array named people types : Define a 1-D array named people Types that can store a maximum of 50 integer values that will be entered at the keyboard.
Write a java for file processing according to rules : The file is read into memory, all of it in one buffer, and the buffer is reversed, then the file is overwritten. For simplicity, we may assume that the maximum size of the file is 200000 bytes. If no file was selected an error message is displayed..
Write a php script that computes the total cost : Write a PHP script that computes the total cost of the ordered light bulbs from above after adding 6.2 percent sales tax. The program must inform the buyer of exactly what was ordered, in a table.
Write a java method called smallestindex : write a java method called smallestIndex, which takes as its parameters a 1-d int array and its size, and returns the index variable of the smallest element in the array and the smallest element in the list. Write a java method that uses the metho..
Compute how many joules of energy does the battery lose : A 12 V battery causes a current of 0.7A through a resistor. How many joules of energy does the battery lose in a minute
Write a function called class average : Write a function called class Average that takes in an array of numbers and, after normalizing the grades in such a way that the highest corresponds to 100, returns the letter grade of the class average.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Explaining regular language and context-free language

Let L1 be a regular language and L2 be a context-free language, both defined over the same alphabet Σ.

  Explaining logical knowledge base represents the world

A logical knowledge base represents the world using a set of sentences with no explicit structure. Analogical representation, on the other hand, has physical structure that corresponds.

  The load master for a freighter

The load master for a freighter wants to determine the mix of cargo to be carried on the next trip. The ship's volume limit for cargo is 100,000 cubic meters, and it weight capacity is 2,310 tons.

  How many instructions can the processor execute

Assume that we are working on a workstation with an instruction rate of 500 MIPS. How many instructions can the processor execute between the receipt of each individual bit of the message?

  Which of the following addresses are not allowed on internet

Which of the following addresses are not allowed on the internet?

  Write program in java to test the class

In this chapter, the class Date was designed to implement the date in a program, but the method setDate and the constructor with parameters do not check whether the date is valid before storing the date in the data members.

  Java is a complete development language and platform

You have learned that Java is a complete development language and platform.

  What are the advantages of inheritance

In C++, What are the advantages of Inheritance? What are the advantages of Composition?

  Write a fragment of code that accepts integers

write a condition to test if the point is outside the rectangle. Assume that x increases to the right and that y increases to the top. 2.Write a fragment of code that accepts integers from the user until a negative number is entered. The prompt sh..

  How would you recommend that encyclopedia

How would you recommend that Encyclopedia Britannica adapt to this new threat

  Event drive programming

Lets look at event drive programming. What is an event driven program? What are events associated with? What are examples of common events?

  Justify five reasons not consider smartphone to computer

justify at least five reasons why you would or would not consider a smartphone and other cell phones to be computer systems

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