-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.js
22 lines (13 loc) · 972 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
$(document).ready(function() {
var outputContent = "Average rental price for all bicycles: " + bicycleAggregator.getAverageRentalPrice().toFixed(2);
outputContent += "<br/><br/>Average rental price for urban bicycles: " + bicycleAggregator.getAverageRentalPrice("Urban Bike").toFixed(2);
var bicycle = bicycleAggregator.getMostRecentlyAddedBicycle();
outputContent += "<br/><br/>Most recently added bicycle: '" + bicycle.name + "' on: " + bicycle.dateAdded.toISOString();
bicycle = bicycleAggregator.getMostRecentlyAddedBicycle("Urban Bike");
outputContent += "<br/><br/>Most recently added urban bicycle: '" + bicycle.name + "' on: " + bicycle.dateAdded.toISOString();
bicycle = bicycleAggregator.getLowestPricedBicycle("Urban Bike");
outputContent += "<br/><br/>Lowest priced urban bicycle: '" + bicycle.name + "' with rental price: " + bicycle.rentPrice;
$("#output").html(
"<h2>Aggregations over bicycles:</h2>" +
outputContent);
});