Local running group held a one hour track event

Assignment Help JAVA Programming
Reference no: EM132057232

A local running group held a one hour track event where people tried to comple.te as many miles as they could in one hour. The times were recorded and saved in a file. Each line of the file represents a runner and each line contains 10 entries. The entries are the number of seconds it took to the runner to complete that mile. An entry of zero means the runner didn't finish that mile. You may assume the file will never have more than 20 runners. An example file might look like

372 368 375 380 381 383 390 382 380 0
352 355 357 359 358 361 365 362 362 360
575 572 570 569 572 570 0 0 0 0

Cre.ate a class, RunnerData, that creates a formatted file that displays the mile times in "minutes:seconds" format and adds an extra column at the end with the average mile time for the runner. If the runner didn't minutes:seconds" format and adds an extra column at the end with the average mile time for the runner. If the runner didn't comple.te a mile, the entry should be empty. The above example input would generate the following output

6:12 6:08 6:15 6:20 6:21 6:23 6:30 6:22 6:20      | 6:19
5:52 5:55 5:57 5:59 5:58 6:01 6:05 6:02 6:02 6:00 | 5:59
9:35 9:32 9:30 9:29 9:32 9:30                     | 9:31

Your solution should have three methods:

// Reads the data from the specified file and stores it in the supplied table.
//     filepath    : a path to the file containing the data
//     runnerData  : the array to store the data read from the file
//     
// The method returns the number of runners (rows) found in the file.
//
private static int importData(string filepath, int[][] runnerData);

// Outputs a table including runner average.
//     filepath    : a path to the file where the table should be written
//     runnerData  : the array containing the mile times in seconds
//     runnerCount : the number of rows of data in the table
//
private static void exportTable(string filepath, int[][] runnerData, int runnerCount);

// This function will load data from a file called "input.txt" and output to a file
// called "output.txt".
//
public static void main(String[] args);

The main() method will not be very involved. It will likely consist of the declaration of a handful of variables and then simply calling the import and export functions. Your program should not interact with the user. The input file could have any number of lines, but all lines will contain 10 values.

Reference no: EM132057232

Questions Cloud

Create a class named sandwich : Create a class named Sandwich. Data fields include a String for the main ingredient (such as "tuna"), a String for bread type (such as "wheat")
User for the name of a tennis player : Ask the user for the number of years the tennis player has played competitive tennis.Use this value as the size of a double array.
Arraylist-binary search-i-o streams-exceptions : Read in a text file from standard input, censor it, and print out the result to standard output. To censor the file, first read in a list of words from the file
Files in java runtime environment : Why is it important to eliminate need to configure files in java runtime environment
Local running group held a one hour track event : A local running group held a one hour track event where people tried to comple.te as many miles as they could in one hour. The times were recorded
Different types of events : There are different types of events. So do you think that all events are equal?
Explain creational design pattern : Select a type of Creational Design Pattern, explain why you selected that particular pattern type.
Create a class saving account : Create a class Saving Account. Use a static variable annualInterestRate to store the annual interest rate for all account holders.
Store data between runs of the program : That way your program does not have run all the time and when your computer is rebooted the state of the data is preserved.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd