Em Andamento

Help with my C++ homework!

Here is what i need:

Design, code and execute a user-defined class representing rational numbers and their manipulation. Rational numbers, or fractions, consist of a whole number, a numerator, and a denominator, i.e.: 36 5/8. The class interface will be in a header file, the class implementation and the code for the main program will be in two seperate .cpp files. These file will be linked together as one executable file and then run by the CPU. A vector from the STL will be used in the program as a container for objects instead of a standard array.

**_Methods_:**

A default constructor that sets the default fraction values to 0,0,1

A 3 argument constructor that accepts and processes integer values for w, n, d.

A one argument constructor that converts its double argument to a fraction in rational form i.e.: [url removed, login to view] converts to 62 3/4

An output method that displays fractions in the standard form w n/d

An input method that read data into three data members of an object

**operator = ** assignment, a shallow copy of the 3 data members

**operator <<** insertion of a rational object into the output stream

**operator >>** extraction of a rational object from the input stream

**operator +** addition of two rational objects

**operator +=** accumulation of all rational objects

**operator ==** test two rational objects for equality

## Deliverables

Design, code and execute a user-defined class representing rational numbers and their manipulation. Rational numbers, or fractions, consist of a whole number, a numerator, and a denominator, i.e.: 36 5/8. The class interface will be in a header file, the class implementation and the code for the main program will be in two seperate .cpp files. These file will be linked together as one executable file and then run by the CPU. A vector from the STL will be used in the program as a container for objects instead of a standard array.

**Must use test data provided.

Must have seperate class interfacein a header file, and implementation and code must be in two seperate .cpp files

I want all source files and executable files.

Must do everything provided in Methods and Program.**

**_Methods_:**

A default constructor that sets the default fraction values to 0,0,1

A 3 argument constructor that accepts and processes integer values for w, n, d.

A one argument constructor that converts its double argument to a fraction in rational form i.e.: [url removed, login to view] converts to 62 3/4

An output method that displays fractions in the standard form w n/d

An input method that read data into three data members of an object

**operator = ** assignment, a shallow copy of the 3 data members

**operator <<** insertion of a rational object into the output stream

**operator >>** extraction of a rational object from the input stream

**operator +** addition of two rational objects

**operator +=** accumulation of all rational objects

**operator ==** test two rational objects for equality

**_Program:

_** Declare a vector of 20 rational number objects using the vector object from the STL.

Demonstrate assignment of objects using **operator =.

**Input rational data into the vector objects using **operator >>** (see test data).

Display rational numbers in standard form using **operator <<.

**Add up adjacent fractions in the vecctor using **operator +,** reducing answers to lowest terms.

Accumulate all fractions in the vector using **operator +=**, reducing answers to lowest terms.

Tes adjacent fractions in the vector for non-equality using **operator ==**.

_**Test Data:

W:**_ **_N:_** **_D:

_**3 4 5

66 3 8

9 1 4

13 3 4

15 3 5

29 5 6

74 5 8

4 3 7

80 1 6

80 1 6

8 8 9

52 4 5

34 0 1

2 2 5

90 5 8

10 1 3

51 17 36

78 19 36

37 3 8

## Platform

Windows 98, 2000, XP

Microsoft Visual C++

Habilidades: .NET, Programação C, Programação C#, Cocoa, Engenharia, Java, MySQL, PHP, Arquitetura de software, Teste de Software, Visual Basic

Ver mais: vector stl, vector members, vector cpp, vector container, using stl vector, using stl, the stl, stream programming, stl vector copy, stl vector, stl standard, stl programming, stl cpp, stl data, stl copy, stl container, stl code, stl c, stl array, stl 2, standard vector, standard stl, read vector, programming cpp, programming vector

Acerca do Empregador:
( 3 comentários ) United States

ID do Projeto: #3029200

Premiar a:

lmxvw

See private message.

$18.7 USD em 5 dias
(126 Avaliações)
4.7

6 freelancers estão ofertando em média $15 para este trabalho

bahe

See private message.

$12.75 USD in 5 dias
(147 Comentários)
6.5
zeegaal

See private message.

$12.75 USD in 5 dias
(59 Comentários)
5.1
senzaciosnegyes

See private message.

$21.25 USD in 5 dias
(104 Comentários)
4.9
Gr8Coders

See private message.

$14.45 USD in 5 dias
(52 Comentários)
4.9
costelus

See private message.

$11.05 USD in 5 dias
(20 Comentários)
2.8