Question

$10.00 Java I/O text (using eclipse)

Asked by :
jomiwhite
jomiwhite
Rating :No Rating
Questions Asked: 9
Tutorials Posted: 0
 
 
Q:

Create a package named cs520.hw4.part2. Using this package, create the following classes.

1. Create a class named Student as follows. The class keeps track of the student’s homework grades.
a. The instance (or member) private variables – name (String), homework1, homework2, homework3, homework4, homework5 and homework6 (all of type integer).
b. A single constructor with name as its argument.
c. The public set methods for the six homework instance variables. The get methods are optional.
d. A public computeAverage method which takes no arguments and returns a double showing the average homework grade for this student.
e. Override the toString method to return the string representation of this object in the format “The ’s average grade is ”.


2. Create a Test class to test the following functionality in its main method.
a. Use the BufferedReader class to read the data.txt file. The contents of the file are shown below. Create the data.txt file in HW4_lastName.
b. Read the contents of the text file one line at a time using a loop. The program should work for any number of input lines. Invoke the processInputData method for each line read.
c. Write a private method processInputData which processes its string input argument as follows.
1. Tokenize the string argument using the StringTokenizer class using the comma as the delimiter.
2. Extract the name token. Create a Student object and assign to the variable currentStudent.
3. Read each homework grade token one token at a time. Use the corresponding set method on the student object to set the instance value.
4. Display the string representation of the currentStudent object to the console.

 
attachement
 

Want to take a stab at the bounty and post a tutorial? Need clarification? Join us now or log in! Read more on how this works.
Available Tutorials to this Question
 
$10.00
A+ solution with screenshot
  • This tutorial hasn't been purchased yet.
  • Posted on Jul 30, 2012 at 5:41:22PM
Posted by :
lightsource
lightsource Not confirmed
Rating (2371):A+
Questions Asked: 4
Tutorials Posted: 5495,
Earned: $112,187.75
 
A:
Preview: ... see th ...

The full tutorial is about 10 words long plus attachments.

attachmentlogo

Attachments:
screenshot_test.jpg (30K)
cs520.zip (1K) 

 cs520/hw4/part2/Student.java
 cs520/hw4/part2/Test.java
 ]

 
$10.00
BETTER SOLUTION. Screenshots, documentation, code comments.
  • This tutorial hasn't been purchased yet.
  • Posted on Jul 30, 2012 at 6:50:26PM
Posted by :
lucky28
lucky28
Rating (241):A-
Questions Asked: 1
Tutorials Posted: 2750,
Blog Posts: 2,
Earned: $24,354.77
 
A:
Preview: ... . Screensho ...

The full tutorial is about 6 words long plus attachments.

attachmentlogo

Attachments:
screenshot.jpg (167K)
HW4_lastName.zip (160K) 

 HW4_lastName/data.txt
 HW4_lastName/hw4/part2/Student.java
 HW4_lastName/hw4/part2/Test.java
 HW4_lastName/screenshot.jpg
 ]

 
$10.00
A++ solution. Using Eclipse, BufferedReader, StringTokenizer etc. Properly commented. Snapshot
  • This tutorial was purchased 1 time and rated A+ by students like you.
  • Posted on Jul. 31, 2012 at 02:08:20AM
Posted by :
optimalsolutions
 
A:
Preview: ... ce it with the src folder of the project in eclipse. Put the file HW4 ...

The full tutorial is about 56 words long plus attachments.

attachmentlogo

Attachments:
src.zip (1K) 

 src/cs520/hw4/part2/Student.java
 src/cs520/hw4/part2/Test.java
 ]

HW4_lastName.txt (0K) (Preview)
Snapshot.jpg (352K)
 
$10.00
Java Prorgams using eclipse
  • This tutorial hasn't been purchased yet.
  • Posted on Jul 31, 2012 at 4:56:10PM
Posted by :
papasuka
papasuka Not confirmed
Rating (2):C-
Questions Asked: 0
Tutorials Posted: 73,
Earned: $87.56
 
A:
Preview: ... onal     public int getHomework1()     {   return homework1;   }     public int getHomework2()     {   return homework2;   }     public int getHomework3()     {   return homework3;   }     public int getHomework4()     {   return homework4;   }     public int getHomework5()     {   return homework5;   }     public int getHomework6()     {   return homework6;   }          // A public compute ...

The full tutorial is about 265 words long plus attachments.

attachmentlogo

Attachments:
cs520.zip (11K) 

 cs520/.classpath
 cs520/.DS_Store
 __MACOSX/cs520/._.DS_Store
 cs520/.project
 cs520/.settings/org.eclipse.jdt.core.prefs
 cs520/bin/cs520/hw4/part2/data
 cs520/bin/cs520/hw4/part2/Student.class
 cs520/bin/cs520/hw4/part2/StudentTest.class
 cs520/src/.DS_Store
 __MACOSX/cs520/src/._.DS_Store
 cs520/src/cs520/.DS_Store
 __MACOSX/cs520/src/cs520/._.DS_Store
 cs520/src/cs520/hw4/.DS_Store
 __MACOSX/cs520/src/cs520/hw4/._.DS_Store
 cs520/src/cs520/hw4/part2/.DS_Store
 __MACOSX/cs520/src/cs520/hw4/part2/._.DS_Store
 cs520/src/cs520/hw4/part2/data.txt
 cs520/src/cs520/hw4/part2/Student.java
 cs520/src/cs520/hw4/part2/StudentTest.java
 ]

 
$8.00
A++ solution with ScreenShot
  • This tutorial hasn't been purchased yet.
  • Posted on Jul 31, 2012 at 7:30:14PM
Posted by :
adinh3290
adinh3290
Rating (315):A-
Questions Asked: 3
Tutorials Posted: 1181,
Earned: $14,487.33
 
A:
Preview: ... ution ...

The full tutorial is about 4 words long plus attachments.

attachmentlogo

Attachments:
data.txt (0K) (Preview)
cs520.zip (1K) 

 cs520/hw4/part2/Student.java
 cs520/hw4/part2/Test.java
 ]

StudentGrade_ScreenShot.jpg (49K)