Question
***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.
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 continueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started