Given the scenario that this class is comprised of ten male students and eleven female students
and you are part of a five member team, how would you respond to the following? What is the
probability that (if you are male) your team is composed of all males or (if you are a female)
your team is composed of all females?
Solution
male students=10
female students=11
total students=10+11=21
probability that the team of 5 is composed of all males or all are females in the team
=10c5/21c5 +11c5/21c5 = 252/20349 +462/20349 = 0.0124+0.0227 = 0.0351.
Measures of Central Tendency: Mean, Median and Mode
I need some help creating Psuedocode for a project using Java. Basic.pdf
1. I need some help creating Psuedocode for a project using Java. Basically I need some help to
assist in organizing and identifying how to go about using Variable /Operators, Decision
Structures, Loops and file streaming. The information below is what I have to go on to design the
program. Would some one be able to assist in creting Psuedocde to help be better visualize how
to go about writing the code in a few weeks? Monitoring System As a zookeeper, is important to
it know the activities of the animals in your care and to monitor their living habitats. Create a
monitoring system that does all of the following: Asks a user if they want to monitor an animal,
monitor a habitat, or exit Displays a list of animal options (based on the previous selection) as
read from either the animals or habitats file o Asks the user to enter one of the options Displays
the monitoring information by finding the appropriate section in the file Separates sections by the
category and selection (such as "Animal Lion" or "Habitat-Penguin Uses a dialog box to alert
the zookeeper ifthe monitor detects something out of the normal range (These will be denoted in
the files by a new line starting with Do not display the asterisks in the dialog.) Allows a user to
return to the original options Details on lions Details on penguin habitat Details on bird house
Details on tigers Details on aquarium Details on bears Details on giraffes Habitat Penguin
Animal Lion Temperature: Freezing Food source Fish in water running low Name: Leo
Cleanliness Passed Age: 5 Health concerns Cut on left front paw Habitat Bird Feeding schedule:
Twice daily Temperature: Moderate Food source: Natural from environment Animal Tiger
Cleanliness Passed Name: Ma Age: 15 Health concerns None Habitat Aquarium Temperature:
Varies with output temperature Feeding schedule 3x daily Food source: Added daily Cleanliness
Needs cleaning from algae Animal Bear Name: Baloo Age: 1 Health concerns None Feeding
schedule: None on record Animal Giraffe Name: Spots Age 12 Health concerns: None Feeding
schedule Grazing
Solution
1. FileReader with BufferedReader and FileWriter with PrintWriter can be used for file I/O , line
wise . Each line with several Strings also called as token can be separated using split() on blank
space while retrieval .
2. End of file is denoted by -1 . The file can be iterated till the desired token is obtained , using a
while loop . eg. b can be a boolean variable intialized to true ,eg. while(b) . once the token is
obtained the b can be set to false .
3. To gather Information and display to the user , the token for choice can be searched and
corresponding data can be appended to StringBuilder token wise , till token for next category
starts or end of file and displayed using toString() method .eg. ***** is also a token or word
2. string which can be gathered into an String array , by split() method on each line extracted using
readLine() . Token comparison is done with isEquals("")
4. For User Menu Options , Scanner can be used for user input along with getString etc. and
switch case construct can be used for processing of user choice from menu . System.out.print()
for display to user messages .
5. To allow user to the previous option another super while loop can be used within which the
other looops done so that user can be presented the original options again .