Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. File Handling

File Handling

Scheduled Pinned Locked Moved Java
javacsshelptutorialquestion
8 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11548082
    wrote on last edited by
    #1

    Some one help me with the second bit of this question Java can work well with files. It is a matter of importing the relevant files in the java.io class and have the files executed. In executing files, some times exceptions happen. For example, the file in code may not be there on the disk. That makes the code unable to run properly. Therefore the exception has to be either caught or thrown. In this assignment, you are going to read data from a file and then write it in another file. The file given 'marks.txt' should be written with the same data but in another file 'marks.xls'. Since the marks are only coursework and Exam, in the marks.xls, indicate the final mark where final mark = cw*0.40 + ex*0.60. Also indicate if the candidate Excelled (over 70%), passed (50% - 69) and Fail (Less than 50%)

    L J 2 Replies Last reply
    0
    • U User 11548082

      Some one help me with the second bit of this question Java can work well with files. It is a matter of importing the relevant files in the java.io class and have the files executed. In executing files, some times exceptions happen. For example, the file in code may not be there on the disk. That makes the code unable to run properly. Therefore the exception has to be either caught or thrown. In this assignment, you are going to read data from a file and then write it in another file. The file given 'marks.txt' should be written with the same data but in another file 'marks.xls'. Since the marks are only coursework and Exam, in the marks.xls, indicate the final mark where final mark = cw*0.40 + ex*0.60. Also indicate if the candidate Excelled (over 70%), passed (50% - 69) and Fail (Less than 50%)

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      If this is question set by your professor, then I strongly suggest you find another course where the teacher actually understands the subject. In the meantime, exactly what help do you need?

      U 1 Reply Last reply
      0
      • L Lost User

        If this is question set by your professor, then I strongly suggest you find another course where the teacher actually understands the subject. In the meantime, exactly what help do you need?

        U Offline
        U Offline
        User 11548082
        wrote on last edited by
        #3

        just help me with the reading and writing part of the program that will read data from the created text file that contains the names and marks of students and then writes the read data to an excell files while commenting on their marks as stated in the questions

        Richard Andrew x64R L 2 Replies Last reply
        0
        • U User 11548082

          just help me with the reading and writing part of the program that will read data from the created text file that contains the names and marks of students and then writes the read data to an excell files while commenting on their marks as stated in the questions

          Richard Andrew x64R Offline
          Richard Andrew x64R Offline
          Richard Andrew x64
          wrote on last edited by
          #4

          You keep saying "help me" but you fail to say what help you need.

          The difficult we do right away... ...the impossible takes slightly longer.

          1 Reply Last reply
          0
          • U User 11548082

            Some one help me with the second bit of this question Java can work well with files. It is a matter of importing the relevant files in the java.io class and have the files executed. In executing files, some times exceptions happen. For example, the file in code may not be there on the disk. That makes the code unable to run properly. Therefore the exception has to be either caught or thrown. In this assignment, you are going to read data from a file and then write it in another file. The file given 'marks.txt' should be written with the same data but in another file 'marks.xls'. Since the marks are only coursework and Exam, in the marks.xls, indicate the final mark where final mark = cw*0.40 + ex*0.60. Also indicate if the candidate Excelled (over 70%), passed (50% - 69) and Fail (Less than 50%)

            J Offline
            J Offline
            jschell
            wrote on last edited by
            #5

            Member 11582451 wrote:

            second bit of this question

            Which is what exactly? Following is java classes that you would use for reading/writing files. http://docs.oracle.com/javase/7/docs/api/java/io/package-summary.html[^] You can google for example on how to read a text file and write a text file.

            U 1 Reply Last reply
            0
            • U User 11548082

              just help me with the reading and writing part of the program that will read data from the created text file that contains the names and marks of students and then writes the read data to an excell files while commenting on their marks as stated in the questions

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              You can use the Scanner class[^] to read the input file, and follow the link that jschell gave you for writing.

              U 1 Reply Last reply
              0
              • J jschell

                Member 11582451 wrote:

                second bit of this question

                Which is what exactly? Following is java classes that you would use for reading/writing files. http://docs.oracle.com/javase/7/docs/api/java/io/package-summary.html[^] You can google for example on how to read a text file and write a text file.

                U Offline
                U Offline
                User 11548082
                wrote on last edited by
                #7

                i want to read from a text file forexample me.txt and copy the text that is in me.txt and write it to a new excel sheet.

                1 Reply Last reply
                0
                • L Lost User

                  You can use the Scanner class[^] to read the input file, and follow the link that jschell gave you for writing.

                  U Offline
                  U Offline
                  User 11548082
                  wrote on last edited by
                  #8

                  Thanks Richard MacCutchan, I read through and it was helpful

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups