Question: Please submit a typed code that is ready to run in c, c++, c#, python, or java. Thanks. Homework Assignment #1 Warm-up Mathematical review Q1)
Please submit a typed code that is ready to run in c, c++, c#, python, or java. Thanks. Homework Assignment #1 Warm-up Mathematical review Q1) (70 points) W integers). The class should contain program that tests your "Set" class. The test program will be a menu-like to test all the operations in rite a computer program that defines the class "Set" (assume that the elements are methods to perform the operations listed below. Write a test class "Set". ciISE students will do parts: a, b, c, d, g.l, and o only. a) Different constructors to initialize the set (one is to set the elements from a one dimension array) b) union: find the union of the set with a given set. OUTPUT/RETURN: a Set object. intersection: find the intersection of the set with a given set. OUTPUT/RETURN: a Set object d) difference: find the difference of the set and the given set (Set-given Set). OUTPUT/RETURN: a Set object. e) Cartesian product: find the Cartesian product (Set X given set). OUTPUT: prints out the product. Check whether the set is a subset of another set. OUTPUT/RETURN: True or False. g) ) isEmpty method that returns true if the set is empty (no elements). isElement method that takes an element and check if it is an element of the set. i) h) isEqual method that check if the set is equal to a given set. i) getCardinality method that returns the cardinality of the set. k) addElement method that adds an element to the set. Make sure that you don't add an existing element. You will use isElement check before you try to add it. l) removeElement method to remove an element from the set. m) Clear method to remove all elements of the set. n) toArray that converts the object of the Set class to a one dimensional array o) print method to print the elements of the set. in your test program, declare two sets objects and use the constructor to initialize them by sending a one dimension array contains the elements of the set. Instructions: 1. You can use Ce, Python 3.x, C++, Perl, or Java programming languages. No other language is allowed or accepted 2. All of the work should be submitted as a softcopy. No hardcopy will be acceptecd. 3. Q1 should be submitted as source code file in separate file. Name the file as ql. Example: ql.cpp or q1.java 4. Put all source files in one folder and name it as LASTNAME Hw1. Compress this folder and submit it through elearn
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
