Java

I need to write a Java program using an input file with the below data. I don’t even know where to begin. I have written others but this one has me totally confused. I know how to do it using math WL% = Wins / (Wins + Losses)
I also wrote this to use but, can’t figure out how to apply it
Private void Calculate WinPercent ()
{
If (wins+losses)==0)
WinPercent =0.0
Else
Winpercent =(double)wins/wins(wins+losses)*100
}

The program has to do this:


1. Process all data until it reaches the end-of-file. Calculate the win percentage for each team.

2. Output to a file ("top.txt") a listing of all teams with a win percentage greater than .500. This file should contain the team name and the win percentage.

3. Output to a file ("bottom.txt") a listing of all teams with a win percentage of .500 or lower. This file should contain the team name and the win percentage.

4. Count and print to the screen the number of teams with a record greater then .500 and the number of teams with a record of .500 and below, each appropriately labeled.

5. Output in a message box: the team with the highest win percentage and the team with the lowest win percentage, each appropriately labeled. If there is a tie for the highest win percentage or a tie for the lowest win percentage, you must output all of the teams.
Dallas 5 2
Philadelphia 4 3
Washington 3 4
NY_Giants 3 4
Minnesota 6 1
Green_Bay 3 4

  1. 👍 0
  2. 👎 0
  3. 👁 60
asked by Jay

Respond to this Question

First Name

Your Response

Similar Questions

  1. java

    Write a java application that finds the smallest of several integers. Prompt the user for the number of integers that will be input, then prompt the user for that number of integers. Evaluate the integers to determine the smallest

    asked by saleh on October 21, 2012
  2. programming

    Write a program which allows user to enter 10 student names and scores for Java programming 1 and Java programming 2. Allow user to choose which course they want to enter the record for. Use the loop to ask input from user. The

    asked by Java on March 2, 2014
  3. Programming

    2. Then it should prompt the user for the input file name of the file containing the data to sort. 3. If the program can't open the file or if no file name is entered (^d or ^z is entered for EOF), it should print an error message

    asked by Don on June 29, 2011
  4. Computer

    After writing the program of Exercise 17.7, write a simple program to create some test data for checking out the program. Use the following sample account data: Master file Account number Name Balance 100 Alan Jones 348.17 300

    asked by Gaurav on April 20, 2011
  5. C++

    // Program: name of program // Author: your name // Date Written: date you began writing the program /* Abstract: Brief description of the program */ Include in-line comments in the body of your program. You can convert

    asked by Frank on September 23, 2016
  6. c programming

    Write a program to read from a file called "input.txt" information about 5 workers. Each line would contain two values respectively, an employee ID and the employee's monthly salary. Assume that the data from the input file is

    asked by kevin on November 26, 2015
  7. programming

    Write a C program to sort the bags by weight. Assume that the input is given in a file. Each line of the input file corresponds to one polythene bag. For example a line in the file as below 10,20,20,10,10,50,10,50 corresponds to a

    asked by Anonymous on April 17, 2011
  8. vembadi girls high school

    Write a java program to input an integer numbers and find the highest number among them (using array)

    asked by thammy on March 8, 2016
  9. Programming Java

    I am learning Java in programming right now. I need to write a program that should have an output like this: The program says "Type ten names". Then ten names sould be typed a person. Then the program chooses a random name from

    asked by Valerie on November 16, 2017
  10. psychology

    My question is about connectionism.I have a program that conctruct connectionist models.Presumably I have number of unit for example one of them is unit1 that represent room: for example office how do I find out data input for

    asked by katarzyna rochowicz on June 3, 2010

More Similar Questions