SYSC 2004 Lab 3 Help Part 4: Debugging lap-timer-buggy Section B 1. Another problem is that clicking the Stop button two or more times in a row…

SYSC 2004 Lab 3 HelpPart 4: Debugging lap-timer-buggy Section B 1. Another problem is that clicking the Stop button two or more times in a row causes the display to change repeatedly. 2. Correct this problem.Part 5: Debugging lap-timer-buggy Section C1. Finally, several of the values displayed in the window are incorrect. 2. Correct this problem. (Don’t forget your testing, including regression testing.) Ensure that you have fixed all the bugs by checking that the “buggy” version now works identically to the “works” version. Completed code for lap-timer-buggy below (all changes must be done ONLY in class Timing Engine):TimingEnginepublic class TimingEngine{  private boolean running;  /* The number of laps that the runner has completed. */  private int lapCount;  /* The time of the lap just completed, in milliseconds. */  private long lapTime;  /* The total time the runner has run so far, in milliseconds. */  private long totalTime;    /* The current time of the system clock when the runner   * started the current lap, in milliseconds.   * See getSystemTime(), at the end of this class.   */  private long lapStartTime;  /* The lap length, in metres. */  private int lapLength;  /* The average speed, in m/s. */  private int avgSpeed;     public TimingEngine()  {    running = false;    lapCount = 0;    totalTime = 0;    lapTime = 0;    avgSpeed = 0;    lapLength = 400;  }  /**   * Instruct the timer to start timing a lap.   * If we were not timing before, this starts the timer for a new    * run. If we were already timing, this starts a new lap, adding the   * current lap time to the total.   */  public void startLap()  {    if (running) {      finishLap();    }    else {      lapCount = 0;      totalTime = 0;      lapTime = 0;      lapStartTime = getSystemTime();      running = true;    }  }  /**   * Stop timing. Add the current lap time to the total, and set   * the timer into idle mode (waiting for a new run).   */  public void stop()  {    finishLap();    running = false;  }  /**   * Return the current status of the timer. The status is one of the   * two Strings “Timing…” or “Stopped”, indicating whether this    * timer is currently running or stopped.   */  public String getStatus()  {    if (running) {      return “Timing…”;    }    else {      return “Stopped”;    }  }  /**   * Return the number of laps completed in this run.   */  public int getLapCount()  {    return lapCount;  }  /**   * Return the time of the last lap completed.   * The result is a string in the format “m:ss:hh”, where m is   * the number of minutes, ss the number of seconds, and hh the number   * of hundredths of a second. For example “7:02:43”.   */  public String getLastTime()  {    return timeToString(lapTime);  }  /**   * Return the average time for a lap in this run.   * The result is a string in the format “m:ss:hh”.   */  public String getAverageTime()  {    if (lapCount == 0) {      return timeToString(0);    }    else {      long avgTime = totalTime / lapCount;      return timeToString(avgTime);    }  }  /**   * Return the total time of the last or current run.   * The result is a string in the format “m:ss:hh”.   */  public String getTotalTime()  {    return timeToString(totalTime);  }  /**   * Return the average speed in this run in meters per second.   * The result is a string such as “73 m/s”.   */  public String getAverageSpeed()  {    long totalSeconds = totalTime / 1000;    if (totalSeconds == 0) {      return “0 m/s”;    }    else {      long avgSpeed = lapLength / totalSeconds;      return avgSpeed + ” m/s”;    }  }  /**   * Return the length of a lap.   */  public int getLapLength()  {    return lapLength;  }  /**   * Set the length of a lap.   */  public void setLapLength(int length)  {    if(length > 0)    {      lapLength = length;    }  }  /**   * Private method called whenever a lap is finished. This method   * updates the statistics.   */  private void finishLap()  {    lapCount++;    long lapEndTime = getSystemTime();    lapTime = lapEndTime – lapStartTime;    totalTime = totalTime + lapTime;  }  /**   * Convert a time interval in milli-seconds into a String in the   * format “m:ss:hh”.   */  private String timeToString(long time)  {    long hundredths = (time / 10) % 100;    long seconds = (time / 1000) % 60;    long minutes = time / 60000;    return minutes + “:” + twoDigit(seconds) + “:” + twoDigit(hundredths);  }  /**   * Convert a number into a two-digit String representation.   */  private String twoDigit(long number)  {    if(number < 10) {      return "0" + number;    }    else {      return "" + number;    }  }  /**   * Return the current time of the system clock (in milli-seconds).   */  private long getSystemTime()  {    return System.currentTimeMillis();  }}LapTimerpublic class LapTimer{  private TimingEngine engine;  private UserInterface gui;  public LapTimer()  {    engine = new TimingEngine();    gui = new UserInterface(engine);  }  /**   * In case the window was closed, show it again.   */  public void show()  {    gui.setVisible(true);  }}

Give us your instructions.
Select the type of service you need: writing, calculations, or programming. We’ve created an intuitive order form that tells you what information to enter and where, so make sure to fill out each required field. Also, make your requirements as specific as possible. Don’t rush! Take your time and explain everything in detail how it works.

Proceed to checkout and enter your credit card details or PayPal login, how to pay. Follow the payment provider’s instructions to confirm the transaction.
Now your order is in our system! We’ll start processing it right away.

Place Your Order

Contact Us

Frequently asked questions
Is your service confidential?

When you place an order with our company, we ask you to provide us with such personal information as your name, phone number, and email address. We need this data to keep you updated on the important things related to your order or account.

Is there a possibility of plagiarism in my completed order?

We complete each paper from scratch and in order to make you feel safe regarding its authenticity, we check it for plagiarism before its delivery. To do that, we use our in-house software, which can find not only copy-pasted fragments but even paraphrased pieces of text. Unlike popular plagiarism detection systems that are used by most universities (e.g. Turnitin.com), we do not report to any public databases—therefore, such checking is safe.

We provide a plagiarism-free guarantee that ensures your paper is always checked for its uniqueness.

Is there a money-back guarantee? If yes, how can I receive a refund?

You can certainly get your money back in several cases. You can receive a full refund if you have paid for your order twice or if you have placed two identical orders. In case your paper was late or the quality of the paper does not correspond to your expectations, you will get compensation for these issues.

Do you keep a database of pre-written essays?

No, we do not have such a database. All papers you order from us are written from scratch. This means your paper is unique and has never been published before—neither will it be published after we deliver it to you.

 

When will my custom paper be done?

While placing an order with WritersHub, you can choose a period of time within which a paper should be delivered to you. The countdown until the specified deadline starts automatically from the moment we receive your payment in our system. For example, if you pay for your order at 6pm on Monday and choose a 3-day delivery option, you will receive your custom paper by 6pm on Thursday.

Remember that a writer needs a sufficient amount of time in order to conduct thorough research. Therefore, please choose the most suitable deadline when you place an order. Moreover, the later you need your paper to be delivered to you, the cheaper it will be. Thus, you will be able to save your money while your writer will have enough time to work on your order and ensure its quality.

Make sure you upload all the additional materials at the very beginning. If you fail to do that, the deadline for your order will be postponed as well.

I haven’t received my custom paper by the deadline. What should I do?

Let us know immediately about that. You can do it by writing a message on Facebook or email us. Our support manager will carefully examine your order and will assist you with it right away. The reasons for late delivery may vary from time to time. It can happen that you have entered a wrong email address or your spam filter does not allow you to receive emails from us. It is also possible that the writer is waiting for your reply and can not continue working without your assistance, or we are checking the work for plagiarism. Whatever the case may be, contact us if you have any problems with getting your order on time.