Question: Write a C++ program that will display total number of bytes for 1 kB, 1 MB, 1 GB, 1 TB, 1 PB, and 1 EB

Write a C++ program that will display total number of bytes for 1 kB, 1 MB, 1 GB, 1 TB, 1 PB, and 1 EB in a formatted table. The table should include both a header and a footer (use the character of your choice: =, -, *, etc.). The first column should display the full name (e.g. kilobyte). The second column should display the abbreviation (e.g. kB). The third column should display the number of bytes in scientific notation, with no decimals (e.g. 1e+003). The fourth column should display the total (whole) number of bytes (e.g. 1024). All columns should be neatly aligned, with at least three spaces between columns. CALCULATIONS: kB = 1024 * B MB = 1024 * kB GB = 1024 * MB TB = 1024 * GB PB = 1024 * TB EB = 1024 * PB Compile, run, and debug your program until you get similar output. EXAMPLE OUTPUT: ================================================== kilobyte kB 1e+003 1024 megabyte MB 1e+006 1048576 gigabyte GB 1e+009 1073741824 terabyte TB 1e+012 1099511627776 petabyte PB 1e+015 1125899906842624 exabyte EB 1e+018 1152921504606846976 ==================================================

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!