Find Jobs
Hire Freelancers

Continued Fraction C++ program

€8-30 EUR

En curso
Publicado hace más de 5 años

€8-30 EUR

Pagado a la entrega
i wanna a program that execute a regular continued fraction for any real valued number x is defined by the formula above and can be written in a short form with squared brackets x=[f0;f1,f2,f3,…]. Task is to represent this short form for continued fractions inside a computer by lists of integer numbers, to input, calculate and also delete them; no global variables shall be defined and used. the code must be as the following steps :- 1- Define a structure for above list elements to implement continued fraction by lists with these elements. 2- Define a function with a continued fraction cf=[f0;f1,f2,f3,…,fk] as pointer/list as first and a natural/integer number fk+1 as second parameter extending the continuous fraction to cf=[f0;f1,f2,f3,…,fk,fk+1], i.e. appending a further element with value fk+1 at the end of the list. Return the extended continued fraction/the resulting list as function value. 3- Define a function with a continued fraction as pointer parameter deleting the complete list, freeing the memory of all list elements on the heap. Output like in the examples below all deleted values fk to check your function. 4-Define a function with a continued fraction as pointer parameter returning its value as a double coded floating point value. Hint: a recursive solution is especially appropriate and short in this case. 5 - Write a function without parameter, first reading f0∈Z, then in a loop the values fk∈N, k=1,2,…, successively constructing the continued fraction as list and return it. 6 - Write a main function and define three pointer variables for continued fractions. Initialise the first above example cf1=123100=[1;4,2,1,7] and the second cf2=1710=[1;1,2,3] by appropriate nested functions calls directly in code. Input the third continued fraction cf3 by giving a function call to above defined function (task 5). For all three continued fractions output its floating point values calculated by respectively given function calls (task 4) with at least 15 digits after the decimal point and then delete the memory in heap for the continued fractions/lists also by appropriate function calls (task 3; see also examples below). Test your program at least for inputs 1=[1], 2=[1;1], 0.5=[0;2], 2–√≈[1;2,2,2,2,…] and π≈[3;7,15,1,292,1,1,1,2,1,3,1,…], find further examples here. ps: Only use C++ input and output, no calls of scanf or printf function or malloc, calloc, ... or free! don't include any libraries more than <iostream> .
ID del proyecto: 18174580

Información sobre el proyecto

2 propuestas
Proyecto remoto
Activo hace 5 años

¿Buscas ganar dinero?

Beneficios de presentar ofertas en Freelancer

Fija tu plazo y presupuesto
Cobra por tu trabajo
Describe tu propuesta
Es gratis registrarse y presentar ofertas en los trabajos
2 freelancers están ofertando un promedio de €34 EUR por este trabajo
Avatar del usuario
I'm good in math, will do it in 1 day ************************************ ************************************
€29 EUR en 1 día
0,0 (0 comentarios)
0,0
0,0

Sobre este cliente

Bandera de GERMANY
duisburg, Germany
5,0
1
Forma de pago verificada
Miembro desde nov 16, 2018

Verificación del cliente

¡Gracias! Te hemos enviado un enlace para reclamar tu crédito gratuito.
Algo salió mal al enviar tu correo electrónico. Por favor, intenta de nuevo.
Usuarios registrados Total de empleos 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)
Cargando visualización previa
Permiso concedido para Geolocalización.
Tu sesión de acceso ha expirado y has sido desconectado. Por favor, inica sesión nuevamente.