Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey there, just needed help to write a simple program that uses division and multiplication for base conversion. Please help Decimal to Foreign Base Project

Hey there, just needed help to write a simple program that uses division and multiplication for base conversion.
Please help
image text in transcribed
Decimal to Foreign Base Project po1 Computer Organization I CMSC 2833 Project: Program Files: Program p01 converts a rational, decimal number to a corresponding value in a foreign base. A foreign base, f is constrained to the range 2 s f s 36 Project 1 consists of file po1.cpp Description File p01.cpp contains functions that process command line arguments and direct the process of reading, converting and printing original input values together with corresponding output values Project files must be stored in the root directory of your student account. Failure to store project files in the root directory of your student account will result in a score of zero (o) for this project. Project 1 can be invoked with zero, one, or two program parameters. I first program parameter is the input file name. The second parameter is the output file name. Sample command lines together with corresponding actions by program p01 are shown below. Boldfaced type indicates data entered at the keyboard by the user S p01 Enter the input file name: i01.dat Enter the output file name: o01.dat Project file directory Command Line: $ po1 i01.dat Enter the output file name: 001.dat S p01 i01.dat o01.dat The input file contains pairs on separate lines. The first value in the pair is a rational, decimal number. The second value in the pair is an integer specifying the foreign base f,where 2sf s36. As an example, consider the following pairs: Input File 10.375 2 10.375 16 Output File Specification: One line is printed for each pair in the input file. Three values are printed on a line. The first two values are the values read from the input file. The last value is the decimal equivalent of the input values Each line is formatted. A single space is printed between each of the three values printed. The first value, a floating-point value, is printed right- justified in a field of twenty (20) spaces in fixed format. The next value, an integer, is printed right-justified in a field of two (2) spaces. The last value, a string, is printed right-justified in a field of twenty (20) spaces. Four factional digits are printed in the converted value Example: 10.37500000 2 11181.50000000 16 1010.0110 2bad.8000

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Building Database Driven Catalogs

Authors: Sherif Danish

1st Edition

0070153078, 978-0070153073

More Books

Students also viewed these Databases questions

Question

8. Describe the steps in the development planning process.

Answered: 1 week ago