Monday, May 4, 2009

C++

I am sitting in my C++ class right now, and it is really dumb. He is basically just reading some powerpoints and making us watch him. Right now, he is showing us how to write decimals in binary. It is really awesome. Wait...wait... nope, no it isn't. We had to write a program in MATLAB this morning that took the number 1, and added .0001 to it until you got 2. I instead wrote it in C++ and here it is:

#include "stdafx.h"
#include
using namespace std;

int _tmain(int argc, _TCHAR* argv[])
{
float x=0;
cout <<"start:";
cin >>x;

while (x != 2)
{
if (x <= 2)
{
x = (x + .0001);
cout << x;
cout <<"\n";
}
}
int num;
cin >> num;
return 0;
}
Derek was pseudo proud. I had to have him troubleshoot if for me because I threw in too many semicolons. It was out of control. When I ran it, it pretty much killed my battery. Yup, my computer is THAT awesome. I am pretty sure that the battery percent was dropping so fast that it was skipping full integers on its way down.

Since last semster ended, I got my grades from it. Here is how they are: mediocre.

This class is brutal. I get to sit in here for two hours, three times a week. It is pretty craptacular.

No comments:

Post a Comment