|
Post by Kei-Lin on Dec 12, 2007 22:53:45 GMT -5
I've been learning the computer language C++, and today I wrote a code that calculates the area of a trapezoid. I got it right on the first try with zero errors, and it's really cool!
|
|
|
Post by Robocop on Dec 12, 2007 22:56:55 GMT -5
Is that the videogame code?
Cool. So when are you going to post it?
|
|
|
Post by Kei-Lin on Dec 13, 2007 16:49:54 GMT -5
It's not a video game code
|
|
|
Post by Robocop on Dec 13, 2007 16:51:05 GMT -5
I don't care, post it anyway! I want to see it!
|
|
|
Post by Kei-Lin on Dec 24, 2007 21:55:07 GMT -5
Okay, okay. Here it is
#include <stdio.h> #include <math.h>
void main(){ double i;
printf("Enter Income: "); scanf("%lf", &i);
if (i >= 350 && i < 360) { printf("If you have 0 exemptions, your Federal Income Tax is $46. \nIf you have 1 exemption, your Federal Income Tax is $39.\nIf you have 2 exemptions, your Federal Income Tax is $31. \nIf you have 3 exemptions, your Federal Income Tax is $24. \nIf you have 4 exemptions, your Federal Income Tax is $17. "); }
else if (i >= 360 && i < 370) { printf("If you have 0 exemptions, your Federal Income Tax is $47. \nIf you have 1 exemption, your Federal Income Tax is $40.\nIf you have 2 exemptions, your Federal Income Tax is $33. \nIf you have 3 exemptions, your Federal Income Tax is $26. \nIf you have 4 exemptions, your Federal Income Tax is $18. "); }
else if (i >= 370 && i < 380) { printf("If you have 0 exemptions, your Federal Income Tax is $49. \nIf you have 1 exemption, your Federal Income Tax is $42.\nIf you have 2 exemptions, your Federal Income Tax is $34. \nIf you have 3 exemptions, your Federal Income Tax is $27. \nIf you have 4 exemptions, your Federal Income Tax is $20. "); }
else if (i >= 380 && i < 390) { printf("If you have 0 exemptions, your Federal Income Tax is $50. \nIf you have 1 exemption, your Federal Income Tax is $43.\nIf you have 2 exemptions, your Federal Income Tax is $36. \nIf you have 3 exemptions, your Federal Income Tax is $29. \nIf you have 4 exemptions, your Federal Income Tax is $21. "); }
else if (i >= 390 && i < 400) { printf("If you have 0 exemptions, your Federal Income Tax is $52. \nIf you have 1 exemption, your Federal Income Tax is $45.\nIf you have 2 exemptions, your Federal Income Tax is $37. \nIf you have 3 exemptions, your Federal Income Tax is $30. \nIf you have 4 exemptions, your Federal Income Tax is $23. "); }
else if (i >= 400 && i < 410) { printf("If you have 0 exemptions, your Federal Income Tax is $53. \nIf you have 1 exemption, your Federal Income Tax is $46.\nIf you have 2 exemptions, your Federal Income Tax is $39. \nIf you have 3 exemptions, your Federal Income Tax is $32. \nIf you have 4 exemptions, your Federal Income Tax is $24. "); }
else if (i >= 410 && i < 420) { printf("If you have 0 exemptions, your Federal Income Tax is $55. \nIf you have 1 exemption, your Federal Income Tax is $48.\nIf you have 2 exemptions, your Federal Income Tax is $40. \nIf you have 3 exemptions, your Federal Income Tax is $33. \nIf you have 4 exemptions, your Federal Income Tax is $26. "); }
else if (i >= 420 && i < 430) { printf("If you have 0 exemptions, your Federal Income Tax is $56. \nIf you have 1 exemption, your Federal Income Tax is $51.\nIf you have 2 exemptions, your Federal Income Tax is $42. \nIf you have 3 exemptions, your Federal Income Tax is $35. \nIf you have 4 exemptions, your Federal Income Tax is $27. "); }
else if (i >= 430 && i < 440) { printf("If you have 0 exemptions, your Federal Income Tax is $58. \nIf you have 1 exemption, your Federal Income Tax is $51.\nIf you have 2 exemptions, your Federal Income Tax is $43. \nIf you have 3 exemptions, your Federal Income Tax is $36. \nIf you have 4 exemptions, your Federal Income Tax is $29. "); }
else if (i >= 440 && i < 450) { printf("If you have 0 exemptions, your Federal Income Tax is $59. \nIf you have 1 exemption, your Federal Income Tax is $52.\nIf you have 2 exemptions, your Federal Income Tax is $45. \nIf you have 3 exemptions, your Federal Income Tax is $38. \nIf you have 4 exemptions, your Federal Income Tax is $30. "); }
else if (i >= 450 && i < 460) { printf("If you have 0 exemptions, your Federal Income Tax is $61. \nIf you have 1 exemption, your Federal Income Tax is $54.\nIf you have 2 exemptions, your Federal Income Tax is $46. \nIf you have 3 exemptions, your Federal Income Tax is $39. \nIf you have 4 exemptions, your Federal Income Tax is $32. "); }
else if (i >= 460 && i < 470) { printf("If you have 0 exemptions, your Federal Income Tax is $62. \nIf you have 1 exemption, your Federal Income Tax is $55.\nIf you have 2 exemptions, your Federal Income Tax is $48. \nIf you have 3 exemptions, your Federal Income Tax is $41. \nIf you have 4 exemptions, your Federal Income Tax is $33. "); }
else if (i >= 470 && i < 480) { printf("If you have 0 exemptions, your Federal Income Tax is $64. \nIf you have 1 exemption, your Federal Income Tax is $57.\nIf you have 2 exemptions, your Federal Income Tax is $49. \nIf you have 3 exemptions, your Federal Income Tax is $42. \nIf you have 4 exemptions, your Federal Income Tax is $35. "); }
else if (i >= 480 && i < 490) { printf("If you have 0 exemptions, your Federal Income Tax is $66. \nIf you have 1 exemption, your Federal Income Tax is $58.\nIf you have 2 exemptions, your Federal Income Tax is $51. \nIf you have 3 exemptions, your Federal Income Tax is $44. \nIf you have 4 exemptions, your Federal Income Tax is $36. "); }
else if (i >= 490 && i < 500) { printf("If you have 0 exemptions, your Federal Income Tax is $69. \nIf you have 1 exemption, your Federal Income Tax is $60.\nIf you have 2 exemptions, your Federal Income Tax is $52. \nIf you have 3 exemptions, your Federal Income Tax is $45. \nIf you have 4 exemptions, your Federal Income Tax is $38. "); }
else printf("Please enter your income, and nothing else. ");
while(1) { } }
|
|
|
Post by Robocop on Dec 25, 2007 20:23:04 GMT -5
OMG what the heck is that???
|
|
|
Post by Kei-Lin on Dec 28, 2007 16:42:45 GMT -5
A code. What does it look like, you robo-doofus? ?
|
|
Caboose
Intermediate Student
Posts: 50
|
Post by Caboose on Jan 3, 2008 4:33:01 GMT -5
You have learned alot young one, lol. Did you make this code from the ground up or did you use a base code to help you?
|
|
|
Post by Kei-Lin on Jan 3, 2008 18:35:08 GMT -5
I made it by myself, from scratch. Although this isn't the most advanced anymore.
I have a better code which lets you choose from 8 math formulas.
|
|
|
Post by Darkfire on Jan 4, 2008 11:58:53 GMT -5
A code. What does it look like, you robo-doofus? ? according to a previous post it is for photoshop or things like that.
|
|
|
Post by Kei-Lin on Jan 9, 2008 21:13:39 GMT -5
No, it calculates a person's rate of federal income tax.
|
|
|
Post by ExoticHunter on Jan 24, 2008 23:58:21 GMT -5
The only good rate is zero!
|
|