Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

6. double-primes: Takes an array of integers and the length of the array as input and doubles every prime element of the array. For example,

image text in transcribed

6. double-primes: Takes an array of integers and the length of the array as input and doubles every prime element of the array. For example, if the input array contains [1, 7, -2], then after a call to double-primes the array will contain [1, 14, -2]. 7. negate-armstrongs: Takes an array of integers and the length of the array as input and negates every element of the array that is an Armstrong number. An Armstrong number (also called a Narcissistic number) is a number that is equal to the sum of its digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because it has 3 digits and 13 + 53 + 33 = 153. Thus, if an input array contains [2, -153, 153], then after a call to negate armstrongs the array will contain [2, -153, -153]. 6. double-primes: Takes an array of integers and the length of the array as input and doubles every prime element of the array. For example, if the input array contains [1, 7, -2], then after a call to double-primes the array will contain [1, 14, -2]. 7. negate-armstrongs: Takes an array of integers and the length of the array as input and negates every element of the array that is an Armstrong number. An Armstrong number (also called a Narcissistic number) is a number that is equal to the sum of its digits each raised to the power of the number of digits. For example, 153 is an Armstrong number because it has 3 digits and 13 + 53 + 33 = 153. Thus, if an input array contains [2, -153, 153], then after a call to negate armstrongs the array will contain [2, -153, -153]

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

Probabilistic Databases

Authors: Dan Suciu, Dan Olteanu, Christopher Re, Christoph Koch

1st Edition

3031007514, 978-3031007514

More Books

Students also viewed these Databases questions