Find Jobs
Hire Freelancers

182634 project for superyetkin

N/A

Em Andamento
Publicado há mais de 16 anos

N/A

Pago na entrega
The assignment is for Programming Project 5 in Chapter 11. Please remember this is an Intro C++ Class If you feel you want the entire text of the book I can send it to you if you would like. The following is something provided by my instructor that you will need to use. You may use the following functions to normalize a rational number. They should be included as private utilities. The normalize() function should be called by all member functions before returning. int gcd(int a, int b); // Precondition: None. // Postcondition: The GCD (greatest common // divisor) of a and b is returned. void normalize(int& n, int& d); // Precondition: n and d represent the // numerntor and denominator of a // rational number and d != 0. // Postcondition: n and d are normalized. // If the ratio is negative, the numerator // carries the negntive sign. If the ratio // is positive, both numbers are positive. // The ratio is reduced by the GCD. The // arguments are passed by reference. int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); } void normalize(int& n, int& d) { if (d == 0) exit(1); if ( (n >= 0 && d < 0) || (n < 0 && d < 0) ) { n = -n; d = -d; } int g = gcd(n, d); g = (g >= 0) ? g : -g; n /= g; d /= g; }
ID do Projeto: 1928841

Sobre o projeto

Projeto remoto
Ativo há 12 anos

Quer ganhar algum dinheiro?

Benefícios de ofertar no Freelancer

Defina seu orçamento e seu prazo
Seja pago pelo seu trabalho
Descreva sua proposta
É grátis para se inscrever e fazer ofertas em trabalhos

Sobre o cliente

Bandeira do(a)
5,0
6
Membro desde nov. 7, 2007

Verificação do Cliente

Obrigado! Te enviamos um link por e-mail para que você possa reivindicar seu crédito gratuito.
Algo deu errado ao enviar seu e-mail. Por favor, tente novamente.
Usuários Registrados Total de Trabalhos Publicados
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Carregando pré-visualização
Permissão concedida para Geolocalização.
Sua sessão expirou e você foi desconectado. Por favor, faça login novamente.