convert C code to C++

Concluído Postado há 7 anos Pago na entrega
Concluído Pago na entrega

I have some code written in C, its need to be converted to C++.

#include <stdio.h> //declares printf()

//differential equation that models the parachutist problem

double dydt( double t, double y) /* dy/dt = g - c/m * y (page 14) */

{

const double g = 9.81, m = 68.1, c = 12.5;

return g - c/m * y;

}

//generic euler's method to solve dy( t, y) equation

double euler( double dt, double ti, double tf, double yi)

{

double t = ti;

double y = yi;

double h = dt;

do {

if (t + dt > tf)

h = tf - t;

printf("%.4f\t%.4f\n", y, t); //display y, v values

y = y + dydt( t, y) * h;

t = t + h;

} while (t < tf);

return y;

}

//program starts here

int main()

{

double ti = 0, tf = 36, yi = 0, dt = 2;

//display table header for velocity and time

printf("v (m/s)\tt (s)\n");

//run euler's method to solve parachutist

double y = euler( dt, ti, tf, yi);

printf("\nfinal y = %.4f (m/s)\n", y);

return 0;

}

Coding PHP Arquitetura de software Desenvolvimento de Software Tradução

ID do Projeto: #11559874

Sobre o projeto

8 propostas Projeto remoto Ativo em há 7 anos

Concedido a:

hectorenavarrou

Hi, I have more than 20 years programming in both C and C++, I am sure I can do this project quickly

$15 USD em 1 dia
(46 Comentários)
5.2

8 freelancers estão ofertando em média $22 nesse trabalho

KulfiSoftwares

ZERO ERROR GUARANTEED!! Please read my reviews. Hi, I can do this for you quickly and with great quality for cheap...Based in Nepal we provide quality work, and 100% satisfaction guarantee..We are not satisfied wit Mais

$30 USD em 1 dia
(49 Comentários)
5.5
kjgroup197318

-----------------------------------------------------------------Nice Job! No Problem!-------------------------------------------------------------

$50 USD em 1 dia
(19 Comentários)
5.6
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 Mais

$30 USD in 0 dias
(21 Comentários)
4.2
digitallancing

my whatsapp +923245064589................................................................................................

$25 USD em 1 dia
(2 Comentários)
2.4
raulbehl

Hello

$20 USD em 1 dia
(4 Comentários)
2.0
BigShark0810

I have developed c, c++ programs for a long time. I can do it this time. If you want, please let me know. Thank you.

$25 USD em 1 dia
(1 Comentário)
1.5
Creators31

I am familiar with bot C and C++ and can do this. looking forward to working on this.........................

$15 USD em 1 dia
(3 Comentários)
0.9
ExperSolutions

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 Mais

$20 USD em 1 dia
(0 Comentários)
0.0