Question

C++ program to list all the drives( C:\ , D:\ , etc). Should be numbered. Output:...

C++ program to list all the drives( C:\ , D:\ , etc). Should be numbered.
Output:
1. C: Storage 240gb
2. D: Storage 8gb
( can give storage in MB)
Please use c++ and not C.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

ULARGE_INTEGER totalBytes;

::GetDiskFreeSpaceEx(_T("C:\\"), &totalBytes);

const LONGLONG bytesInKB = 1024;

double totalSpace = (double) (LONGLONG) totalBytes.QuadPart / bytesInKb;

Add a comment
Know the answer?
Add Answer to:
C++ program to list all the drives( C:\ , D:\ , etc). Should be numbered. Output:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Program is to be written In C++, The output should look like the screen shot. It...

    Program is to be written In C++, The output should look like the screen shot. It should allow the user to continue to ask the user to enter all employee ID's until done and then prompt the user to enter the hours and pay rate for each employee ID. Please help:( Can you please run the program to make sure the output is just like the screenshot please? It needs to have the output that is in the screenshot provided,...

  • C++ 1. Write a program to check if two values are equal. The output should give...

    C++ 1. Write a program to check if two values are equal. The output should give the response "Both a and b are the same" or "a and b are not the same". 2. Write a program to take a test score and determine the grade A is 90-100, B is 80-89, C is 70-79, D is 60-69, F is 60 or below. BONUS - check for input validation (score over 100 or under 0)

  • Write a C++ program to analyze a variety of triangles. The program should determine all angles...

    Write a C++ program to analyze a variety of triangles. The program should determine all angles and all sides for a triangle for three different options (give the user a menu of choices): 1) Given two sides and the angle between 2) Given two angles and one side 3) Given three sides More details for each option is provided below. Option 1: Given two sides and the angle between First check to be sure that the three values entered are...

  • Please use C++ and include source code and a picture of program output. You are required...

    Please use C++ and include source code and a picture of program output. You are required to write a C++ program that interactively reads three integers, adds the numbers, and prints the result. 1- The program should use a class and an object. 2- The program can use a public function such as int FindSum (int , int y, int z) to calculate the sum of the numbers. 3- The main function should read the numbers and passes them to...

  • C++ Programming question Problem: 5. Write a program that reads in a list of integers into...

    C++ Programming question Problem: 5. Write a program that reads in a list of integers into an array with base type int. Provide the facility to either read this array from the keyboard or from a file, at the user's option. If the user chooses file input, the program should request a file name. You may assume that there are fewer than 50 entries in the array. Your program determines how many entries there are. The output is to be...

  • Translate the following C++ program into MAL (MIPS Assembly Langage). Your solution should have all necessary...

    Translate the following C++ program into MAL (MIPS Assembly Langage). Your solution should have all necessary data allocations, input/output instructions etc, and must compile and run correctly in spim. Make sure your loops are efficient (i.e., they should not have unnecessary branches). Given: userInput is in $s0 and index is in $s1. (These variables should not be allocated in the .data section.) You may use any other $s? or $t? registers as temporaries. for (int index = 8; index >...

  • python language Problem Description: In this program we are going to explore a list or an...

    python language Problem Description: In this program we are going to explore a list or an array of integers using Python. Your program should read a set of integers from the user and store them in a list. Read numbers from the user until the user enters 0 to quit. Then store them in a list. Your program should them compute the sum of all the numbers in the list and output to the user. You will use lists and...

  • use Python IDEL Problem 4 Fix a program. This program should calculate the matrix addition (C...

    use Python IDEL Problem 4 Fix a program. This program should calculate the matrix addition (C - A+B, where each element of matrix C is equal to the sum of the elements of matrices A and B that have the same indexes cij - aij + bij). However it is incomplete: the range() function arguments, index values of nested lists A, B, and C, and two list statements are missing. Can you find them and fix the program? What is...

  • Write a java program implementing the Linked list. It should be on an small office who...

    Write a java program implementing the Linked list. It should be on an small office who has 5 employees. The program ask the user for ID, First name, Last name and what field the work in(eg: accounting, programmer, HR etc). Each employee (with all the information of that paticular employee) should be placed in one node in the program. The program should repeat and ask the user for all 5 employees information. Also when you display the Linked list it...

  • (C++ program) Write a game that uses linked list. There should be 20 nodes. You can...

    (C++ program) Write a game that uses linked list. There should be 20 nodes. You can change the struct to your preferences in order to make the game better. Make sure the user is not able to move to a NULL location. The story game should be rated PG-13. No bad words or gore.You can add special conditions to where the story will not progress unless you clear a certain obstacle in a different room, others did enemy encounters where...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT