-
November 27th, 2016, 04:54 AM
#1
Need help with Java File input and file output program
I need to create a program that uses a MathInput.cvs file. It needs to take the data in this file and calculate and send the results to the output file MathOutput.csv .
The results should be something like this for the first set in the output file "MathOutput.csv".* Notice that the format included the name of the operation. followed by the number, then the word Total", *followed by the result of the operation.* At the end of a set of operations, your program should include a summary line with the text "Number of elements = ", then the actual number of elements, followed by the text "Total = ", followed by the calculated total of the operations, followed by the text "Average = " followed by the calculated average.* Between each set of output, display a line of *. See the example below:
Add * ******* 2* *** Total* ******* 2
Add** ******* 6 **** Total **** *** 8
Subtract** * 9* *** Total **** ** -1
Multiply* * 10 **** Total* ****** -10
Number of elements = 4, Total = -10, Average = -2.5
********************************************
Divide******* 4***** Total* 0
Multiply***** 5***** Total 0
Subtract**** 6***** Total -6
Number of elements=3, Total = -6, Average = -2
********************************************
I have attached the MathInput.cvs file and my attempt on the src code. I need help with the rest please. FinalProject.javaMathInput.txt
-
November 27th, 2016, 08:01 AM
#2
Re: Need help with Java File input and file output program
Please post the code here that you are working with. Also post any specific questions or problems you are having.
Be sure to wrap the code in code tags to preserve formatting.
Norm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|