Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(((( 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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started