Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

*IMPORTANT* NO METHODS, MUST USE A WHILE LOOP TO CHECK IF THE ELEMENT IS IN THE SET, IF NOT THEN STOP GOING THROUGH THE LOOP,BREAK

*IMPORTANT* NO METHODS, MUST USE A WHILE LOOP TO CHECK IF THE ELEMENT IS IN THE SET, IF NOT THEN STOP GOING THROUGH THE LOOP,BREAK OUT OF THE LOOP AND STATE THAT A IS NOT A SUBSET OF B. THANKS

image text in transcribed

Write a code in java that receives two sets A and B and decides whether ACB or not Input: m (a positive integer), n (a positive integer), a[1], a[2], ..., a[m] (a one dimensional array representing A), b[1], b[2], ..., b[n] (a one dimensional array representing B) Output: a string "yes" or "no" Output Example Enter m: 3 Enter n: 6 >> Enter elements of A: 3,6,8 >> Enter elements of B: 1,3,4,6,7,8 >>"Yes, A is a subset of B" Another output example Enter m: 4 Enter n: 5 >> Enter elements of A: 3,6, 8,9 >> Enter elements of B: 1,2,3, 6,9 >>"No, A is not a subset of B'" You are not allowed to use any packages or built in functions to find the answer directly

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

Oracle Database 19c DBA By Examples Installation And Administration

Authors: Ravinder Gupta

1st Edition

B09FC7TQJ6, 979-8469226970

More Books

Students also viewed these Databases questions

Question

7. Identify four antecedents that influence intercultural contact.

Answered: 1 week ago

Question

5. Describe the relationship between history and identity.

Answered: 1 week ago