T computes and posters the probabilities of two people

Assignment Help C/C++ Programming
Reference no: EM13168014

Write a C program that computes and posters the probabilities of two people in a group who are born in the same day. The probability of two people being born in the same day of the year, for a group of npeople, is given by the following formula:

P (n) = 1 - 365/365 x 364/365 x 363/365 x ... x (365-n+1)/365

Thus, if n=1, p (1) = 1- 365/365 = 0

If n=2, p (2) = 1- 365/365 x 364/365 = 0.002740; about 0.27%

If n=3, p (3) = 1- 365/365 x 364/365 x 363/365 = 0.008204; about 0.82%

Etc.

Your program must compute the probabilities of the 10 groups of 4, 8, 12, ...40 people and must print the results according to the following presentation :

Probability of 2 identical birthdays in a group of 4 people :   1.64%

Probability of 2 identical birthdays in a group of 8 people :   7.43%

...

Probability of 2 identical birthdays in a group of 40 people :   89.12%

 

Remarks:

-There is no reading of data to perform. The printing of the probability is expressed as a percentage with the specification of the conversion %5.2lf.To avoid any overflow capacity, use the type double in your calculations.

-You must use some comments such as:

Description of the program (author, purpose)

Description of the constants and/or the variables

-Your program must use the instruction for to compute the probabilities

 

 

Reference no: EM13168014

Questions Cloud

Create a console-based application named multiplication : a. Create a console-based application named Multiplication whose main() method asks the user to input and then calls a method named MultiplicationTable(), which displays the results of multiplying the integers by each of the number 2 through 10
Takes n number of element from user : Write a C program which takes n number of element from user (where, n is specified by user) and stores data in an array. Then, this program displays the largest element of that array.
What structure best represents the rate-determining : What structure best represents the rate-determining intermediate formed when 1-methylcyclopentene reacts with Cl2.
Calculate the number of excess reagent units remaining : calculate the number of excess reagent units remaining when 100 C4H10 molecules and 611 O2 molecules react?
T computes and posters the probabilities of two people : Write a C program that computes and posters the probabilities of two people in a group who are born in the same day. The probability of two people being born in the same day of the year, for a group of  n people, is given by the following formula:
What volume will the gases expand against a constant : 1119. J of energy, to what volume will the gases expand against a constant pressure of 645. torr if all the energy of combustion is converted into work to push back the piston?
Requires the number of bits for the exponent : Write a program that requires the number of bits for the exponent and significant of a Floating Point representation; then requires two decimal real numbers and an operation either sum
Find energy are necessary to heat the air : A room contains 47kg of air. How many kilowatt-hours of energy are necessary to heat the air in the house from 7 degrees celsius to 26 degrees celsius
What is the boiling point at an elevation : the normal boiling point for mercury is 357c. what is the boiling point at an elevation where the atmospheric pressure is 635 torr.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a recursive definition in sml to reverse

Write a recursive definition in SML to reverse a list of elements and multiply all elements with 2.

  Emulates the behavior of a bus

Write a program that emulates the behavior of a bus. The bus must have a schedule ( a finite number of times for it to stop) and a certain capacity (number of passengers). In this program the bus has two states: stopped and going.

  Inserts a node with info value x

Complete the code for a function that inserts a node with info      value x before, and a node with info value zafter,each node with      info value y in a linked list with first node pointer p.

  Individual genes are substrings of a genome

Individual genes are substrings of a genome delineated by 3-element start and stop codons. Genes begin with the start codon ATG and end with one of the following 3 stop codons: TAG, TAA or TGA. Note that start codons can appear anywhere in the string..

  Write program to calculate net pay for factory worker

Write and run a program in C++ that calculates the net pay for a factory worker. The program prompts the user for skill level and hours worked, as well as appropriate insurance and retirement options for the employee's skill.

  Display your name in the title bar

Display your name in the title bar of the browser, declare the DOCTYPE for HTML5, and create a comment listing the lab number, the author, and the date.

  Program calculates and displays salesperson''s commission

The sales manager at Tompkins Company wants a program that calculates and displays each salesperson's commission, which is 10% of his or her sales. It also should display the total commission. Use a value-returning function to get the amount sold by ..

  Change the inheritance to private inheritance

Take the following C++ code and make the following changes. Change the inheritance to private inheritance. Change the private data member balance to protected. Define get function members of IntAccount class to retrieve name and balance.

  Enter the temperature at noon of each of the five days

Write a program that allows each employee to enter the temperature at noon of each of the five days and displays the highest, lowest, and average (mean) temps.

  Build a traffic light system - microcontroller system

Build the whole system with 3 RAG units and three puffin crossing units and build a team to work on this mini-project, be careful in selecting your team member.

  Design for storing the maze layout

Design and implement a C++ program for maze layout

  Assessment system of a university

Write a program for Assessment system of a University

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd