Find Jobs
Hire Freelancers

C Programming Assignment 2

$10-30 CAD

Completed
Posted about 8 years ago

$10-30 CAD

Paid on delivery
FRACTION SIMPLIFIER The following fraction simplifier program accepts a fraction, simplifies it, and then displays the result. Your task is to complete this program. Your solution declares a Fraction type, which holds the numerator and denominator as separate members and includes the definitions of three functions with the following prototypes • void enter(struct Fraction*); • void simplify(struct Fraction*); • void display(const struct Fraction*); Complete the following program by adding the missing code: // Fraction Simplifier // w9.c #include <stdio.h> // insert Fraction declaration first // insert function prototypes here int main(void) { struct Fraction f; printf("Fraction Simplifier\n"); printf("===================\n"); enter(&f); simplify(&f); display(&f); } // insert your function definitions here The output from your completed program looks something like Fraction Simplifier =================== Numerator: 4 Denominator: 16 1 / 4 Your enter() function receives the address of a Fraction object, accepts from the user the numerator and denominator and stores those values in the object's members. Your simplify() function receives the address of a Fraction object and reduces the numerator and denominator, if possible. For a complete solution you need to design an algorithm that simplifies a fraction. Your display() function receives the address of a Fraction object and displays the object's numerator and denominator. Test several fractions to ensure that your algorithm works for all cases. Include negative as well as zero values in your test cases. Done ////////////////////// Second job attached as word document.
Project ID: 9965749

About the project

2 proposals
Remote project
Active 8 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
Awarded to:
User Avatar
$25 CAD in 2 days
5.0 (4 reviews)
1.5
1.5

About the client

Flag of CANADA
Hamilton, Canada
5.0
27
Payment method verified
Member since Feb 22, 2016

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) & Freelancer Online India Private Limited (CIN U93000HR2011FTC043854)
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.