Answer:
Below is the c++ program with detail explanation on each line
Explanation:
// C++ program to demonstrate Â
// accessing of data members Â
Â
#include <bits/stdc++.h> Â
#include <conio.h>
using namespace std; Â
Â
int main() { Â
//Declaring variable for every type that we need to check
 int totalUpperCase=0;
 int totalLowerCase=0;
 int totalWhiteSpaces=0;
 int totalDigits=0;
 //define x variable which will hold character input from user
 char x;
 Â
 while(x != '#'){ //execute until # character entered by user
 x=getche(); //as we want from user to enter as many character as
 //user wants without pressing enter key, that's why we use getche() which means
 //get one character.
 //isaplha method is used to check whether character is alphabet or not
  if(isalpha(x)){ Â
 //isupper will check if entered character is upper case or not
   if (isupper(x)) Â
     totalUpperCase++;
   else Â
     totalLowerCase++; Â
//isdigit method is used to check number
 } else if(isdigit(x)){
 totalDigits++;
 } else if(x == ' '){
 totalWhiteSpaces++;
 }
  Â
  }
  //printing all the values here
  cout<<"\n"<<"Total Upper Case Letters :" << totalUpperCase<<"\n"; Â
cout<<"Total Lower Case Letters :"<<totalLowerCase<<"\n"; Â
cout <<"Total White Spaces :"<< totalWhiteSpaces<<"\n";
cout << "Total Digits" <<totalDigits<<"\n";
// getche() at the end so that our programs wait until user presses any key
getche();
  return 0; Â
}