2 Replies - 5696 Views - Last Post: 05 November 2010 - 01:53 PM Rate Topic: -----

#1 Guest_Alexis Lensing*


Baseball Stats Program

Posted 05 November 2010 - 01:27 PM

//Reads baseball data in from a fileEach line 
//of the file contains a name followed by a list of symbols
//indicating the result of each at bat: h for hit, o for out, 
// w for walk, s for sacrifice. Statistics are computed and 
//printed for each player. 
// ****************************************************************

import java.util.Scanner;
import java.io.*;

public class BaseballStats
	// Reads baseball stats from a file and counts 
	// total hits, outs, walks, and sacrifice flies 
	// for each player.
	public static void main (String[] args) throws IOException {
	Scanner fileScan, lineScan; String fileName;
	Scanner scan = new Scanner(System.in);
	System.out.print ("Enter the name of the input file: "); 
	fileName = scan.nextLine(); fileScan = new Scanner(new File(fileName));
	// Read and process each line of the file

I am not sure what I need to do next

Is This A Good Question/Topic? 0

Replies To: Baseball Stats Program

#2 Brewer   User is offline

  • Awesome
  • member icon

Reputation: 182
  • View blog
  • Posts: 1,044
  • Joined: 14-June 10

Re: Baseball Stats Program

Posted 05 November 2010 - 01:37 PM

Sorry mate, but your post tells us nothing. Your title needs to be more descriptive. What problems are you having? What are you trying to accomplish? Also, please edit your post and insert the [code] tags.
Was This Post Helpful? 0
  • +
  • -

#3 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6246
  • View blog
  • Posts: 24,014
  • Joined: 23-August 08

Re: Baseball Stats Program

Posted 05 November 2010 - 01:53 PM

When posting a new topic in a forum, please do not give a topic title identical to the name of the forum, as you did in titling this "Java". We KNOW it's Java, you posted in the Java forum, and you posted your code (in code tags, well done), which is obviously Java. Give your topic a title which provides a little information about what's in your post. You'll find you'll get more assistance that way.

NOTE: Renamed topic.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1