1. Engineering
  2. Computer Science
  3. instructions write a c program that will input from the...

Question: instructions write a c program that will input from the...

Question details

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:
  1. Output an error message.
  2. Allow the user to re-input
  3. For this exercise assume that the base is 1024 (not 1000). Kilobyte Reference: https://en.wikipedia.org/wiki/Kilobyte
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution