Develop a C (or C++) program

Develop a C (or C++) program that reads an unsigned number in some base and outputs the

equivalent value in BCD.

Don't use plagiarized sources. Get Your Custom Essay on
Develop a C (or C++) program
GET AN ESSAY WRITTEN FOR YOU FROM AS LOW AS $13/PAGE
Order Essay

Your program must require a single command line argument, the name of an input file. This

input file will consist of any number of lines, each falling into one of three varieties:

1. Comment – These lines always start with an asterisk (‘*’) and should be completely

ignored.

2. Blank line – Used to visually organize the input file and should be completely ignored.

3. Data line – These are the ones your program will process and are described below.

Data lines will all have exactly two items separated by a single space character:

1. an input base (2 through 16) and

2. an input value in that base whose decimal equivalent will never be more than 6 digits

For each Data line from the input file, you must output:

1. the line number of the input file this data line is on (starting the file with line 1… same as

a text editor would show)

2. a colon followed by a space

3. the BCD equivalent of the input value , four bits at a time with one space between each

set of bits. Remember the decimal values will not exceed 6 digits, so the BCD value will

never exceed 24 bits, not including whitespace between 4-bit sets. NEVER print any

leading bit sets that contain only zeros…

a. eg, instead of 0000 0101 0000 1000, you would print 0101 0000 1000

b. only exception is if the value itself is zero, as in the example below

Example input file Expected output to console

* a first example

2 011000

8 70

7 0

11 3A

* This is long

10 123456

 

Results

2: 0010 0100

4: 0101 0110

5: 0000

6: 0100 0011

9: 0001 0010 0011 0100 0101 0110

Grand Paper Writers
Order NOW For A 10% Discount!
Pages (550 words)
Approximate price: -

Our Advantages

Plagiarism Free Papers

All papers are written by the best professional writers to ensure 100% originality. We always provide plagiarism reports whenever we deliver completed papers.

Free Revisions

All papers by Grand Paper Writers are completed and submitted on time. This timely delivery of papers gives you time to go through the paper before the official deadline.

Title-page

As an additional service, we will provide a title page that precedes the contents of your paper. Here, you will provide your personal details.

Bibliography

We also ensure that we provide an extra page for the references or bibliographies following referencing rules.

Originality & Security

At Grandpaperwriters.com, we guarantee students for the provision of security and original work. All your personal information is handled with confidentiality and is not shared with third parties. Additionally, we ensure that we provide original content with accompanying plagiarism reports to show originality.

24/7 Customer Support

Our customer support team is always available 24/7 to provide instant responses to any queries raised by students.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:
$0.00

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Grandpaperwriters.com has the best professional essay writers for quality services.

Pricing

Flexible Pricing

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Communication

Admission Help & Client-Writer Contact

Grandpaperwriters.com provides an interactive portal where students can communicate directly to their writers.

Deadlines

Paper Submission

Here, a Grandpaperwriters.com, we do not compromise on the time of our clients. We always deliver all completed papers on or before the deadlines.

Reviews

Customer Feedback

Grandpaperwriters.com appreciates feedback from our clients to help us improve the delivery of essay writing services. As such, we are constantly changing our policies to ensure maximum customer and writer satisfaction.