CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2016
    Posts
    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

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    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
  •  





Click Here to Expand Forum to Full Width

Featured