Find Jobs
Hire Freelancers

Create a class called ''Set'' in C++ using object-oriented techniques

$30-5000 USD

Closed
Posted about 22 years ago

$30-5000 USD

Paid on delivery
NO.1)Create a class called "Set". The max of elements in a Set is 100. Create the array to store the elements using the "new" operator. The only elements can be stored in a Set is an integer. Define objects of Set class as following examples: int a[11]={10,0,1,2,3,4,5,6,7,8,9}; int b[6]={5,1,3,5,7,9}; int c[6]={5,0,2,4,6,8}; int d[3]={2,0,1}; int e[1]={0}; Set Nnatural ; Set one_digit=a; Set odd=b; Set even=c; Set zero=0; Set zero_one=d; Set x=one_digit; Set empty_set2=e; 1. Write constructors (and a destructor) for above operations. 2. Write following functions: Insert Remove Is_empty Card 3. Overload following operators: = : Assignment operation (between 2 sets) + : Union of two sets * : Intersection of two sets - : Difference of two sets = = : Equality of two sets, if all members are same return 1, else 0 [] : Membership of an element to a set < : Subset operator < : Superset operator << : Output a set. Elements will be separated by a blank and an end of line at the end. >> : Input a set. Elements will be separated by a blank until end of line. NO.2)Create a class called "Bag". The Bag class will be a subclass of the class Set. In a Bag the same element can be repeated any number of times. Acordingly some existing Set functions should be redefined in a Bag class. The max of elements in a Bag is 1000. Create the array to store the elements using the "new" operator. The elements can be stored in a Bag is an integer. Bag objects can be constructed in different ways: int a[4]={1,2,3,4}; int b[10]={0,0,0,1,1,2,3,8,9,9}; int c[]={0,1,1,8,9}; int d[]={0,0,8}; Bag empty_bag; Bag bag1(b,10); Set set1(a,4); Bag bag2=bag1; Bag bag3=set1; Bag bag4(c,5); Bag bag5(d,3); 1. Write constructors for above declarations. 2. Inherit functions/operator from Set Class. 3. Add the following functions: sum : find the sum of the integers in a bag product: find the product of the integers in a bag 4. Define the following function: void test(Set & ps1, Set & ps2) { Bag tb(ps1); int i; cout<<ps1<<ps2<<tb; ps1=ps2+ps2; cout<<ps1; cin>>ps2; tb=ps2; cout<<tb; cin>>i; cout<<tb[i]; } *** SEE ATTACHMENT FILE FOR DETAIL OUTLINE! *** ## Deliverables Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Program must be fully comment. Complete copyrights to all work purchased. Due March 18, 2002. 12:00PM(Noon) Eastern Time *** SEE ATTACHMENT FILE FOR DETAIL OUTLINE! *** ## Platform Program must be written in C++ using object-oriented techniques. Program must be able to be compiled and executed on Borland C++ version 5.02 Due March 18, 2002. 12:00PM(Noon) Eastern Time *** SEE ATTACHMENT FILE FOR DETAIL OUTLINE! *** ## Deadline information Program Due March 18, Monday 12:00PM(Noon) Eastern Time *** SEE ATTACHMENT FILE FOR DETAIL OUTLINE! ***
Project ID: 2842085

About the project

29 proposals
Remote project
Active 22 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
29 freelancers are bidding on average $28 USD for this job
User Avatar
See private message.
$22.95 USD in 14 days
5.0 (137 reviews)
7.0
7.0
User Avatar
See private message.
$17 USD in 14 days
4.4 (72 reviews)
5.5
5.5
User Avatar
See private message.
$17 USD in 14 days
5.0 (43 reviews)
4.8
4.8
User Avatar
See private message.
$42.50 USD in 14 days
4.7 (41 reviews)
4.7
4.7
User Avatar
See private message.
$42.50 USD in 14 days
4.9 (25 reviews)
4.6
4.6
User Avatar
See private message.
$21.25 USD in 14 days
4.5 (42 reviews)
4.6
4.6
User Avatar
See private message.
$17 USD in 14 days
5.0 (47 reviews)
4.5
4.5
User Avatar
See private message.
$38.25 USD in 14 days
4.6 (60 reviews)
4.5
4.5
User Avatar
See private message.
$8.50 USD in 14 days
5.0 (12 reviews)
4.3
4.3
User Avatar
See private message.
$11.90 USD in 14 days
5.0 (32 reviews)
4.2
4.2
User Avatar
See private message.
$34 USD in 14 days
4.9 (69 reviews)
4.2
4.2
User Avatar
See private message.
$38.25 USD in 14 days
5.0 (33 reviews)
4.0
4.0
User Avatar
See private message.
$42.50 USD in 14 days
4.7 (18 reviews)
4.0
4.0
User Avatar
See private message.
$38.25 USD in 14 days
4.9 (35 reviews)
3.9
3.9
User Avatar
See private message.
$20.40 USD in 14 days
5.0 (26 reviews)
3.8
3.8
User Avatar
See private message.
$51 USD in 14 days
5.0 (6 reviews)
3.7
3.7
User Avatar
See private message.
$21.25 USD in 14 days
4.8 (16 reviews)
3.1
3.1
User Avatar
See private message.
$31.45 USD in 14 days
5.0 (18 reviews)
2.9
2.9
User Avatar
See private message.
$10.20 USD in 14 days
5.0 (8 reviews)
2.9
2.9
User Avatar
See private message.
$85 USD in 14 days
5.0 (2 reviews)
2.2
2.2

About the client

Flag of UNITED STATES
United States
5.0
2
Member since Feb 23, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.