1.

The following program fragment is supposed to count the number of 'a's read until the character '.' is encountered. For example, if the input is "kangaroos are fantastic.", the output should be 5.int aCount=0;while(true){char c; cin >> c;if(blankD) blankE = blankF;}cout What is the value of blankE?3>What is the value of blankF?

Answer»

Answer:

The PROGRAM given in the question states that, to count the number of 'a' PRESENT in a sentence, before '.' is found. The answer for "blankD" is "(c!=' .' && c=='a')".

for "blankE" it is "aCount" and for "blankF" it is "aCount+1".

Explanation:

The reason for the answer is because, when there is character 'a' found and no '.' is present, then the the VARIABLE which is declared for counting the frequency, needs to be updated by INCRIMINATING it's value by one, which is being done, when the condition comes out to be true.



Discussion

No Comment Found