Purchase Solution

C++ program to do base conversion

Not what you're looking for?

Ask Custom Question

I am trying to write a C++ program that will convert any base 10 number v to any base b. It reads in two values at a time, from a file, the first is the base 10 number and the second value is the base that the base 10 number v is to be converted to, and then it prints the results to an output file. The base can only be between 2 and 9, and any invalid input should be flagged as invalid.

I am trying to write the code as a function to be called in from the main function, so there is little code in the main.

Attached Word file (named as "Base Conversion File.dat") gives the data to be used as input.

Purchase this Solution

Solution Summary

Program makes use of macros INPUT_FILE_NAME and OUTPUT_FILE_NAME to refer to input and output files respectively.

Solution Preview

Please find attached an implementation 371335.cpp that has been tested for warning free compilation, using "g++ -Wall 371335.cpp", and correct working, using ...

Purchase this Solution


Free BrainMass Quizzes
Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.