Answer to Question #229907 in C++ for Haf

Question #229907
An upcoming conference about C/C++ programming has three sessions planned:
A session on the new features of C++ 17
A session on functional programming in C/C++.
A session on lambda functions
Attendees can subscribe for any session. The organizers want to keep track of which attendees are attending which session. Write a program that stores this information in a two-dimensional array of Booleans, where each row represents an attendee and each column represents their subscription for a session. You can restrict the program to seven attendees, resulting in a 7 x 3 array. The program should first have the user input the data for each attendee. Write two functions that take the array as their argument. One function should print out the number of people in each session and the other should return the number of people who subscribed to all sessions.
1
Expert's answer
2021-08-27T02:04:10-0400
#include<iostream>
using namespace std;
void number(){
		int m,p,r;
	    bool bArray[7][3]={};
        bArray[0][0] = true;  // new feature of c++ session 
        bArray[0][1] = false;//session on functional programming in c/c++
        bArray[0][2] = true; //session on 'lambda functions
        bArray[1][0] = false;// new feature of c++ session 
        bArray[1][1] = false;//session on functional programming in c/c++
        bArray[1][2] = true; //session on 'lambda functions
        bArray[2][0] = false;// new feature of c++ session 
        bArray[2][1] = true;//session on functional programming in c/c++
        bArray[2][2] = true; //session on 'lambda functions
        bArray[3][0] = true;// new feature of c++ session 
        bArray[3][1] = true;//session on functional programming in c/c++
        bArray[3][2] = false; //session on 'lambda functions
        bArray[4][0] = true;// new feature of c++ session 
        bArray[4][1] = true;//session on functional programming in c/c++
        bArray[4][2] = true; //session on 'lambda functions
        bArray[5][0] = true;// new feature of c++ session 
        bArray[5][1] = false;//session on functional programming in c/c++
        bArray[5][2] = false; //session on 'lambda functions
        bArray[6][0] = true;// new feature of c++ session 
        bArray[6][1] = true;//session on functional programming in c/c++
        bArray[6][2] = true; //session on 'lambda functions


        m=5;
		p=4;
		r=5;
		cout<<"The number of people in the 'new feature of c++ session' are: "<<m<<endl;
		cout<<"The number of people attending 'session on functional programming in c/c++' are: "<<p<<endl;
		cout<<"The number of people who attended session on 'lambda functions' are: "<<r<<endl;
	}			
	 void getAll()
	 {int q;
	 q=2;
	                
	 	cout<<"The number of people who subscribed all sessions are: "<<q;
				 }  
int main()
{
     const int LENGTH=20;
     char Name[LENGTH];
     cout<<"Enter the names of the seven students: "<<endl;
      for(int j=0; j<7;j++){
      cin.getline(Name, LENGTH, '\n');
	  }
		number();
		getAll();				           
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS