Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

The project consists of multiple portions. The first three parts consists of writing functions and the final part consists of sorting a list of numbers using those functions. They are as follows:

Part 1

A palindrome is a number which reads the same forward and backwards.

To illustrate:

10101,131,1331,1225221,2 are examples of palindromes

122,100,19 are examples of numbers which are not palindromes.

function that given a number determines if the number is a palindrome or not. Your function should take in a number and return "yes" or "no" depending if it's a palindrome or not.

Part 2

function that given a number determines if the number is near prime. To understand what is near prime let us first understand what a prime number is.

A number is prime is it is only divisible by 1 and itself.

2,5,13,23 are examples of prime numbers.

4,22,100,60 are examples of numbers which are not prime numbers.

Consider a number such as 49. It is not a prime number because it is divisible by 7. However, it is not divisible by anything else apart from 1, 7 and 49.

We call a number near prime if it is divisible by 1, itself and at most 2 other numbers. To illustrate:

49 is near prime as only 1,7 and 49 divide it.

22 is near prime as only 1,2,11,22 divide it.

4 is near prime as only 1,2,4 divide it.

60 is not near prime as 1,2,3,5,6,10,12,20,30,60 divide it.

17 is near prime as only 1,17 divide it

20 is not near prime as 1,2,4,5,10,20 divide it.

function which determines if a number is near prime or not.

Your function should take in a number and return "yes" or "no" depending if it's a near prime or not.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92792971
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Computer Engineering

42 of the cars in a dealer lot are red 21 are black and 10

42% of the cars in a dealer lot are red, 21% are black and 10% are white. The remainder are some other unspecified color. Salespersons randomly shows three cars to three different customers. What is the probability the f ...

Taylor found that 8 of the recipients of loans form a

Taylor found that 8% of the recipients of loans form a particular mortgage lender default within 3 years. If he takes a random sample of 736 customers who received loans 3 years ago, what is the average number of custome ...

Is it okay too copy a fellow classmate programming code

Is it okay too copy a fellow classmate programming code when you are stuck? Will that break a school honesty policy? Please explain

A companys balance sheet often reflects its business model

A company's balance sheet often reflects its business model and a horizontal or vertical analysis can help you identify one model from another. Using information from the text, compare horizontal and vertical analysis an ...

A mixture contains 0600 moles of nah2po4 and 00800 moles of

A mixture contains 0.600 moles of NaH2PO4 and 0.0800 moles of K2HPO4. It is titrated with 0.500 molar NaOH (aq) to neutralize it completely. How many mL of the NaOH solution are required?

Reflective journal entryneed reflective journal entry on

Reflective Journal Entry Need Reflective Journal Entry on writing a Background Assignment The Topic;: One of the most common questions that new students learning programming students ask is what programming language shou ...

Strategies when resources are constraineda project manager

Strategies When Resources Are Constrained A project manager has fewer options for accelerating project completion when additional resources are either not available or the budget is severely constrained. This is especial ...

The switch statementhere is the question in its entirety

The switch statement Here is the question in its entirety, but the actual problem is at the end. I just felt that I would give an overview of what I am asking. The program has to be in c++ (.cpp) and must compile as such ...

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

Question 1 list at least three main stakeholders of the

Question: 1. List at least three main stakeholders of the above XY Hospital project. 2. List at least three main functions that the above XY Hospital project provides. 3. In the pre-initiation stage of the project above, ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As