Skip to content

Commit ef2d024

Browse files
committed
Updating Documentation
1 parent a6d07fc commit ef2d024

2 files changed

Lines changed: 217 additions & 238 deletions

File tree

‎README.md‎

Lines changed: 15 additions & 238 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,22 @@ A student that completes this project shows that they can:
1212

1313
The countries of the world have many different defining attributes including land size, population, and median age. Below is a list of countries to include in your data. As most people do their research using websites, we are going to create web services to help search this data. We will be returning JSON objects. Nothing fancy for now!
1414

15-
We will be creating an array list for country objects. The country object contains the following fields
15+
We will be creating an table for country data. The country model should contain the following fields. The model should be named `Country` and the table `countries`
1616

17-
* Name
18-
* Population
19-
* Land Mass in Km2
20-
* Median Age
17+
* String name
18+
* long population
19+
* long landmasskm2
20+
* int medianage
2121

22-
The object should also include the standard getters and setters. You can see the suggested initial data to use at the end of this document.
22+
The model should also include the standard getters and setters. You should use the provided data.sql file to seed your data
2323

2424
Some Important Notes That Might help:
2525

26-
* The country's suggested layout is found at the end of this document
2726
* The sort method must work with `int` - so not `long`. the solution - type casting! See the code snippet below:
2827
`.sort((c1, c2) -> (int)(c1.getPopulation() - c2.getPopulation()))`
2928
* To calculate median for stretch goals - if the list contains an odd number of items, pick the middle one. If the list contains an even number of items, pick either of the two items that lie in the middle.
3029

31-
Using the data at the end of this document, the endpoints will produce the following outputs. Expand to see the suggested outputs!
30+
Using the data.sql at the end, the endpoints will produce the following outputs. Expand to see the suggested outputs! Note that id numbers may vary.
3231

3332
### MVP
3433

@@ -1550,25 +1549,14 @@ Using the data at the end of this document, the endpoints will produce the follo
15501549

15511550
</details>
15521551

1553-
<details><summary>http://localhost:2019/population/size/1000000000</summary>
1552+
<details><summary>http://localhost:2019/population/total</summary>
1553+
1554+
In the console:
1555+
1556+
```TEXT
1557+
1558+
Total Population is
15541559
1555-
```JSON
1556-
[
1557-
{
1558-
"id": 1,
1559-
"name": "China",
1560-
"population": 1420062022,
1561-
"landMass": 9388211,
1562-
"medianAge": 39
1563-
},
1564-
{
1565-
"id": 2,
1566-
"name": "India",
1567-
"population": 1368737513,
1568-
"landMass": 2973190,
1569-
"medianAge": 28
1570-
}
1571-
]
15721560
```
15731561

15741562
</details>
@@ -2642,7 +2630,7 @@ The following URLs should return the requested data given the parameters
26422630
* [ ] /names/start/{letter} - return the countries alphabetically that begin with the given letter
26432631
* [ ] /names/size/{number} - return the countries alphabetically that have a name equal to or longer than the given length
26442632

2645-
* [ ] /population/size/{people} - return the countries that have a population equal to or greater than the given population
2633+
* [ ] /population/total - return the total population of the all countries in the console while returning Http Status OK as the response.
26462634
* [ ] /population/min - return the country with the smallest population
26472635
* [ ] /population/max - return the country with the largest population
26482636

@@ -2653,215 +2641,4 @@ The following URLs should return the requested data given the parameters
26532641
### Stretch Goal
26542642

26552643
* [ ] /population/median - return the country with the median population
2656-
26572644
* [ ] /age/median - return the country with the median median age
2658-
2659-
## The Data
2660-
2661-
I know this is much data, but it is real data and feel free to copy and paste the data into your code at the appropriate spot!
2662-
2663-
The parameters are listed in this order Name, Population, Land Mass in Km2, Median Age
2664-
2665-
```JAVA
2666-
countryList.add(new Country("China",1420062022,9388211,39));
2667-
countryList.add(new Country("India",1368737513,2973190,28));
2668-
countryList.add(new Country("U.S.",329093110,9147420,38));
2669-
countryList.add(new Country("Indonesia",269536482,1811570,29));
2670-
countryList.add(new Country("Brazil",212392717,8358140,33));
2671-
countryList.add(new Country("Pakistan",204596442,770880,23));
2672-
countryList.add(new Country("Nigeria",200962417,910770,18));
2673-
countryList.add(new Country("Bangladesh",168065920,130170,27));
2674-
countryList.add(new Country("Russia",143895551,16376870,40));
2675-
countryList.add(new Country("Mexico",132328035,1943950,29));
2676-
countryList.add(new Country("Japan",126854745,364555,48));
2677-
countryList.add(new Country("Ethiopia",110135635,1000000,20));
2678-
countryList.add(new Country("Philippines",108106310,298170,25));
2679-
countryList.add(new Country("Egypt",101168745,995450,25));
2680-
countryList.add(new Country("Viet Nam",97429061,310070,33));
2681-
countryList.add(new Country("DR Congo",86727573,2267050,17));
2682-
countryList.add(new Country("Turkey",82961805,769630,32));
2683-
countryList.add(new Country("Iran",82820766,1628550,32));
2684-
countryList.add(new Country("Germany",82438639,348560,47));
2685-
countryList.add(new Country("Thailand",69306160,510890,40));
2686-
countryList.add(new Country("U.K.",66959016,241930,41));
2687-
countryList.add(new Country("France",65480710,547557,42));
2688-
countryList.add(new Country("Tanzania",60913557,885800,18));
2689-
countryList.add(new Country("Italy",59216525,294140,48));
2690-
countryList.add(new Country("South Africa",58065097,1213090,27));
2691-
countryList.add(new Country("Myanmar",54336138,653290,29));
2692-
countryList.add(new Country("Kenya",52214791,569140,20));
2693-
countryList.add(new Country("South Korea",51339238,97230,43));
2694-
countryList.add(new Country("Colombia",49849818,1109500,32));
2695-
countryList.add(new Country("Spain",46441049,498800,46));
2696-
countryList.add(new Country("Uganda",45711874,199810,16));
2697-
countryList.add(new Country("Argentina",45101781,2736690,32));
2698-
countryList.add(new Country("Ukraine",43795220,579320,41));
2699-
countryList.add(new Country("Algeria",42679018,2381740,29));
2700-
countryList.add(new Country("Sudan",42514094,1765048,20));
2701-
countryList.add(new Country("Iraq",40412299,434320,20));
2702-
countryList.add(new Country("Poland",38028278,306230,42));
2703-
countryList.add(new Country("Canada",37279811,9093510,41));
2704-
countryList.add(new Country("Afghanistan",37209007,652860,19));
2705-
countryList.add(new Country("Morocco",36635156,446300,30));
2706-
countryList.add(new Country("Saudi Arabia",34140662,2149690,32));
2707-
countryList.add(new Country("Peru",32933835,1280000,29));
2708-
countryList.add(new Country("Uzbekistan",32807368,425400,28));
2709-
countryList.add(new Country("Venezuela",32779868,882050,29));
2710-
countryList.add(new Country("Malaysia",32454455,328550,30));
2711-
countryList.add(new Country("Angola",31787566,1246700,17));
2712-
countryList.add(new Country("Mozambique",31408823,786380,18));
2713-
countryList.add(new Country("Ghana",30096970,227540,21));
2714-
countryList.add(new Country("Nepal",29942018,143350,25));
2715-
countryList.add(new Country("Yemen",29579986,527970,20));
2716-
countryList.add(new Country("Madagascar",26969642,581795,20));
2717-
countryList.add(new Country("North Korea",25727408,120410,35));
2718-
countryList.add(new Country("Cote d'Ivoire",25531083,318000,19));
2719-
countryList.add(new Country("Cameroon",25312993,472710,19));
2720-
countryList.add(new Country("Australia",25088636,7682300,38));
2721-
countryList.add(new Country("Taiwan",23758247,35410,42));
2722-
countryList.add(new Country("Niger",23176691,1266700,15));
2723-
countryList.add(new Country("Sri Lanka",21018859,62710,34));
2724-
countryList.add(new Country("Burkina Faso",20321560,273600,18));
2725-
countryList.add(new Country("Malawi",19718743,94280,18));
2726-
countryList.add(new Country("Mali",19689140,1220190,16));
2727-
countryList.add(new Country("Romania",19483360,230170,43));
2728-
countryList.add(new Country("Kazakhstan",18592970,2699700,31));
2729-
countryList.add(new Country("Syria",18499181,183630,22));
2730-
countryList.add(new Country("Chile",18336653,743532,35));
2731-
countryList.add(new Country("Zambia",18137369,743390,18));
2732-
countryList.add(new Country("Guatemala",17577842,107160,23));
2733-
countryList.add(new Country("Zimbabwe",17297495,386850,20));
2734-
countryList.add(new Country("Netherlands",17132908,33720,43));
2735-
countryList.add(new Country("Ecuador",17100444,248360,28));
2736-
countryList.add(new Country("Senegal",16743859,192530,19));
2737-
countryList.add(new Country("Cambodia",16482646,176520,26));
2738-
countryList.add(new Country("Chad",15814345,1259200,17));
2739-
countryList.add(new Country("Somalia",15636171,627340,17));
2740-
countryList.add(new Country("Guinea",13398180,245720,19));
2741-
countryList.add(new Country("South Sudan",13263184,610952,19));
2742-
countryList.add(new Country("Rwanda",12794412,24670,20));
2743-
countryList.add(new Country("Benin",11801595,112760,19));
2744-
countryList.add(new Country("Tunisia",11783168,155360,33));
2745-
countryList.add(new Country("Burundi",11575964,25680,18));
2746-
countryList.add(new Country("Belgium",11562784,30280,42));
2747-
countryList.add(new Country("Cuba",11492046,106440,43));
2748-
countryList.add(new Country("Bolivia",11379861,1083300,25));
2749-
countryList.add(new Country("Haiti",11242856,27560,24));
2750-
countryList.add(new Country("Greece",11124603,128900,45));
2751-
countryList.add(new Country("Dominican Republic",10996774,48320,28));
2752-
countryList.add(new Country("Czech Republic",10630589,77240,43));
2753-
countryList.add(new Country("Portugal",10254666,91590,46));
2754-
countryList.add(new Country("Jordan",10069794,88780,23));
2755-
countryList.add(new Country("Sweden",10053135,410340,41));
2756-
countryList.add(new Country("Azerbaijan",10014575,82658,32));
2757-
countryList.add(new Country("United Arab Emirates",9682088,83600,34));
2758-
countryList.add(new Country("Hungary",9655361,90530,43));
2759-
countryList.add(new Country("Honduras",9568688,111890,25));
2760-
countryList.add(new Country("Belarus",9433874,202910,40));
2761-
countryList.add(new Country("Tajikistan",9292000,139960,23));
2762-
countryList.add(new Country("Austria",8766201,82409,44));
2763-
countryList.add(new Country("Serbia",8733407,87460,41));
2764-
countryList.add(new Country("Switzerland",8608259,39516,43));
2765-
countryList.add(new Country("Papua New Guinea",8586525,452860,23));
2766-
countryList.add(new Country("Israel",8583916,21640,31));
2767-
countryList.add(new Country("Togo",8186384,54390,19));
2768-
countryList.add(new Country("Sierra Leone",7883123,72180,19));
2769-
countryList.add(new Country("Hong Kong",7490776,1050,45));
2770-
countryList.add(new Country("Laos",7064242,230800,24));
2771-
countryList.add(new Country("Bulgaria",6988739,108560,45));
2772-
countryList.add(new Country("Paraguay",6981981,397300,27));
2773-
countryList.add(new Country("Libya",6569864,1759540,29));
2774-
countryList.add(new Country("El Salvador",6445405,20720,28));
2775-
countryList.add(new Country("Nicaragua",6351157,120340,27));
2776-
countryList.add(new Country("Kyrgyzstan",6218616,191800,26));
2777-
countryList.add(new Country("Lebanon",6065922,10230,31));
2778-
countryList.add(new Country("Turkmenistan",5942561,469930,27));
2779-
countryList.add(new Country("Singapore",5868104,700,42));
2780-
countryList.add(new Country("Denmark",5775224,42430,42));
2781-
countryList.add(new Country("Finland",5561389,303890,43));
2782-
countryList.add(new Country("Congo",5542197,341500,19));
2783-
countryList.add(new Country("Slovakia",5450987,48088,41));
2784-
countryList.add(new Country("Norway",5400916,365268,40));
2785-
countryList.add(new Country("Eritrea",5309659,101000,19));
2786-
countryList.add(new Country("State of Palestine",5186790,6020,20));
2787-
countryList.add(new Country("Oman",5001875,309500,31));
2788-
countryList.add(new Country("Costa Rica",4999384,51060,34));
2789-
countryList.add(new Country("Liberia",4977720,96320,19));
2790-
countryList.add(new Country("Ireland",4847139,68890,39));
2791-
countryList.add(new Country("Central African Republic",4825711,622980,18));
2792-
countryList.add(new Country("New Zealand",4792409,263310,38));
2793-
countryList.add(new Country("Mauritania",4661149,1030700,20));
2794-
countryList.add(new Country("Kuwait",4248974,17820,34));
2795-
countryList.add(new Country("Panama",4226197,74340,30));
2796-
countryList.add(new Country("Croatia",4140148,55960,44));
2797-
countryList.add(new Country("Moldova",4029750,32850,38));
2798-
countryList.add(new Country("Georgia",3904204,69490,39));
2799-
countryList.add(new Country("Puerto Rico",3654978,8870,38));
2800-
countryList.add(new Country("Bosnia & Herzegovina",3501774,51000,42));
2801-
countryList.add(new Country("Uruguay",3482156,175020,36));
2802-
countryList.add(new Country("Mongolia",3166244,1553560,29));
2803-
countryList.add(new Country("Albania",2938428,27400,38));
2804-
countryList.add(new Country("Armenia",2936706,28470,36));
2805-
countryList.add(new Country("Jamaica",2906339,10830,31));
2806-
countryList.add(new Country("Lithuania",2864459,62674,43));
2807-
countryList.add(new Country("Qatar",2743901,11610,32));
2808-
countryList.add(new Country("Namibia",2641996,823290,22));
2809-
countryList.add(new Country("Botswana",2374636,566730,26));
2810-
countryList.add(new Country("Lesotho",2292682,30360,22));
2811-
countryList.add(new Country("Gambia",2228075,10120,18));
2812-
countryList.add(new Country("Gabon",2109099,257670,23));
2813-
countryList.add(new Country("TFYR Macedonia",2086720,25220,39));
2814-
countryList.add(new Country("Slovenia",2081900,20140,45));
2815-
countryList.add(new Country("Guinea-Bissau",1953723,28120,19));
2816-
countryList.add(new Country("Latvia",1911108,62200,44));
2817-
countryList.add(new Country("Bahrain",1637896,760,32));
2818-
countryList.add(new Country("Swaziland",1415414,17200,21));
2819-
countryList.add(new Country("Trinidad and Tobago",1375443,5130,36));
2820-
countryList.add(new Country("Equatorial Guinea",1360104,28050,22));
2821-
countryList.add(new Country("Timor-Leste",1352360,14870,18));
2822-
countryList.add(new Country("Estonia",1303798,42390,43));
2823-
countryList.add(new Country("Mauritius",1271368,2030,37));
2824-
countryList.add(new Country("Cyprus",1198427,9240,37));
2825-
countryList.add(new Country("Djibouti",985690,23180,25));
2826-
countryList.add(new Country("Fiji",918757,18270,29));
2827-
countryList.add(new Country("Reunion",889918,2500,36));
2828-
countryList.add(new Country("Comoros",850910,1861,20));
2829-
countryList.add(new Country("Bhutan",826229,38117,29));
2830-
countryList.add(new Country("Guyana",786508,196850,26));
2831-
countryList.add(new Country("Macao",642090,30,39));
2832-
countryList.add(new Country("Solomon Islands",635254,27990,21));
2833-
countryList.add(new Country("Montenegro",629355,13450,39));
2834-
countryList.add(new Country("Luxembourg",596992,2590,40));
2835-
countryList.add(new Country("Western Sahara",582478,266000,28));
2836-
countryList.add(new Country("Suriname",573085,156000,30));
2837-
countryList.add(new Country("Cabo Verde",560349,4030,26));
2838-
countryList.add(new Country("Maldives",451738,300,31));
2839-
countryList.add(new Country("Guadeloupe",448798,1690,43));
2840-
countryList.add(new Country("Brunei",439336,5270,32));
2841-
countryList.add(new Country("Malta",433245,320,42));
2842-
countryList.add(new Country("Bahamas",403095,10010,34));
2843-
countryList.add(new Country("Belize",390231,22810,25));
2844-
countryList.add(new Country("Martinique",385320,1060,46));
2845-
countryList.add(new Country("Iceland",340566,100250,37));
2846-
countryList.add(new Country("French Guiana",296847,82200,25));
2847-
countryList.add(new Country("French Polynesia",288506,3660,33));
2848-
countryList.add(new Country("Vanuatu",288017,12190,23));
2849-
countryList.add(new Country("Barbados",287010,430,40));
2850-
countryList.add(new Country("New Caledonia",283376,18280,33));
2851-
countryList.add(new Country("Mayotte",266380,375,20));
2852-
countryList.add(new Country("Sao Tome & Principe",213379,960,19));
2853-
countryList.add(new Country("Samoa",198909,2830,22));
2854-
countryList.add(new Country("Saint Lucia",180454,610,35));
2855-
countryList.add(new Country("Guam",167245,540,31));
2856-
countryList.add(new Country("Channel Islands",166828,190,44));
2857-
countryList.add(new Country("Curacao",162547,444,42));
2858-
countryList.add(new Country("Kiribati",120428,810,23));
2859-
countryList.add(new Country("St. Vincent & Grenadines",110488,390,32));
2860-
countryList.add(new Country("Tonga",110041,720,22));
2861-
countryList.add(new Country("Grenada",108825,340,29));
2862-
countryList.add(new Country("Micronesia",106983,700,23));
2863-
countryList.add(new Country("Aruba",106053,180,41));
2864-
countryList.add(new Country("U.S. Virgin Islands",104909,350,42));
2865-
countryList.add(new Country("Antigua and Barbuda",104084,440,32));
2866-
countryList.add(new Country("Seychelles",95702,460,36));
2867-
```

0 commit comments

Comments
 (0)