Find Jobs
Hire Freelancers

Binary conversion

$30-50 USD

Closed
Posted over 21 years ago

$30-50 USD

Paid on delivery
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
Project ID: 2882508

About the project

46 proposals
Remote project
Active 21 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
46 freelancers are bidding on average $20 USD for this job
User Avatar
See private message.
$36.55 USD in 14 days
4.9 (124 reviews)
8.2
8.2
User Avatar
See private message.
$25.50 USD in 14 days
4.8 (29 reviews)
6.4
6.4
User Avatar
See private message.
$17 USD in 14 days
4.9 (175 reviews)
5.9
5.9
User Avatar
See private message.
$21.25 USD in 14 days
5.0 (22 reviews)
5.4
5.4
User Avatar
See private message.
$21.25 USD in 14 days
5.0 (18 reviews)
5.4
5.4
User Avatar
See private message.
$21.25 USD in 14 days
5.0 (53 reviews)
5.4
5.4
User Avatar
See private message.
$25.50 USD in 14 days
5.0 (55 reviews)
5.2
5.2
User Avatar
See private message.
$8.50 USD in 14 days
5.0 (12 reviews)
5.1
5.1
User Avatar
See private message.
$8.50 USD in 14 days
5.0 (19 reviews)
4.9
4.9
User Avatar
See private message.
$34 USD in 14 days
5.0 (43 reviews)
4.8
4.8
User Avatar
See private message.
$8.50 USD in 14 days
4.9 (68 reviews)
4.8
4.8
User Avatar
See private message.
$29.75 USD in 14 days
4.7 (41 reviews)
4.7
4.7
User Avatar
See private message.
$22.95 USD in 14 days
4.9 (79 reviews)
4.7
4.7
User Avatar
See private message.
$21.25 USD in 14 days
4.1 (54 reviews)
4.8
4.8
User Avatar
See private message.
$11.05 USD in 14 days
5.0 (47 reviews)
4.5
4.5
User Avatar
See private message.
$15.30 USD in 14 days
4.6 (60 reviews)
4.5
4.5
User Avatar
See private message.
$22.95 USD in 14 days
4.8 (34 reviews)
4.4
4.4
User Avatar
See private message.
$3.40 USD in 14 days
4.2 (111 reviews)
4.4
4.4
User Avatar
See private message.
$17 USD in 14 days
4.5 (33 reviews)
4.2
4.2
User Avatar
See private message.
$8.50 USD in 14 days
4.8 (27 reviews)
3.7
3.7

About the client

Flag of UNITED STATES
United States
0.0
0
Member since Nov 8, 2002

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.