Page 1 of 1

### refresher course in code

Posted: 16 Dec 2018, 05:55
well its been a long time since I wrote any amount of code due to my former job and raising a family so I guess Im going to take some classes in code again. c#, java, python. and maybe php for starters and more later ### Re: refresher course in code

Posted: 17 Dec 2018, 23:24 ### Re: refresher course in code

Posted: 01 Dec 2019, 04:59
heres a quick one in c++ it calculates the size of a hdd by the parameter you type in and displays the size in megabytes.
integers (a,b,c ) and it works  #include <iostream>
using namespace std;

int main()
{
int a = 35202;
int b = 16;
int c = 63;
int d = 512;
int e = 1024;
int f = 1024;
int sum = a * b * c * d / e / f;
// this is just a down and dirty hdd size calculator.

cout << sum;

return 0;
}

### Re: refresher course in code

Posted: 01 Dec 2019, 06:27
Is all Elliniká to me. ### Re: refresher course in code

Posted: 11 Dec 2019, 19:19
gnuuser wrote:heres a quick one in c++ it calculates the size of a hdd by the parameter you type in and displays the size in megabytes.
integers (a,b,c ) and it works  #include <iostream>
using namespace std;

int main()
{
int a = 35202;
int b = 16;
int c = 63;
int d = 512;
int e = 1024;
int f = 1024;
int sum = a * b * c * d / e / f;
// this is just a down and dirty hdd size calculator.

cout << sum;

return 0;
}

Can this be set somehow to display gigabytes?

### Re: refresher course in code

Posted: 20 Dec 2019, 03:11
after line int f add line with int g = 1000;
int sum = a * b * c * d / e / f / g; ( the g has been added here)
and it should work
int a is the number of cylinders, int b is the number of heads, and int c is the number of sectors.

### Re: refresher course in code

Posted: 31 Dec 2019, 20:24
Thanks!