1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Neko [114]
3 years ago
12

Write a function called committee to compute the number of ways of forming a single committee with r members from a collection o

f n people. This is the same as computing the number of ways of choosing r people out of n to sit at the first of two tables, and is therefore n! / (r!*(n-r)!). Make sure the function returns an integer, not a floating point number with a decimal point.

Computers and Technology
1 answer:
andrezito [222]3 years ago
5 0

Answer:

This program is written in C++.  The explanation of the code is given below in the explanation section.

Explanation:

#include <iostream>

using namespace std;

//factorial calculation

int fact(int n) {

  if (n == 0 || n == 1)

     return 1;

  else

     return n * fact(n - 1);

}

int main() {

  int n, r, comb; /* n represent number of people (population), r represent the number of selection from population and combination represent number of ways or combination */

  cout<<"Enter n : ";// prompt user to enter population i.e. total number of people

  cin>>n;//store into n

  cout<<"\nEnter r : ";//prompt user to enter number of selection from population

  cin>>r;

  comb = fact(n) / (fact(r) * fact(n-r));// calcuate combination- number of differnt ways to form a committe

  cout << "\nCombination : " << comb; //show the result

  return 0;

}

You might be interested in
Technician A says that a camshaft must open and close each valve at exactly the right time relative to piston position. Technici
morpeh [17]
On single and double overhead cam engines, the cams are driven by the crankshaft, via either a belt or chain called the timing belt or timing chain. These belts and chains need to be replaced or adjusted at regular intervals.
3 0
3 years ago
Select the correct answer.
tatuchka [14]

Answer:

B.

Explanation:

6 0
3 years ago
How can you ensure that the website you are using is secured?
poizon [28]
By having the lock by the website address
3 0
3 years ago
You are given two variables, already declared and assigned values, one of type double, named price, containing the price of an o
Oksi-84 [34.3K]

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main() {

//variable to store input

double price;

int totalNumber;

// variable to store total price

double total_price;

cout<<"Enter the price of an order:";

// read the price of an order

cin>>price;

cout<<"Enter the number of orders:";

// read the total number of orders

cin>>totalNumber;

// calculate total price of all orders

total_price=price*totalNumber;

cout<<"total price of all orders: "<<total_price<<endl;

return 0;

}

Explanation:

Declare three variables "price" of double type,"totalNumber" of int type And "total_price" of type double.Read the value of an order and number of orders. The calculate the total price by multiply "price" with "totalNumber" and assign it to variable "total_price". Print the total price.

Output:

Enter the price of an order:12.5                                                                                                                              

Enter the number of orders:3                                                                                                                                  

total price of all orders: 37.5

7 0
4 years ago
The author mentions several challenges facing the world, including poverty and climate change. How might big data help us solve
Aneli [31]

Answer:

Insights gathered from big data can lead to solutions to stop credit card fraud, anticipate and intervene in hardware failures, reroute traffic to avoid congestion, guide consumer spending through real-time interactions and applications, and much more. The benefits of big data are felt by businesses too

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • What is the role of the ieee in computer networking and wireless communications?
    14·1 answer
  • The picture that graphically represents the items you use in windows is called a/an
    15·2 answers
  • A database stores a large amount data in vertical ___
    10·1 answer
  • Declare a Scanner reference variable fileInput, and assign it a newly created Scanner object that is associated with a file name
    10·1 answer
  • What are some characteristics of pseudocode? Check all that apply. Pseudocode is an informal way of expressing ideas and algorit
    11·2 answers
  • Find the complete predicate in the sentence below.
    6·1 answer
  • What kind of files are automatically blocked in outlook?
    7·1 answer
  • Identify the correct answer in each item. Write your answer on the blank provided before
    13·1 answer
  • As a network engineer, you have been creating patch (straight-through) cables for a network switch. You have plugged in all the
    11·1 answer
  • True or false: Securing intellectual property digitally is the only security because that's how all IP is stored.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!