Please do not give solution in image format thanku A Bunker array is an array that contains the value 1 if and only if it contains a prime number. The array {7, 6, 10, 1} is a Bunker array because it contains a prime number (7) and also contains a 1. The array {7, 6, 10} is not a Bunker array because it contains a prime number (7) but does not contain a 1. The array {6, 10, 1} is not a Bunker array because it contains a 1 but does not contain a prime number. It is okay if a Bunker array contains more than one value 1 and more than one prime, so the array {3, 7, 1, 8, 1} is a Bunker array (3 and 7 are the primes). Write a function named isBunker that returns 1 if its array argument is a Bunker array and returns 0 otherwise. You may assume the existence of a function named isPrime that returns 1 if its argument is a prime 11 and returns 0 otherwise. You do not have to write isPrime, you can just call it. If you are programming in Java or C#, the function signature is int isBunker(int [ ] a) If you are programming in C or C++, the function signature is int isBunker(int a[ ], int len) where len is the number of elements in the array N.B You should answer only in Java code and You may assume the existence of a function named isPrime that returns 1 if its argument is a prime and returns 0 otherwise. You do not have to write isPrime, you can just call it.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

Please do not give solution in image format thanku

A Bunker array is an array that contains the value 1 if and only if it contains a prime number. The

array {7, 6, 10, 1} is a Bunker array because it contains a prime number (7) and also contains a 1.

The array {7, 6, 10} is not a Bunker array because it contains a prime number (7) but does not

contain a 1. The array {6, 10, 1} is not a Bunker array because it contains a 1 but does not contain a

prime number.

It is okay if a Bunker array contains more than one value 1 and more than one prime, so the array {3,

7, 1, 8, 1} is a Bunker array (3 and 7 are the primes).

Write a function named isBunker that returns 1 if its array argument is a Bunker array and returns 0

otherwise.

You may assume the existence of a function named isPrime that returns 1 if its argument is a prime

11

and returns 0 otherwise. You do not have to write isPrime, you can just call it.

If you are programming in Java or C#, the function signature is

int isBunker(int [ ] a)

If you are programming in C or C++, the function signature is

int isBunker(int a[ ], int len) where len is the number of elements in the array

N.B You should answer only in Java code and You may assume the existence of a function named isPrime that returns 1 if its argument is a prime and returns 0 otherwise. You do not have to write isPrime, you can just call it.

Expert Solution
steps

Step by step

Solved in 5 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education