convert C code to C++

Completado Publicado hace 7 años Pagado a la entrega
Completado Pagado a la 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;

}

Desarrollo PHP Arquitectura de software Desarrollo de software Traducción

Nº del proyecto: #11559874

Sobre el proyecto

8 propuestas Proyecto remoto Activo hace 7 años

Adjudicado 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 en 1 día
(46 comentarios)
5.2

8 freelancers están ofertando un promedio de $22 por este trabajo

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 Más

$30 USD en 1 día
(49 comentarios)
5.5
kjgroup197318

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

$50 USD en 1 día
(19 comentarios)
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 Más

$30 USD en 0 días
(21 comentarios)
4.2
digitallancing

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

$25 USD en 1 día
(2 comentarios)
2.4
raulbehl

Hello

$20 USD en 1 día
(4 comentarios)
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 en 1 día
(1 comentario)
1.5
Creators31

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

$15 USD en 1 día
(3 comentarios)
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 Más

$20 USD en 1 día
(0 comentarios)
0.0