Question: (((( You must use String functions method to write this program ))))) do not use array please In this lab. we will practice: Program with

(((( You must use String functions method to write this program )))))

do not use array please

(((( You must use String functions method to write this program )))))

In this lab. we will practice: Program with C++ type string, its methods (built-in functions defined for C++ type string) and the getline function. more practice with while loop and value returning function. You will write two C++ programs. Write a C++ program, named "count.cc", that counts and reports the number of words in a line of text entered by the user. Assume the text only contains words separated by single space. Here are a few example runs of the program: Sample run 1: please enter a line of text: The baby smiles as soon as she wakes up. There are 9 words in this sentence. Sample run 2: Please enter a line of text: Tom and Jerry are lovely characters. There are 6 words in this sentence. Sample run 3: please enter a line of text: The Labor day weekend passed so quickly. There are 7 words in this sentence. We will write a program that will display all the prime numbers under 100. A prime number is an integer that can ONLY be divisible by 1 and the number itself. You are required to write a user-defined value-returning function to determine if a number is a prime number or not. The number user entered should be passed in to this function as the parameter. Example program output: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!