Question
Please solve using C++ program step by step code and attach a screenshot for the sample run 1. Your friend is suspicious that the hard
Please solve using C++ program step by step code and attach a screenshot for the sample run
1. Your friend is suspicious that the hard drive he just bought for his computer said 1EB on the box, but when he plugged it into his computer the operating system says it only has 931PB of space. That's because hard drive marketing uses base-10 to calculate space, but computer science (and operating systems) use base-2 (and always have). So, using base-10, 1 Exabyte (EB) would be 1018 (1,000,000,000,000,000,000) bytes, but in base-2 it would be 260 (1,152,921,504,606,846,976) bytes. Most humans use base-10 when counting, so there thats the confusion. Write a program that will take storage space given in base-10 and convert it to base-2 Input from the keyboard the computer hard drive size as a whole integer, a space, then a 2-letter size code reported in base-10 SI units from the marketing text on the box. Output to the screen the converted size given in base-10 to base-2 units which will be reported in the operating system, rounded to the nearest 2 decimal places in the largest binary size you can express a whole number in (For example, do not write 1030 MiB, write 1.01 GiB). Finally, ask the user if he/she wishes to run the program again (check case). Refer to the sample output below.
Sample Run
: Enter the hard drive size: 1 TB
The corresponding binary drive size: 931.32 GiB Run again (Y/N): y Enter the hard drive size: 752 MB The corresponding binary drive size: 717.16 MiB Run again (Y/N): N
Step 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