Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

If you don't mind, can you use Java? Thank you MAY UT SU submitting a hle upload a Purpose: To demonstrate the ability to represent

If you don't mind, can you use Java?
Thank you
image text in transcribed
image text in transcribed
image text in transcribed
MAY UT SU submitting a hle upload a Purpose: To demonstrate the ability to represent data, such as sets, using bit-strings and to perform the appropriate logical operations on those representations to compute the desired results. This program should be written in Java, Corc Discussion: A bit string is a sequence of bits used to store or represent values. In this case, each bit represents a digit from 0 to 9. As a result, the bit position can be used as the value representation while the value represents whether that digit is a member of the set. For example, using a 16 bit integer to store our set, the binary representation of the set 10,351 would be: 00000000000101001 which would be the decimal integer value 41. Note bits 0.3, and 5 are all set to indicatiese membersho. For this assignment you will write a program that reads elements of a two sets from the krytioard and display the results of operations on those sets Given subsets A and B of a universal set with 10 elements 10,1,2,3,4,5,6,7. 8. 91.writec.C++, or uva program that uses bit strings to find the results of set operations complement, union, intersection, difference, and symmetrie difference. You should refer to this document for help. Note: You must use integers to represent the sets. Things that are NOT integers: arrays of anything, strings.pre-defined library classes. You should declare one integer for the set A and one integer for the set B. Create one function/method for each operation to be performed of code NATIONAL STUX Program Manipulan x Set in Java - Ceesex Getting Started with Decentralind lava Program to read GM ure.com/courses/541621/assignment/5225348?module_item_idu8278528 Maps The program will be tested with the following pairs of set data: Set A ( 1 2 3 4 5) Set 8 = (3 4 5 6 7 8 9) Set A = (3 453) Set B = (1 2 3 4) Set A = {0 2 4 6 8) Set B = {1 3 5 7 9) Set A = {} Set B = (1 59) Input should be read from prompts on the keyboard (which can be provided through input redirection). The number of elements in the set should come first, followed by list of elements in that set. Repeated elements should not cause problems and elements outside the appropriate range should generate an error message. Here is a sample program for Windows, you must run it on the command line, bitstring.exe The input portion of your program should look like: The input portion of your program should look like: 5 2130 - Computational Structures do Wildcat This program reads in the values of two sets and displays the results of several operations on the sets Please enter the number of elesin et A Please enter element 11 Please enter element 2: 23 Value entered is not allowed, please try again Please enter element 212 Please enter element 319 Please enter the number of elements in set: sces The sets may contain anywhere from zero to ten elements. You need to ensure the valles entered are between 0 and 9, but you should not test if a value has already been entered. Output results should be clearly displayed with appropriate labeling. An example of a typical output format is given here: Input Sets Set (0,1,2) Set 8 - 12,3,4) Complement of A3,4,5,6,7,8,92 Union of Aude (0,1,2,3,4} Intersection of AB - (2) Difference of A and (0,1) Syectric Difference of a od (0.1.,3,4) Once you have completed your program and tested it with the sets above, submit your source code ble for grading

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

More Books

Students also viewed these Databases questions

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago