Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***Please put comments and try to make it as simple as possible. Will give good ratings. Thank you*** Instructions: Write a C++ program that will

***Please put comments and try to make it as simple as possible. Will give good ratings. Thank you***

Instructions: Write a C++ program that will input from the console screen:

1. A whole number

2. A unit of measurement from the following set: {TB, GB, MB, KB, B}

The program will output the equivalent number of bits. Allow users to continue to input until they indicate that they want to stop.

image text in transcribed

Notes:

1. A blank space will separate the whole number from the unit of measurement.

2. If the user does not input an appropriate unit of measurement:

a. Output an error message.

b. Allow the user to re-input

3. For this exercise assume that the base is 1024 (not 1000). Kilobyte Reference:

Sample Run: Input a whole number followed by a unit of measurement (TB, GB, MB, KB, B) Example: 1 KB 1 kb Input a valid whole number and unit of measurement Input a whole number followed by a unit of measurement (TB, GB, MB, KB, B) Example: 1 KB 2 KB 16384 b Do wish to do another conuersion? Type Y or y to continue. Input a whole number followed by a unit of measurement (TB, GB, MB, KB, B) Example: 1 KB 1 TB 8796093022208 b Do wish to do another conuersion? Type Y or y to continue. Press any key to continue

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

Mysql Examples Explanations Explain Examples

Authors: Harry Baker ,Ray Yao

1st Edition

B0CQK9RN2J, 979-8872176237

More Books

Students also viewed these Databases questions