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
ddd [48]
2 years ago
14

c++ 4.17 LAB: Count characters 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. The output should include the input character and use the plural form, n's, if the number of times the characters appears is not exactly 1. Ex: If the input is: n Monday the output is: 1 n
Computers and Technology
1 answer:
Nata [24]2 years ago
5 0

Answer:

#include <iostream>

using namespace std;

int main() {

   int n = 0;

   char c;

   string str;

   cin >> c >> str;

   for (int i = 0; i < str.length(); ++i)

       if (c == str[i]) n++;

   cout << n << " n" << (n > 1 ? "'s" : "");

   return 0;

}

Explanation:

Declares variables n, c, and str.

Next a loop lets count number of character c in string str.

Finally, answer is showing.

You might be interested in
What type of program would you use to create a personal budget?
maw [93]
You would use a spreadsheet such as Google SpreadSheet or Excel or Libre Calc
6 0
3 years ago
Data mining must usestatistics to analyze data.<br> True<br> False
Rasek [7]

Answer: True

Explanation: In data mining, they use statistics component for the analyzing of the large amount of data and helps to deal with it. Statistics provide the techniques for the analyzing, evaluating and dealing with the data that is known as data mining.Data statistics provide the help to organize large data in a proper form and then analyze it. Thus, the statement given is true that data mining must use statistics to analyse data.

4 0
3 years ago
Interactive sites where users write personal topics and comments to a threadded discussion are called?
Eddi Din [679]
The correct answer would be Forums
5 0
3 years ago
Do we have to use intersection?
levacccp [35]
Yessssssssssssssssssss
8 0
3 years ago
What mobile operating system below requires all applications to be reviewed and approved before they can be made available in th
FinnZ [79.3K]

Answer:

The correct answer to the following answer will be iOS.

Explanation:

The iOS formerly stands for iPhone Operating System, basically is a mobile operating system developed by Apple Inc. This edition mainly supports Apple devices such as iPhone, iPod touch, iPad, etc.

Just because of this iOS gives the improvement to the entire application and is one of the operating systems which requires all that applications to be approved before showing availability in the App stores.

So, iOS is the right answer.

4 0
3 years ago
Other questions:
  • Anna always has a hard time finding files on her computer because she does not know where she saved them. This also affects her
    12·2 answers
  • Semiconductor memory is used mainly for primary storage even with its high cost. In another hand, the magnetic tape is the cheap
    9·2 answers
  • If you want to store the information that a user types in response to the input() function, what do you need to do? (select the
    11·1 answer
  • Which of the following statements is NOT true about a mainframe computer?
    14·1 answer
  • A popular encryption method used to protect data that travel over a wireless network is ____
    12·1 answer
  • Assume that input file references a Scanner object that was used to open a file. Which of the following while loops shows the co
    6·1 answer
  • What happens when you call someone whose phone is off?
    6·2 answers
  • MULTIPLE CHOICE:
    15·1 answer
  • Siapa mahapatih brainly.com atau yg disebut Brainly Amerika Serikat ?​
    5·1 answer
  • What is the code for this please?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!