Display instruction for the respondents to answer the survey using function displayInstruction().

|Survey of Student's Perception on Online Learning in Kolej Seri Sarawak | -------------------------------------------------------------------------- Dear Respondents,
You are invited to answer this survey.
Please respond to the following questions that corresponds to your response. The survey is divided into 2 sections:

Section A- Demographics
Section B- Student's Perception on Online Learning
Thank you for your time and cooperation.

  1. Accept number of respondents took part in this survey for data analysis (to determine loop)

  2. Enter respondent’s ID (Student ID) in array ID[ ] and respondent’s test mark in array marks [ ].

  3. Accept respondent’s gender and using function countGender() which receives gender and return number of gender, Female or Male.

  4. Accept current student’s semester and using function countSemester() which receives semester and return number of student’s for each semester whether the students is in Semester 1, Semester 2 or Semester 3.

  5. Accept and count number of students with computer facilities (Smartphone / Computer / Laptop). (Yes or No).

  6. Accept and count number of students with Internet Access. (Yes or No).

  7. Accept and count number of types of Internet Data Speed (GPRS, EDGE, 3G, 4G or 5G).

  8. Accept Student’s Perception on Online Learning and determine the level of perception based on average value of three questions. Then use function determinePerceptionLevel(), which receives average value on student’s perceptions and return whether the perception is L- LOW, M-MODERATE or H-HIGH Recommend the action plans based on the level value. Count the number of perceptions level low, moderate and high.

Average Value
Level
1.00 – 2.33
Low (L)
2.34 - 3.67
Moderate (M)
3.68 – 5.00
High (M)

  1. Display data analysis of the survey (Figure 2).
  2. Display respondent’s ID and student’s mark from each array.

There's so much missing here. Maybe this is homework and you didn't read https://www.daniweb.com/welcome/rules about homework.
Next there's the small issues that C++ doesn't have native SQL support. Along with what you wrote above doesn't seem to detail enough for any seasoned programmer to create this app. Maybe there's more to be told but here, for homework you present where you are stuck, show code for what doesn't work as well as write why you think it's broken.

With limited information, you can probably use some of these ideas.

#include <iostream>
#include <string>

int countGender();
int countSemester();
int determinePerceptionLevel();
int loop = 0;
int respondents = 0;
std::string student_id = "";
std::string array_id[100] = { "" };
double array_marks[100] = {0.0};
int gender = 0;
int male = 0;
int female = 0;
int seme = 0;
int seme1 = 0;
int seme2 = 0;
int seme3 = 0;
std::string computer_facilities = "";
int no_computer = 0;
int computer = 0;
int yes = 0;
int no = 0;
std::string internet_access = "";
int internet = 0;
int no_internet = 0;
int data_type = 0;
int data_type_GPRS = 0;
int data_type_EDGE = 0;
int data_type_3G = 0;
int data_type_4G = 0;
int data_type_5G = 0;
int data_type_none = 0;
double science = 0;
double english = 0;
double math = 0;
double level = 0;
int low = 0;
int mod = 0;
int high = 0;
double grade_level_low_min = 1.00;
double grade_level_low_max = 2.33;
double grade_level_mod_min = 2.34;
double grade_level_mod_max = 3.67;
double grade_level_high_min = 3.68;
double grade_level_high_max = 5.00;


int main()
{

    std::cout << "Survey of Student's Perception on Online Learning in Kolej Seri Sarawak" << std::endl;
    std::cout << "-----------------------------------------------------------------------" << std::endl;
    std::cout << "Dear Respondents, You are invited to answer this survey." << std::endl;
    std::cout << "Please respond to the following questions that corresponds to your response.The survey is divided into 2 sections:" << std::endl;
    std::cout << "Section A - Demographics" << std::endl;
    std::cout << "Section B- Student's Perception on Online Learning" << std::endl;
    std::cout << "Thank you for your time and cooperation." << std::endl;

    std::cout << "-----------------------------------------------------------------------" << std::endl;
    std::cout << "Section A" << std::endl;
    std::cout << "How many respondents took part in this survey?: ";
    std::cin >> respondents;
    while (loop < respondents)
    {
        std::cout << "Enter Student ID: ";
        std::cin >> student_id;
        array_id[loop] = student_id;

        countGender();

        if (gender == 1) {
            male++;
        }

        if (gender == 2) {
            female++;
        }

        countSemester();

        if (seme == 1) {
            seme1++;
        }

        if (seme == 2) {
            seme2++;
        }

        if (seme == 3) {
            seme3++;
        }

        std::cout << "Do you have computer facilities (Smartphone / Computer / Laptop)? (Yes or No)" << std::endl;
        std::cout << "Answer (Yes or No): ";
        std::cin >> computer_facilities;
        if (computer_facilities == "Yes")
        {
            computer++;
        }
        if (computer_facilities == "No")
        {
            no_computer++;
        }

        std::cout << "Do you have Internet Access (Yes or No)? " << std::endl;
        std::cout << "Answer: ";
        std::cin >> internet_access;
        if (internet_access == "Yes")
        {
            internet++;
        }

        if (internet_access == "No")
        {
            no_internet++;
        }

        std::cout << "What type of Internet Data Speed" << std::endl;
        std::cout << "1) GPRS" << std::endl;
        std::cout << "2) EDGE" << std::endl;
        std::cout << "3) 3G" << std::endl;
        std::cout << "4) 4G" << std::endl;
        std::cout << "5) 5G" << std::endl;
        std::cout << "6) None" << std::endl;

        std::cout << "Answer (1-6): ";
        std::cin >> data_type;

        if (data_type == 1)
        {
            data_type_GPRS++;
        }
        if (data_type == 2)
        {
            data_type_EDGE++;
        }
        if (data_type == 3)
        {
            data_type_3G++;
        }
        if (data_type == 4)
        {
            data_type_4G++;
        }
        if (data_type == 5)
        {
            data_type_5G++;
        }
        if (data_type == 6)
        {
            data_type_none++;
        }

        std::cout << "" << std::endl;
        std::cout << "Section B" << std::endl;
        std::cout << "Student Perception on Online Learning" << std::endl;
        determinePerceptionLevel();
        std::cout << "Test mark: " << level;

        if (level > grade_level_low_min && level < grade_level_low_max) {
            std::cout << " - Low" << std::endl;
        }
        if (level > grade_level_mod_min && level < grade_level_mod_max) {
           std::cout << " - Moderate" << std::endl;
        }
        if (level > grade_level_high_min && level < grade_level_high_max) {
           std::cout << " - High" << std::endl;
        }

        array_marks[loop] = level;
        loop++;
    }
    std::cout << "" << std::endl;
    std::cout << "Gender: " << "Male: " << male << " " << "Female: " << female << std::endl;
    std::cout << "\t\tSemister 1 " << "\t" << "Semester 2" <<"\t" << "Semester 3" <<  std::endl;
    std::cout << "Students:\t\t" << seme1 << "\t\t" << seme2 << "\t\t" << seme3 << std::endl;
    std::cout << "Student computer facilities: " << "Yes: " << computer << "\t" << "No:" << no_computer << std::endl;
    std::cout << "Has Internet Access: " << "Yes: " << internet << "\t" << "No:" << no_internet << std::endl;
    std::cout << "Student Data Speed Types" << std::endl;
    std::cout << "GPRS: " << data_type_GPRS << std::endl;
    std::cout << "EDGE: " << data_type_EDGE << std::endl;
    std::cout << "3G: " << data_type_3G << std::endl;
    std::cout << "4G: " << data_type_4G << std::endl;
    std::cout << "5G: " << data_type_5G << std::endl;
    std::cout << "None: " << data_type_none << std::endl;
    std::cout << "Students Perception Level" << std::endl;
    std::cout << "(L)ow: " << low << "\t" << "(M)oderate: " << mod << "\t" << "(H)igh: " << high << std::endl;

    for (int x = 0; x < respondents; x++) {
        std::cout << "Student ID : " << array_id[x] << "\t" << "Mark Level: " << array_marks[x] << std::endl;
    }
}

int countGender()
{
    std::cout << "Gender" << std::endl;
    std::cout << "1) - Male " << std::endl;
    std::cout << "2) - Female " << std::endl;
    std::cout << "Answer (1 or 2): ";
    std::cin >> gender;
    return gender;
}

int countSemester()
{
    std::cout << "Which Semester are you in? " << std::endl;
    std::cout << "Answer (1-3): ";
    std::cin >> seme;
    return seme;
}

int determinePerceptionLevel()
{
    //not enough information
    std::cout << "Rate your science knowledge (1-5): ";
    std::cin >> science;
    std::cout << "" << std::endl;
    std::cout << "Rate your English (1-5): ";
    std::cin >> english;
    std::cout << "" << std::endl;
    std::cout << "Rate your math skills (1-5):";
    std::cin >> math;

    level = (science + english + math) / 3;
    std::cout << "Recommendation: ";
    if (level >= grade_level_low_min && level < grade_level_low_max) {
        low++;
       std::cout << "Go back to school." << std::endl;
    }
    if (level > grade_level_mod_min && level < grade_level_mod_max) {
        mod++;
        std::cout << "Go back to college." << std::endl;
    }
    if (level > grade_level_high_min && level <= grade_level_high_max) {
        high++;
        std::cout << "Go find a nice job." << std::endl;
    }
    if (level > grade_level_high_max)
    {
        std::cout << "Stop cheating." << std::endl;
    }
    return level;
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.