Number of Respondents Calculator in C++

Download
Download is available until [expire_date]
  • Version
  • Download 24
  • File Size 1.39 KB
  • File Count 1
  • Create Date May 9, 2016
  • Last Updated May 9, 2016

Number of Respondents Calculator in C++

Number of Respondents Calculator in C++

Sample program in c++ that will compute the number of respondents using the sloven’s formula. To compute the number of respondents the user must enter the total population size.

Sloven’s formula:
n = N/(1+(Ne2))
where:
n = number of respondents
N = total population
e = margin of error , 0.05 in this case

Source code:

#include < iostream >

using namespace std;

int main()
{
    int totalpopulation;
    double respondents;
    cout << "Enter total number of population: " << endl;
    cin>> totalpopulation;

    respondents = (totalpopulation / (1 + (totalpopulation * 0.0025)));

    cout << "Number of respondents based on sloven formula: " << respondents << endl;
    return 0;
}
, , , , , ,

Post navigation

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.