Answered step by step
Verified Expert Solution
Question
1 Approved Answer
plz it is in java and all of the questions are related Marathon times are usually recorded in hours, minutes and seconds. Also, marathon runners
plz it is in java and all of the questions are related
Marathon times are usually recorded in hours, minutes and seconds. Also, marathon runners like to compare their time with the world record holder's time and see what percentage slower they are than the world record time. To make the comparison easier and to calculate the percentage slower, it helps to convert into seconds both a person's time (entered as three integers: hours, minutes and seconds) and the world record holder's time (2 hours, 3 minutes and 59 seconds). It is OK to display the percentage in its decimal form. percentage_slower = person's marathon time in seconds world record marathon time in seconds -1.0 Now, consider the following Java class: Java Runner class public class Runner ! rivatnim namn Now, consider the following lava class: Java Runner class public class Runner private String name: private int mathontista.conds. private static final int WORLD RECORD TIME SECONDS=// add expression to convert the record hours and minutes and seconds to seconds; [1 pt) public Runner (String n, int h, int n, int s) nameni Seine h, m, 5) 1 public void setTipe (int n, int m, int s) 7 if th> 0 56 00) Bente Seconda w add expression to convert the band and sto seconda [1 pt) 1 public string gat Nang) return name: 1 public int sonda (return marathon im Sconda 1 public double roentgRBE 04 W ADD CODE HERE TO CALCULATE THE PERCENTAGE SLOWER THAN THE WORLD R 12 pt) 3 public Runner (String n, string data) 1/ADD CODE HERE TO INITIALIEK the object attributes by using the sing argument as the player name 17 And by parning the second colondelimited string argument ( into Integers hours, minutes, seconda 13 pt] 1 1 For the Runner class above: Complete the two expressions, and add two methods to this class "percentageSlower", and a second constructor that takes two String arguments, name and data, and parses the second colon-delimited String into integer hours, minutes, seconds. Test your Runner class by adding code to Runnerclient.java below Java Runnerclient class class kunnes list public static void main(String[] a) Runner rl - now Runner("ALLA", 2, 15, 1612 Syat..ut.println(ri.getName()+" Time in seconds "+r1.getSeconds()+" Percentage slower: ***1.percentageslower Runner r3 = new Runner (Radeliffe", "2:15:25 syats.cuintina.gel.Name()+" Wine in Seconds +13.getSeconds()+" Percentage Sowet "*3.percentageSlower Wadd code here to tant more [2pt] Now: Write pseudocode (place it in the box below) for solving the problem of calculating the above described marathon statistic, * Write pseudocode (place it in the box below) for solving the problem of calculating the above described marathon statistic, Pseudocode: (0.5 pt) mendenda to be sure that ocks Stop through your pseudocode to be sure that it works Implement your pseudocode in Java. Be sure your program is appropriately documented. Assume the user inputs the correct type of data, . Compile and run your program to see if it runs (no run-time errors), Complete the following test plan (using a calculator), Test your program with the test plan below. If you discover mistakes in your program, correct them and execute the test plan again. Your results may differ slightly in the number of decimal digits displayed. In a later lab you will learn how to format output to a specified number of digits. Test plan (0.5 pt) Test case Sample data Expected result Verified? D.LT Te plan 10.5 Test Sample date Verified World record Expected result Bila Time is second 116 Penta 30 10 NA Hours: 2 Mines 15 15 Secondo 16 Radisson 8125 Percentage lower 923 lade Crew recort Na Radcliffe H2 Minutes 15 Seconds 25 15 25 My friends Nume Hot Minu 29 Second OWE You marathon el 15 0 LI . (or estimate) Name: Hours: Minutes: Seconds Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started