subject

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. Ex: If the input is: n Monday, the output is: Ex: If the input is: z Today is Monday, the output is: Ex: If the input is: n It's a sunny day, the output is Case matters. Ex: If the input is: n Nobody, the output is: n is different than N LAB ACTIVTY 4.12.1: LAB: Count characters 6/10 LAB ACTIVTY 4.12.1: LAB: Count characters 6/10 main. cpp Load default template... 1 #include«iostream» 2 using namespace std; 3 int mainO t 4 5 char C; 6 cin c 8 string s; 9 getline(cin, s); 10 11 int ct-0; 12 13 while (s. find(c) != string ::npos ) { 14 ct ct + 1; 15 s = s, find (c, s. find(c) + 1); 16 17 cout << ct << endl; 18 return 0: Total score: 6/10 Latest submission- 3:56 AM on 04/30/19 Only show failing tests Download this submission 1: Compare output 2/2 Input n Monday Your output 1 2: Compare output 2/2 Input z Today is Monday Your output 0 0/2 : Compare output Output differs. See highlights below. Input n It's a sunny day Your output Expected output2 4: Compare output 0/2 Output differs. See highlights below Input t this is a sentence with many t's Your output Expected output 2/2 5: Compare output Input x X Your output 0

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:20
This problem has been solved! see the answeran evil king has a cellar containing n bottles of expensive wine, and his guards have just caught a spy trying to poison the king’s wine. fortunately, the guards caught the spy after he succeeded in poisoning only one bottle. unfortunately, they don’t know which one. to make matters worse, the poison the spy used was very deadly; just one drop diluted even a billion to one will still kill someone. even so, the poison works slowly; it takes a full month for the person to die. design a scheme that allows the evil king to determine exactly which one of his wine bottles was poisoned in just one month’s time while expending at most o(logn) of his taste testers.you are not allowed to use n testers, one for each bottle, and see which one tester dies after 30 days.(no pseudocode needed. just answer in words, how many testers you use, how you use them and why you correctly identify the poisoned bottle in 30 days)
Answers: 2
question
Computers and Technology, 21.06.2019 23:30
You picked the corridor which led you here. if the guards find you, they're going to be really angry! what is the synonym of angry
Answers: 1
question
Computers and Technology, 22.06.2019 08:10
Technician a says that if a valve is open when a piston rises to the very top of a cylinder, the piston may actually strike the valve head and cause serious engine damage. technician b says if the camshaft is located in the engine block, then the engine is called an overhead valve engine, ohv engine, or an in-block camshaft. who is right? a. b only b. both a and b c. a only d. neither a nor b
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
Companies that implement and apply an information system effectively can create
Answers: 1
You know the right answer?
Write a program whose input is a character and a string, and whose output indicates the number of ti...
Questions
question
Mathematics, 29.06.2019 00:30
question
Mathematics, 29.06.2019 00:30
question
Mathematics, 29.06.2019 00:30
question
Mathematics, 29.06.2019 00:30
question
Business, 29.06.2019 00:30
Questions on the website: 13722363