The program is an illustration of loops.
Loops are used to perform repetitive actions.
The program in C++ where comments are used to explain each line, is as follows:
#include <string>
#include <iostream>
using namespace std;
int main(){
//This declares all variables
int n, count = 0; string k;
//This gets input for the number of cards
cin>>n;
//The following is repeated n-times
for(int i = 0;i <n;i++){
//This gets input for the current card value
cin>>k;
//If the card is a digit
if(isdigit(k[0])){
//This checks if the card number is between 2 and 6 (inclusive)
if(stoi(k) >= 2 && stoi(k) <= 6){
//If yes the face value is increased by 1
count+=1;
}
//This checks if the card number is 10
else if(stoi(k) == 10){
//If yes the face value is decreased by 1
count-=1;
}
}
//This checks if the card number is J, Q, K or A
else if (k == "J" || k == "Q" || k == "K" || k == "A") {
//If yes the face value is decreased by 1
count-=1;
}
}
//This prints the face value
cout<<count;
return 0;
}
At the end of the program, the face value is printed.
Read more about similar programs at:
https://brainly.com/question/24578223