Write a function name is prime which takes an integer

Assignment Help Computer Engineering
Reference no: EM132175764

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.

Reference no: EM132175764

Questions Cloud

A team that needs to shift their strategy in face of change : A team that needs to shift their strategy in the face of change, should have the ability of:
Which enhancing performance : Shared leadership, over time, is related to increased __________ which enhancing performance.
Write an application with gui using tkinter : Write an application with GUI, using Tkinter. The application will have three components: a slider (Scale) for the tourist to choose how many days.
List the reasons you would give her to dissuade : List the reasons you (as a member of the same team as Bea) would give her to dissuade her from trying to scrap the SDLC and prototype every project.
Write a function name is prime which takes an integer : 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.
Define a polygon with a maximum of 8 edges : VBA CODE Write a VBA (Visual Basic for Applications) sub program to verify whether a point (with x and y coordinates) lies within a specified irregular polygon.
What are some various methods for implementing a fsm in c : When might one method be better than another in a given situation? Describe the advantages and disadvantages of each method.
Explain what you are doing so i can apply it elsewhere : I've imported an image using java fx and I can display it. I've created buttons to resize the image. (But not the code behind the buttons)
Write a program in a script file that lists all the vectors : Write a program in a script file that lists all the vector's elements that are divisible by 2 or 4 and displays the new vector.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd