Answer to Question #222172 in C++ for save

Question #222172

A manufacturer uses 1000 bytes as the value of 1K bytes, 1000K bytes as the value of 1MB, 1000MB as the value of 1GB. However, in computer memory, 1KB is equal to 1024 bytes. So the actual storage on a 40GB hard drive is approximately 37.25GB. Write a program that prompts the user to enter the size of the hard drive specified by the manufacturer, on the hard drive box, and outputs the actual storage capacity of the hard drive.

Input

User will need to input the hard drive size in gigabytes. Input the size after the text "Enter hard drive size in giga bytes: ".

Output

The output will be the hard drive size and the actual hard drive storage capacity. The program shall output the hard drive size inputted by the user after the "Hard drive size = ". It'll be followed by the string "Actual hard drive storage capacity = " and the actual hard drive storage capacity computed.


Sample Output

Hard drive size = 704 GB

Actual hard drive storage capacity = 655.651 GB


1
Expert's answer
2021-08-01T00:29:38-0400
#include <iostream>


using namespace std;


int main(){
    double driveInGB;
    
    cout << "Enter hard drive size in giga bytes: "; //Instruction given in the question
    cin >> driveInGB;
    cout<<"Hard drive size = "<<driveInGB<<endl;  //given in the instruction
    cout<<"Actual hard drive storage capacity = "<<( driveInGB * 37.25) / 40<<endl;
    
  
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS