refresher course in code

Everything about it! Heard the news? What! is Ubuntu bankrupt? Has Mandriva started marketing? Have you taken a sky diving course?
We just need to know! No flaming! And we hate spammers -Get it?

Moderators: b1o, jkerr82508

User avatar
gnuuser
Berserk
Posts: 449
Joined: 18 Aug 2010, 21:52
Location: northwestern Pa.
Contact:

refresher course in code

Postby gnuuser » 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 :oops:
so I guess Im going to take some classes in code again. :T
c#, java, python. and maybe php for starters and more later :tux5:
registered Linux user number 505431
Amateur radio call sign KC3TEC
miracle (mere-ack-ull) :
the aspiration of the indigent, the expectation of the indolent, and the inspiration of the ignorant.

Im so old even dirt was my apprentice!

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: refresher course in code

Postby viking60 » 17 Dec 2018, 23:24

:s
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
gnuuser
Berserk
Posts: 449
Joined: 18 Aug 2010, 21:52
Location: northwestern Pa.
Contact:

Re: refresher course in code

Postby gnuuser » 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 :jackpot :A

#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;
}
registered Linux user number 505431
Amateur radio call sign KC3TEC
miracle (mere-ack-ull) :
the aspiration of the indigent, the expectation of the indolent, and the inspiration of the ignorant.

Im so old even dirt was my apprentice!

User avatar
R_Head
Berserk
Posts: 2819
Joined: 17 Mar 2010, 15:40

Re: refresher course in code

Postby R_Head » 01 Dec 2019, 06:27

Is all Elliniká to me. :lol:

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: refresher course in code

Postby dedanna1029 » 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 :jackpot :A

#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?
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
gnuuser
Berserk
Posts: 449
Joined: 18 Aug 2010, 21:52
Location: northwestern Pa.
Contact:

Re: refresher course in code

Postby gnuuser » 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.
registered Linux user number 505431
Amateur radio call sign KC3TEC
miracle (mere-ack-ull) :
the aspiration of the indigent, the expectation of the indolent, and the inspiration of the ignorant.

Im so old even dirt was my apprentice!

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: refresher course in code

Postby dedanna1029 » 31 Dec 2019, 20:24

Thanks!
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html


Return to “The Lounge”