Java

posted by .

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

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Java

    Can anybody help me figure how to post a Java file to as an attachment. I need to post this in my classroom forum but I have not clue to how. I am using the program called Netbeans. Thanks
  2. Video in java(netbeans)

    Hi, i am using netbeans and i'm trying to incorporate a video into my project. I want the program to run a video when a button(jbutton) is clicked. i'm totally lost. p.s. i do have JMstudio to run videos in java but got no clue how …
  3. JAVA

    simple java program to retrive data from oracle database between specific dates.. Please somebody help na?
  4. Java

    create a java program that accepts students names, and test scores from a file, and displays theri name, average score and letter grade to the screen.
  5. 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 …
  6. Java Programming

    I'm new to Java and I'm not sure how to write the source code for this problem I got in class... Write a java program using the while and if statement that will accept ten student grades and that will display the sum of the grades, …
  7. java programming

    write a java program using arrays function for hotel bill calculation?
  8. 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 program …
  9. java programming

    the learner is asked to write a program using java with user input that caculate and displays, the number of months it will take the user to save an amount of money. the user must enter the
  10. Java programming

    Need help not sure how do this Do an analysis of the following program: Write a program to input the dimension of a cylinder, and print the surface area and volume.

More Similar Questions