c++ questions

User Generated

u_nyxnaqrevv

Programming

Description

1. Using vectors or arrays, write a function named word_rev() that reverse any given word.

2. Write a program that will:

  • Ask the user to enter a word.
  • Save the entry as word_entered.
  • Call word_rev on the entry
  • Display the reversed entry (word_entered)

3. Write a function named prime() that determine whether or not a given number n (greater than

one) is prime. The algorithm:

  • If n is even then n is not a prime number except n = 2
  • For all odd numbers less or equal to the square root of n, if any of them divide n, then

n is not prime

4. Write a program that:

  • Asks the user to enter an integer
  • Saves the entry as var
  • Calls the function prime() on the entry
  • Displays whether or not the entry is prime

5. Write a function named eratos() that find all the prime number less than a given number, its

argument n

6. Write a program that:

  • Asks the user to enter an integer
  • Saves the entry as bound
  • Passes bound onto eratos()
  • Displays all the prime numbers less or equal to bound

User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Your programs are done. The zip folder conta...


Anonymous
Great! Studypool always delivers quality work.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags