Write and implement generic set class with attributes

Assignment Help Programming Languages
Reference no: EM1369844

1. Design and implement a generic Set class with attributes you find necessary and with the following methods. Set class has nonduplicate elements.

size : return the number of items in the set as an integer

clear : removes all of the items

add : adds the item passed as a parameter to the set if it is not already in the set. Returns the result of addition as a boolean value

contains : checks the Set for the item passed as the parameter, returns true if the item is in the set, false otherwise

isEmpty : returns true if there are no items in the set, false otherwise

remove : removes the item passed as the parameter if it is in the set and returns the result of removal as a boolean value

toArray : Returns the items in the Set as an array of the type of items in the set (e.g., if the Set object stores Strings, the returned array will be of type String)

toString : Displays all the items in the set

subSets : Returns all possible subsets of the Set excluding empty set, as a Set array of the same type.

join : Implements join operation on the current Set and the Set object of the same type passed as parameter and returns a NEW Set object that stores the result of the join operation.

intersect : Implements intersection operation on the current Set and the Set objects of the same type passed as parameter and returns a NEW Set object that stores the result of the intersection operation.

2. Demonstrate the capabilities of your classes. Be sure to provide at least two sets and use all of the methods in your class. You are free to use a text based or a graphical user interface.

Reference no: EM1369844

Questions Cloud

Information about present worth analysis : Two methods can be used for producing expansion anchors. Method A costs $80,000 initially and will have a $15,000 salvage value after 3 years.
Write program which reads in weight in pounds and ounces : Write the program which reads in the weight in pounds and ounces and putputs equivalent weight in kilograms and grams. Utilize at least three functions.
Equilibrium income and the price level in short run : The US is proposing a significant rise in duty on Canadian softlumber. USE APPROPRIATE DIAGRAMS to answer the questions about the Canadian economy.
Determining incremental analysis : Prepare an incremental analysis for the special order and should Pro Sports Inc. accept the special order? Explain your answer. What is the minimum selling price on the special order to produce net income of $4.10 per ball?
Write and implement generic set class with attributes : Write and implement the generic Set class with attributes you find essential and with the following methods. Set class has nonduplicate elements.
Comparing the three long run supply curves : Using diagrams for both industry and a representative firm, illustrate competitive long run equilibrium. Assuming constant costs, employ these diagrams to demonstrate
Critical thinking process : Explain a situation in which critical and creative thought could have been used for a better outcome and describe why it is important to think critically and creatively in similar situations.
Economics question on rate of return : Swagelok Enterprises is manufacturer of miniature fittings and valves. Over a 5-year period, the costs associated with one product line were given below:
Write algorithm to prompt for and accept four numbers : Write the algorithm which will prompt for and accept four numbers, sort them into ascending sequence and display them to screen. Your algorithm is to include module called Order _two_numbers.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd