Commit 30c5d77
Changed files (1)
src
Q5
src/Q5/README.md
@@ -5,47 +5,49 @@ Student ID: 3431709
1. Problem Statement:
-```text
-Create three classes: `Village`, `Citizen`, and `ComputeIntellect`.
+ Create three classes: `Village`, `Citizen`, and `ComputeIntellect`.
-The `Village` class has an instance variable called `numberOfCitizens` and
-an array that holds a maximum of 100 `Citizen` objects.
+ The `Village` class has an instance variable called `numberOfCitizens` and
+ an array that holds a maximum of 100 `Citizen` objects.
-The Citizen class has `citizenId` and `educationalQualification` as instance variables.
+ The Citizen class has `citizenId` and `educationalQualification` as instance variables.
-The `ComputeIntellect` class has a `distributionOfQualification()` method.
+ The `ComputeIntellect` class has a `distributionOfQualification()` method.
-Create 100 Citizen objects using citizenId for the range [1 to 100].
+ Create 100 Citizen objects using citizenId for the range 1 to 100.
-Randomly generate the educational qualification in the range [1 to 4], where
-* 1 = high school,
-* 2 = undergraduate,
-* 3 = postgraduate,
-* 4 = doctorate.
+ Randomly generate the educational qualification in the range 1 to 4, where
-Store these 100 objects in a Village object using an array – any array of your choice.
-The `distributionOfQualification()` method loops through the 100 objects and counts
-the number of citizens corresponding to each of the four educational qualifications.
-```
+ 1. high school
+ 1. undergraduate
+ 1. postgraduate
+ 1. doctorate
+
+ Store these 100 objects in a Village object using an array – any array of your choice.
+ The `distributionOfQualification()` method loops through the 100 objects and counts
+ the number of citizens corresponding to each of the four educational qualifications.
1. Description of the Code:
-The code has 3 classes. The entry point into the console application is
-in the `Village` class. I chose to store the citizens of the village in
-a generic `ArrayList<T>`.
+ The code has 3 classes. The entry point into the console application is
+ in the `Village` class. I chose to store the citizens of the village in
+ a generic `ArrayList<T>`.
1. Errors and Warnings:
+
+ This program does not accept any user input.
+
1. Sample Input and Output:
-```bash
-Choose exercise: (1-10)
-5
-Welcome to the village
-The village has 100 citizens
-29 citizens have a doctorate
-24 citizens have a post graduate degree
-21 citizens have a under graduate degree
-26 citizens have a high school diploma
-```
+ ```bash
+ $ mvn package
+ $ java -cp target/assignment2*.jar ca.mokhan.comp268.App 5
+ Welcome to the village
+ The village has 100 citizens
+ 23 citizens have a doctorate
+ 25 citizens have a post graduate degree
+ 33 citizens have a under graduate degree
+ 19 citizens have a high school diploma
+ ```
1. Discussion: