Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is a variation of programming challenge 6.22 described in Gaddis on page 373 Write a program that determines if an entered integer is prime.

image text in transcribed
This is a variation of programming challenge 6.22 described in Gaddis on page 373 Write a program that determines if an entered integer is prime. A prime number is a number that is only evenly divisible by itself and 1. For example, the number 5 is prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6. Write a function name is Prime, which takes an integer as an argument and returns true if the argument is a prime number, or false otherwise. Demonstrate the function in a complete program. TIP: Recall that the % operator divides one number by another, and returns the remainder of the division. In an expression such as num1 % num2, the % operator will return 0 if num1 is evenly divisible by num2. Do not accept a value that is less then one for the number to be tested. Your program must also include comments with your name, the date, and a short description of the project. It must also print this information as a splash screen at the beginning of the program run. Your source code must be named project_7_abc.cpp where the abc are your own initials. Submit only the source code file - the one that ends in .cpp - in the class dropbox on box.psu.edu by 11:59 pm on March 22, 2017

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Successful Keyword Searching Initiating Research On Popular Topics Using Electronic Databases

Authors: Randall MacDonald, Susan MacDonald

1st Edition

0313306761, 978-0313306761

More Books

Students also viewed these Databases questions