Need help writing a code that reads a file, gathers the tokens, and then gives the user back an awnser based on the information from the tokens. In this case the tokens are names and test scores and the out puts are names and final grades. They are to all be displayed at once and it does not have to use any popup windows. Below are the teachers hw asignment and a piece of program he gave us to get started with
""Homework-2
You do not need to send me your input file. Your program should work with my input file named hw2.txt.
Write a java program FirstnameLastnameHw2.java that reads student info from an external file with the following data, and displays the grades as displayed below.
Input file hw2.txt (be aware of copy/paste issue). Add a record with your own name (and some numbers).
Max Batman 73 83 93 20 20 20 18
Jim Harper 76 88 68 15 20 20 20
Joanna Karr 62 92 91 12 20 20 18
Sue Hammond 75 88 78 20 0 20 20
Mickie Foxx 65 77 91 12 0 0 20
Sue Sirmons 98 52 94 20 20 20 0
Jacqueline Savannah 98 87 99 0 20 20 20
your name . . . .
There are three test scores, out of 100 each, worth 60% and four homework scores, out of 20 each, worth 40% of grade.
Apply 90%, 80%, 70% and 60% (standard) cutoff levels for letter grade computation.
Example output (grades/averages are not accurate):
Does anyone know how the Ghostery extension works in Google Chrome? I switched to that quite a while ago, from uBlock Origin after uBlock started having issues just working. Personally I love Ghostery and I think it does a fantastic job, and I really enjoy the whitelist I have built up as well for tons of websites that don't serve ads so that it isn't blocking good elements of them by accident.
>pointed to a British firm called SafeToNet
There it is. Some UK MP's brother/friend/spouse owns this shitware company and wants those kickbacks right into their own pocket.
DNS based blocking only works as long as the ads are served from hosts than the content. Closing that loophole would be pretty easy. I'd say it sits in a sweet spot of being just nerdy enough that the average person doesn't set it up, meaning it isn't really on the big companies' radars.
Question
The Real Napster
Need help writing a code that reads a file, gathers the tokens, and then gives the user back an awnser based on the information from the tokens. In this case the tokens are names and test scores and the out puts are names and final grades. They are to all be displayed at once and it does not have to use any popup windows. Below are the teachers hw asignment and a piece of program he gave us to get started with
""Homework-2
You do not need to send me your input file. Your program should work with my input file named hw2.txt.
Write a java program FirstnameLastnameHw2.java that reads student info from an external file with the following data, and displays the grades as displayed below.
Input file hw2.txt (be aware of copy/paste issue). Add a record with your own name (and some numbers).
Max Batman 73 83 93 20 20 20 18
Jim Harper 76 88 68 15 20 20 20
Joanna Karr 62 92 91 12 20 20 18
Sue Hammond 75 88 78 20 0 20 20
Mickie Foxx 65 77 91 12 0 0 20
Sue Sirmons 98 52 94 20 20 20 0
Jacqueline Savannah 98 87 99 0 20 20 20
your name . . . .
There are three test scores, out of 100 each, worth 60% and four homework scores, out of 20 each, worth 40% of grade.
Apply 90%, 80%, 70% and 60% (standard) cutoff levels for letter grade computation.
Example output (grades/averages are not accurate):
Student Names Average Letter Grades
--------------------------------------------
Batman, Max 87 B
Harper, Jim 73 C
Karr, Joanna 78 C
Hammond, Sue 82 B
Foxx, Mickie 53 F
Sirmons, Sue 93 A
Savannah, Jacqueline 94 A
Your name .. ..
--------------------------------------------""
""import java.util.scanner;
import java.io.*;
public class FileReader
{ public static void main(String[] args) throws Exception
{ File file1 = new File("hw2.txt"); // finds file
Scanner inFile = new Scanner(file1); // reads file
while (inFile.hasNext())
{ String line = inFile.nextLine();
System.out.println(line);
}
}
}""
Link to comment
https://www.neowin.net/forum/topic/1133234-java-hw-help-please/Share on other sites
6 answers to this question
Recommended Posts