1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Minchanka [31]
2 years ago
13

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 in c++
Computers and Technology
1 answer:
Eddi Din [679]2 years ago
5 0
#include
#include

using namespace std;

int CountCharacters(char userChar, string userString){
int result = 0;
for(int i = 0;i if(userString[i] == userChar){
result++;
}
}
return result;
}

int main(){
string userString;
char userChar;
cin>>userChar>>userString;
cout< return 0;
}
You might be interested in
write a pseducode that will ask the user to enter the amount of a purchase. The program should then compute that state and provi
stira [4]

The pseudocode of the program is simply a prototype of the actual program

<h3>How to write the pseudocode?</h3>

The pseudocode that does the requirements in the question is as follows:

  • Start
  • Get Input for amount of purchase
  • Compute the state tax: sales tax = sales tax percentage * amount
  • Compute the provisional sales tax: provisional sales tax = provisional sales tax percentage * amount
  • Print the taxes

Read more about pseudocode at:

brainly.com/question/24735155

#SPJ1

7 0
2 years ago
True or false: erosion takes very long to happen.​
Mkey [24]
The answer is true. erosion takes place over time
6 0
3 years ago
Read 2 more answers
What does SEO stand for?
soldier1979 [14.2K]
Search Engine Optimization
5 0
3 years ago
Read 2 more answers
Spacing and punctuation for mailing labels is determined by spacing and punctuation inserted in the ____ box.
IRISSAK [1]
Your answer to this question is..
that it is inserted in the Prototype Label box..
I am 100% sure.. good luck !
Bye and Take Care

6 0
3 years ago
Which of the following option may be used to change page size and margins?
Debora [2.8K]

Answer: D ) page set up

Explanation:

4 0
3 years ago
Read 2 more answers
Other questions:
  • Which steps would you take to determine how much an employee should be paid? Select all that apply.
    9·1 answer
  • ( ABOVE TRUSTED HELPER ONLY)Why does my rank say that I have one
    7·2 answers
  • How much is a stock supra 1998​
    15·1 answer
  • How to write an algorithm to read and print a name?<br> I want the steps please
    9·1 answer
  • Ano ang word processor at electronic spreadsheet​
    15·2 answers
  • Which of the following substances increases in quantity during repititive muscle contraction during oxygen deficti ?
    11·1 answer
  • Why do software managers have to be generalists with a range of skills, rather than simply technical specialists?
    14·1 answer
  • Brainliest for correct answer
    13·2 answers
  • You were just hired as an IT Specialist for Smalltown School District. Your first assignment is to review a problem area&amp; in
    11·1 answer
  • Write an algorithm to print the odd number from 100 to 1​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!