Due: Friday

Points: 35

Program 1 – (15 points)

Create a method called GreatestCommonDivisor that uses Euclid’s algorithm as defined in this video

https://www.youtube.com/watch?v=fwuj4yzoX1o. Do not search for C# versions of the algorithm on the Web or in textbooks –everything you need is explained in the video and there should be no need for any additional “research.”

Your method signature should look like this:

int GreatestCommonDivisor(int a, int b)

Create a test program that demonstrates the following

GreatestCommonDivisor(164, 410) = 82

GreatestCommonDivisor(87801, 1469) = 113

Program 2 – (20 points)

Create a fractions class that represents fractions in the form a/b Your class should implement the following members:

int Numerator

int Denominator

Fraction(int numerator, int denominator) ­ creates a new Fraction

double ToDecimal() ­ returns the fraction as a double

Fraction Add(Fraction f) ­ adds the fraction to the one passed in and simplifies the result

Fraction Multiply(Fraction f) ­ multiplies the fraction by the one passed in and simplifies the result

Fraction Simplify() ­ simplifies the fraction using the GreatestCommonDivisor method from the first Exercise

Create a test program that demonstrates the following:

1/2 = 0.5

1/7 + 1/5 = 12/35

1/4 * 2/3 * 4/5 = 2/15

Create a test program that demonstrates the following: 1/2 = 0.5 1/7 + 1/5 = 12/35 1/4 * 2/3 * 4/5 = 2/15
Order Now on customessaymasters.com

Testimonials

Subject: Marketing

Thank you very much, Great job! On time delivery! 

Victoria, ~ Sydney, AU.

Subject: Management

Well done, I got an A and I am so happy! Thanks alot! 

J. Williams ~ London, UK

Subject: Sociology

Excellent work and timely delivery! I won't hesitate to order again and I highly recommend. 

Jeniffer ~ New York, USA.

Subject: Nursing

The quality of my research paper was outstanding and the writer was very cooperative.

Rachel, A. ~ Australia
CLICK TO ORDER NOW