Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You need three files Winput file //command line file .cpp l/output file *linux compiler /*program will read from an input file perform conversion and then

image text in transcribed
image text in transcribed
You need three files Winput file //command line file .cpp l/output file *linux compiler /*program will read from an input file perform conversion and then print in an output file*/ Write a C++ that converts a rational, decimal number to a corresponding value in a foreign base. A foreign base, is constrained to the range 2SS36 Th e program should only cover the basic things we have covered in class. i.e only chapter one and two of the computer organization one class. So use the basic divide and multiplicand to do conversion I/po1.cpp p01.cpp contains functions that process command line arguments and direct the process of reading printing original input values together with corresponding output values Project 1 can be invoked with zero, one, or two program parameters. The 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 , converting, and Enter the input file name: i01.dat Enter the output file name: o01.dat S p01 i01.dat Enter the output file name: 001.dat /input file 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 where 2-f-36 As an example, consider the following pairs: 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

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

Filing And Computer Database Projects

Authors: Jeffrey Stewart

2nd Edition

007822781X, 9780078227813

More Books

Students also viewed these Databases questions