Đã hoàn thành

C++ program using "struct" needs to be switched to "class"

Hello like I said in the craigslist ad. I am working on a Visual Studio C++ program. The program is for school and it is already compiled. The program works great, however what I need is for the program to include classes. The program would need to incorporated with the classes that I have, currently I am using "struct" instead of "class." The code does not appear to be lengthy since its already written in "struct", and works fine. Basically it needs to be switched from "struct" to "class," however it will need to follow the assignment instructions.

The assignment instructions are the following:

---------------------------------------------------------------------------------------------------------------------

Define a Fraction class similar to the one shown in earlier modules with num and den as its private data. Include a constructor to initialize the fraction to 0/1, a copy constructor, a destructor, and overloading functions to overload the assignment operator =, the comparison operators <, >, ==, !=, arithmetic operators +, +=, -, -=, *, *=, /, /=, as well as friend functions (non-member) to overload << and >> to output and input a fraction (see book example). Also, include a private member function called reduce() that gets called after arithmetic operations to reduce the frraction. +, -, *, / must return the result of the operation; e.g.: the sum or difference of the two fractions. +=, -=, *= and /= must assign the result of the operation to the object that's invoking the operation; i.e.: frac1 += frac2 must modify frac1 to make it equal to the sum of the two fractions, but frac1 + frac2 must simply return the sum.

Define a class called FracList with private members fracPtr, a Fraction pointer and size to hold the size of the array of Fraction objects. Use the List container class developed in the modules as an example. Include constructor, destructor, copy constructor and overload the assignment, insertion (>>) and extraction (<<) operators. the [] operators for accessing array elements (both as lvalue and rvalue - see the example given in last module) and relational operators <, >, ==, and !=. For < and >, compare the size of the two FracList objects and for == and != see if they're identical with identical array elements. Also, include two resize() member function to resize the list, one keeping the existing vales and one without keeping old values (see the List example). Also, include a sort and binary search function (see the example).

In main, create two FracList objects, ask the user how many elements to allocate for each list, read as many Fraction objects from the keyboard as specified by the user into each (using >> operator). Sort both lists using the sort member function and display them; and then search for a value read from the user in both lists and print the index of the first occurrence or that it could not be found in either list.

Example run of the program:

Enter size of first fraction list: 5

Enter size of second fraction list: 3

Enter 5 fractions for first list: 1/4 1/8 2/3 1/3 1/2

Enter 3 fractions for second list: 3/4 1/5 1/4

Sorted lists:

1/8 1/4 1/3 1/2 2/3

1/5 1/4 3/4

Enter a fraction to search for: 1/4

1/4 was found at index 1 of list 1.

---------------------------------------------------------------------------------------------------------------------

The assignment may seem lengthy but the code already works perfectly, and it executes the right information. What I need you to do is to switch from "struct" to "class." The assignment covers what each "class" should include.

The main code is attached as "Source. cpp." The files "[url removed, login to view]" and "List.h" are part of the "List container class developed in the modules."

Please let me know how much you charge.

Kĩ năng: Lập trình C++

Xem nhiều hơn: stack program in data structure using c, merge sort program in data structure using c, dfs program in c using stack, depth first search program in c using stack, binary tree program in c using linked list, binary search program in c using function, binary search program in c using array, bfs program in c using queue, algorithm development and program design using c, program using template stack class linked list, project program using class, flight reservation program using class, small program using class, software write mq4, software write chip epson, useful software write book, software write web specs, free software write user guide, software write edid, free software write company profile, software write websites idea, software write book images, software write books, software write protection, free software write book

Về Bên Thuê:
( 17 nhận xét ) Arleta, United States

ID dự án: #11684418

Được trao cho:

ducdctoandh

I would like to bid this job because I am really suitable for job description: First: I am an software engineer who is very expertise with C/C++. In fact, I have done so many project of C/C++(Karatsuba multiplier, Nin Thêm

$50 USD trong 2 ngày
(1 Nhận xét)
2.5

13 freelancer đang chào giá trung bình $101 cho công việc này

utkarshkatiyar19

Hi, i have a lot of experience c++ programming. i can easily complete this task for you. we can have a chat. thanks

$70 USD trong 3 ngày
(242 Nhận xét)
6.9
asadrana91

Hi mate this is Asad, i have a vast experience in c++ programming, need an A grade? contact me? cheers :)

$122 USD trong 2 ngày
(29 Nhận xét)
5.7
iridescent2x15

i am software engineer.I have read the description and i would like to work for you.I can complete your task in [login to view URL] further details please inbox me. Thank you.

$100 USD trong 3 ngày
(36 Nhận xét)
5.5
josemontenegro13

Computer Engineer. Plenty of experience solving algorithmic problems via code. C++ is one of my main languages

$40 USD trong 3 ngày
(50 Nhận xét)
5.0
$100 USD trong 1 ngày
(14 Nhận xét)
4.2
DemonDeveloper

We are team of excellent developers. We have 2 year experience related to your project field. We can do your project and solve your all problems according to your requirements. We have read your description for project Thêm

$100 USD trong 1 ngày
(15 Nhận xét)
3.9
vtatarenko

Hi there. I am suitable to this project. Please say me what is the due date. And what price is convinient to you? Regards, Valentin

$155 USD trong 3 ngày
(10 Nhận xét)
3.3
ExperSolutions

'We are team of excellent developers and writers. We have 2 year experience related to your project field. We can do your project and solve your all problems according to your requirements. We have read your descriptio Thêm

$45 USD trong 3 ngày
(5 Nhận xét)
2.8
$155 USD trong 3 ngày
(1 Nhận xét)
2.4
$155 USD trong 3 ngày
(1 Nhận xét)
1.7
Avinavkr

hello i am full time freelancer having more than 6 years of experience in web development please share some information about your requirement. without knowing your requirement i can not provide you the right q Thêm

$175 USD trong 2 ngày
(0 Nhận xét)
0.0
itssdigital

hi I'm C++ Developer I have seen your requirements I can make this struct code to classes i will object oriented programming techniques it can be done easily hope to hear from you.

$40 USD trong 2 ngày
(0 Nhận xét)
0.0