Question:
How would I do this in Java?
anonymous
2009-02-16 22:23:52 UTC
I tried to solve this so many times but I keep getting stuck at trying to get the character imported from the file...please help.

1. Consider the following incomplete Java program:
public class Ch3_PrExercise1
{
public static void main(String[] args)
{
...
}
}
ƒa. Write Java statements that import the classes Scanner, FileReader, Print-
Writer, and FileWriter from the packages java.util and java.io.
b. Write statements that declare inFile to be a reference variable of the type
Scanner and outFile to be a reference variable of the type PrintWriter.
c. The program will read the data from the file inData.txt and write the output to
the file outData.dat.Write statements to open both these files, associating
inFile with inData.txt, and associating outFile with outData.dat.
d. Suppose that the file inData.txt contains the following data:
56 38
A
7 8
Write statements so that after the program executes, the contents of the file
outData.dat are as shown below. If necessary, declare additional variables.
Your statements should be general enough so that if the content of the input file
changes and the program is run again (without editing and recompiling), it outputs
the appropriate results.
The sum of 56 and 38 = 94.
The character that comes after A in the Unicode set is B.
The product of 7 and 8 = 56.
e. Write the statement that closes the output file.
f. Write a Java program that tests the Java statements you wrote in parts a through e.
Four answers:
chalupa3266
2009-02-17 02:54:38 UTC
Well let me introduce my calculations.



A) Lets let this Java assignment represent X.

B) Lets let your teacher represent Y.

C) Lets let your mouth represent M.

D) Lets let your teachers penis represent P.

E) Lets let you (yourself) represent L.



Now in order to achieve the answer we must use the following formula.



L(X) + L(M) + Y(P) = ?



Only Einstein was able to solve this equation and never revealed the steps, only the solution , which states that L must use M to please Y and P, in order to find the answer for X.





Hope this helped
?
2016-05-26 09:32:18 UTC
For all answers behind your each question you need to go through Java Specifications that were designed when the Java language developers first came up with the idea... Do a google search for Java specification and go through it. I am sure it'll answer to all your WHY's!!!
deonejuan
2009-02-16 23:03:15 UTC
http://www.java2s.com/Code/JavaAPI/java.util/newScannerFileReaderfile.htm
Fudge
2009-02-17 00:59:29 UTC
Please do ur readings then ask the question :)


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...