Here is most of the code, but there is an incomplete condition, as well as a mis
ID: 3683889 • Letter: H
Question
Here is most of the code, but there is an incomplete condition, as well as a missing statement.
A. Write the expression that needs to be written next to the || operator, in order to complete the condition in the while header.
B. Write the statement that is presently missing from the while loop body.
clc
count = 0;
ch = input('Enter a letter: ','s');
while (ch>='A' && ch<='Z') ||_________
fprintf('Thanks, you entered %c ',ch)
______
ch = input('Enter a letter: ','s');
end
fprintf('%s is not a letter ',ch)
fprintf('You entered %d letters. ',count)
Explanation / Answer
A.(ch>='a' && ch<='z')//checking for small letters
B.count++//increasing count value
clc
count = 0;
ch = input('Enter a letter: ','s');
while (ch>='A' && ch<='Z') ||(ch>='a' && ch<='z')
fprintf('Thanks, you entered %c ',ch)
count++
ch = input('Enter a letter: ','s');
end
fprintf('%s is not a letter ',ch)
fprintf('You entered %d letters. ',count)
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.