summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormokha <mokha@cisco.com>2019-04-28 17:10:23 -0600
committermokha <mokha@cisco.com>2019-04-28 17:10:23 -0600
commit8c37add65db2f79aa533b8eee67ff7c28ed0dc5b (patch)
tree9b2b574ae5c57917e6b3b6adfc9d07a3baa081eb
parentf420227441bbc8d1829daedaf6c2a81271a73f74 (diff)
add question 4
-rw-r--r--assignments/assignment1/README.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/assignments/assignment1/README.md b/assignments/assignment1/README.md
index 8a8b4a9..851282c 100644
--- a/assignments/assignment1/README.md
+++ b/assignments/assignment1/README.md
@@ -89,3 +89,32 @@ You can use `Math.pow(a,0.5)` to compute the square root of an expression.
`Math.pow()` returns a double.
For example, the distance between the points (−2, −3) and (−4, 4) is approximately 7.28, as shown below.
+
+4. A group of AU friends decide to run the Banff, Alberta, Marathon.
+Their names, times (marathon completion time in minutes), and number of years participated are given below:
+
+| id | Name | time (mins) | years |
+| --- | --- | --- | --- |
+| 1 | Elena Brandon | 341 | 1 |
+| 2 | Thomas Molson | 273 | 2 |
+| 3 | Hamilton Winn | 278 | 5 |
+| 4 | Suzie Sarandin | 329 | 7 |
+| 5 | Philip Winne | 445 | 9 |
+| 6 | Alex Trebok | 275 | 3 |
+| 7 | Emma Pivoto | 275 | 4 |
+| 8 | John Lenthen | 243 | 1 |
+| 9 | James Lean | 334 | 1 |
+| 10 | Jane Ostin | 412 | 1 |
+| 11 | Emily Car | 393 | 4 |
+| 12 | Daniel Hamshire | 299 | 4 |
+| 13 | Neda Bazdar | 343 | 3 |
+| 14 | Aaron Smith | 317 | 6 |
+| 15 | Kate Hen | 265 | 8|
+
+Extend the AddressBook class from Problem 1 to store the additional data.
+Now, write a method to find the fastest runner.
+Print the name, address, and his/her time (in minutes) on three separate lines.
+Find the second fastest runner.
+Print the name, address, his/her time (in minutes), and the difference in time with the fastest runner.
+Compute the average time of completion taken by these runners.
+Finally, print the name and number of years participated for each runner if the runner’s time of completion is equal to or better than the average time of completion.