|
|
#1 (permalink) |
|
Monster Member
|
BORED AS ****
Really Don't like coding so boring. Deff not picking it next semester. Making some shtty calc function Code:
private void calcButton_Click(object sender, EventArgs e)
{
float n1, n2, n3; // Defines n1 n stuff
n1 = float.Parse(textBox1.Text);
n2 = float.Parse(textBox2.Text);
n3 = float.Parse(textBox3.Text);
string add;
add = n1.ToString()+ "+" + n2.ToString() + "+";
add += n3.ToString() + "=" + DoSum(n1,n2,n3).ToString();
calcLabel1.Text = add;
string times;
times = n1.ToString() + "x" + n2.ToString() + "x";
times += n3.ToString() + "=" + DoProduct(n1, n2, n3).ToString();
calcLabel2.Text = times;
string min;
min = "min = " + DoMin(n1, n2, n3).ToString();
calcLabel3.Text = min;
string max;
max = "max = " + DoMax(n1, n2, n3).ToString();
calcLabel4.Text = max;
}
private float DoSum(float p1, float p2, float p3)
{
return p1 + p2 + p3;
}
private float DoProduct(float p1, float p2, float p3)
{
return p1 * p2 * p3;
}
private float DoMin (float p1, float p2, float p3)
{
return System.Math.Min(p1, System.Math.Min(p2, p3));
}
private float DoMax(float p1, float p2, float p3)
{
return System.Math.Max(p1, System.Math.Max(p2,p3));
}
private void exitButton_Click(object sender, EventArgs e)
{
this.Close();
}
__________________
Lap: Yeah, but they where one-at-a time. |
|
|
|
|
|
|
|
#5 (permalink) | |
|
Monster Member
|
Quote:
They dont even bother making up **** for why we need to do stuff just tell us this is what u are going to make. Not even a simple case study or a purpose...
__________________
Lap: Yeah, but they where one-at-a time. |
|
|
|
|
|
|
#6 (permalink) |
|
GotGames Moderator
Join Date: Jun 2006
Location: Vic
Posts: 2,060
Rep Power: 5
|
Its basically because you need to know how to do basic coding well. Really well. There's unfortunately no other reason.
Unless you want to metaphorically dive into the deep end of the pool, and flounder and struggle and fail. Try doing your own projects. Like tic tac toe with some AI or something. Also why not use doSum(params int[] n), to have a more general method as well? And did they tell you to use floats instead of doubles? (better accuracy with doubles)
__________________
"If you wanna get it through their head, talk to them ragely" - fakeh Last edited by ivo; 24-04-2008 at 08:58 AM.. |
|
|
|
|
|
#7 (permalink) |
|
Contributing Member
Join Date: Jun 2006
Posts: 607
Rep Power: 3
|
So?
Then do their boring ****, get it out of the way quickly (if it is boring for you it should be pretty trivial), then work on your own ****. Fact is, you may think it boring, but consider this. If you never did any of this, which forces you to do simple operations how would you learn things like overflow, integer overflow, comparing floats/doubles etc. btw, how do _you think_ you compare floats?
__________________
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature. |
|
|
|
|
|
#9 (permalink) | |
|
Monster Member
|
Quote:
Still not sure if i am going to continue it. Prob just leave it up to Khaless and ivo :P. I made A shell game for assignment 1 (would get code but in mac os atm not xp for visual) But basicly it had a lot of If statements around which i new i could prob just call it instead of copy pasting, just had no idea how to do that.
__________________
Lap: Yeah, but they where one-at-a time. |
|
|
|
|
|
|
#10 (permalink) |
|
GotGames Moderator
Join Date: Jun 2006
Location: Vic
Posts: 2,060
Rep Power: 5
|
Programming can has the capacity to be as deadly boring as your history lessons.
But IMO outweighed easily by the times you're trying to create a new algorithm and then get it after 1000 edits, or sorting out your huge bundle of objects and functions, or finally getting the effect that you want, or everything works and you now have a cool executable which does stuff, not just sit there and get marked by a teacher, or finally getting things to communicate, and the list goes on. Did you know a new space rocket once blew up because the trajectories could no longer be calculated accurately enough in single precision, which had worked fine for the previous ones. And some anti-missile missiles in the gulf war had to be reset every few days or else rounding errors would cause them to miss their targets by 100's of metres? (they discovered this after one failed to destroy a scud aimed at an American base)
__________________
"If you wanna get it through their head, talk to them ragely" - fakeh Last edited by ivo; 28-04-2008 at 10:33 PM.. |
|
|
|






