60.1k views
2 votes
Write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string. If the input is: n Monday, the output is 1. If the input is: z Today is Monday, the output is 0. If the input is: n It's a sunny day, the output is 2.

User Ootterskog
by
5.1k points

1 Answer

5 votes

CLS

Input"Input a character";C$

If C$= n Monday

Print 1

Elseif C$= z Today is Monday

Print 0

Elseif C$= It's a sunny day

Print 2

Endif

End

User Lester Peabody
by
5.5k points