Win a copy of Kotlin in Action this week in the Kotlin forum!
    Bookmark Topic Watch Topic
  • New Topic

Simple java homework help  RSS feed

 
nathan gibson
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Report post to moderator


"Write a program to calculate the probability that a family with two children
will consist of two boys, a boy and a girl, or two girls."

these are my instructions. i am supposed to write a program to calculate the probability of a family having two children. i am okay importing the file, but the file that i am supposed to import is like this: bb gg bg, representing boy and girl outcomes, but i dont know how to implement that into a program that is supposed to predict the probability of a couple's child combination. thank you for any help.
__________________
 
Fred Hamilton
Ranch Hand
Posts: 684
  • Mark post as helpful
  • send pies
  • Report post to moderator
Do you understand the laws of probability enough to work it out on paper? That should be quick and easy, if you understand probability. Maybe that will help you work out the code to do it automatically.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66187
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
How many posts are you planning to open for this single problem? Please continue to post in one of your previous topics.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!