Find Jobs
Hire Freelancers

Binary conversion

$30-50 USD

Cerrado
Publicado hace más de 21 años

$30-50 USD

Pagado a la entrega
Write a C++ program that reads characters representing binary (base-2) numbers from a data file ( [login to view URL] ) and translates them to decimal (base-10) numbers. The binary and decimal numbers should be output to the screen as well as to a file [login to view URL] in two columns with appropriate heading. ## Deliverables 1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. 2) Installation package that will install the software (in ready-to-run condition) on the platform(s) specified in this bid request. 3) Complete ownership and distribution copyrights to all work purchased. Program 3 Write a C++ program that reads characters representing binary (base-2) numbers from a data file ( [login to view URL] ) and translates them to decimal (base-10) numbers. The binary and decimal numbers should be output to the screen as well as to a file [login to view URL] in two columns with appropriate headings. Here is a sample output file: Binary Number Decimal Equivalent 1 1 10 2 11 3 10000 16 10101 21 There is only one binary number per input line, but an arbitrary number of blanks can precede the number. The program must read binary numbers one character at a time. As each character is read, the program multiplies the total decimal value (which begins at 0) by 2 and and adds either 1 or 0 depending upon the input character. The program should check for bad data; if it encounters anything except a 0 or 1, it should output the message "Bad digit on input" and proceed to the next binary number. Use a function to convert Binary to Decimal. The function should read in a binary number (from a single line in the file) and return its decimal equivalent. In addition, the function should accept a reference parameter of type string, which is modified to reflect the binary number read in. The function prototype should be: int binToDec(string &binary); For example, when the fuction is called the very first time, it returns the integer 43 and the reference parameter binary contains 101011 (see the file [login to view URL]) Your program will be graded on the following: Accuracy (does it produce desired output?) User-friendliness (are you printing out legible messages and prompts?) Program Style - comments, indentation, named constants What you need to turn in: A printout of the source file, a printout of the output, and a printout of the file results.txt. Include the name of each file in your turn-in. ## Platform This C++ program needs to run through Unix
ID del proyecto: 2882508

Información sobre el proyecto

46 propuestas
Proyecto remoto
Activo hace 21 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
46 freelancers están ofertando un promedio de $20 USD por este trabajo
Avatar del usuario
See private message.
$36,55 USD en 14 días
4,9 (124 comentarios)
8,2
8,2
Avatar del usuario
See private message.
$25,50 USD en 14 días
4,8 (29 comentarios)
6,4
6,4
Avatar del usuario
See private message.
$17 USD en 14 días
4,9 (175 comentarios)
5,9
5,9
Avatar del usuario
See private message.
$21,25 USD en 14 días
5,0 (22 comentarios)
5,4
5,4
Avatar del usuario
See private message.
$21,25 USD en 14 días
5,0 (18 comentarios)
5,4
5,4
Avatar del usuario
See private message.
$21,25 USD en 14 días
5,0 (53 comentarios)
5,4
5,4
Avatar del usuario
See private message.
$25,50 USD en 14 días
5,0 (55 comentarios)
5,2
5,2
Avatar del usuario
See private message.
$8,50 USD en 14 días
5,0 (12 comentarios)
5,1
5,1
Avatar del usuario
See private message.
$8,50 USD en 14 días
5,0 (19 comentarios)
4,9
4,9
Avatar del usuario
See private message.
$34 USD en 14 días
5,0 (43 comentarios)
4,8
4,8
Avatar del usuario
See private message.
$8,50 USD en 14 días
4,9 (68 comentarios)
4,8
4,8
Avatar del usuario
See private message.
$29,75 USD en 14 días
4,7 (41 comentarios)
4,7
4,7
Avatar del usuario
See private message.
$22,95 USD en 14 días
4,9 (79 comentarios)
4,7
4,7
Avatar del usuario
See private message.
$21,25 USD en 14 días
4,1 (54 comentarios)
4,8
4,8
Avatar del usuario
See private message.
$11,05 USD en 14 días
5,0 (47 comentarios)
4,5
4,5
Avatar del usuario
See private message.
$15,30 USD en 14 días
4,6 (60 comentarios)
4,5
4,5
Avatar del usuario
See private message.
$22,95 USD en 14 días
4,8 (34 comentarios)
4,4
4,4
Avatar del usuario
See private message.
$3,40 USD en 14 días
4,2 (111 comentarios)
4,4
4,4
Avatar del usuario
See private message.
$17 USD en 14 días
4,5 (33 comentarios)
4,2
4,2
Avatar del usuario
See private message.
$8,50 USD en 14 días
4,8 (27 comentarios)
3,7
3,7

Sobre este cliente

Bandera de UNITED STATES
United States
0,0
0
Miembro desde nov 8, 2002

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.