Well, duh. tw goes 1000, 999, 998 ..., 2, 1, 999, 998, 997..., 2, 1, 999, ... Why is tw=999 <b>inside</b> the while loop?
Well, duh. tw goes 1000, 999, 998 ..., 2, 1, 999, 998, 997..., 2, 1, 999, ... Why is tw=999 <b>inside</b> the while loop?
And then there is Death
TW is initialized to one. But all it does is print out the entered value 60 times.
;______________;
Code:while (hours >= 0) while (tw<1000) { tw++; cout << hours << ":" << minutes << ":" <<seconds << "\n";
Leave some shards under the belly
Lay some grease inside my hand
It's a sentimental jury
And the makings of a good plan
Thanks to you brilliant gents *checks Endless's profile*, I have it counting properly, and all I need to do is tweak the counter till it's in tune with a clock.
Leave some shards under the belly
Lay some grease inside my hand
It's a sentimental jury
And the makings of a good plan
After you tweak it for the computer that you are programming on, you should try running the program on a computer that is either slower or faster than it. This will show you how much variance the computer's processing power will have on the time and if it will be noticable if someone else runs it on a different computer.
I had an infinite loop involving negative time when I first tried it on my own. I thought you'd find that humorous.
Leave some shards under the belly
Lay some grease inside my hand
It's a sentimental jury
And the makings of a good plan
Wanna borrow it? BACK TO 1982!
Leave some shards under the belly
Lay some grease inside my hand
It's a sentimental jury
And the makings of a good plan
Done. I'm off only by .5 of a second every minute, well within the range of 15% error. XD. I'm so uber. I really appreciate all your help.
Leave some shards under the belly
Lay some grease inside my hand
It's a sentimental jury
And the makings of a good plan
Im finished with it too.
Last edited by Mr. Wertz; 03-14-2006 at 05:06 PM.
PM me instead of spamming, kthxbai.
Leave some shards under the belly
Lay some grease inside my hand
It's a sentimental jury
And the makings of a good plan
how does this cube program look bbomber72011.
Code://Bryan Wertz II //March 8th, 2006 //Intermediate C++, Terminal 1. //Cube Program #include <graphics.h> //Header file. #include <conio.h> //Header file. #include <iostream.h> //Header file. #include <fstream.h> //Header file. void Cube_Printer() //function that prints a cube on the screen. { int graphdriver=DETECT,graphmode; //Goes into Graphics mode. initgraph(&graphdriver,&graphmode,"c:..\\bgi"); moveto(120,130); lineto(150,110); lineto(210,110); lineto(180,130); lineto(120,130); moveto(120,170); lineto(180,170); lineto(210,150); lineto(210,110); moveto(120,170); lineto(120,130); moveto(180,170); lineto(180,130); moveto(210,150); lineto(150,150); lineto(120,170); moveto(150,150); lineto(150,110); setbkcolor(1); setlinestyle(0,0,3); setcolor(3); rectangle(120,130,180,170); moveto(120,130); lineto(150,110); lineto(210,110); lineto(180,130); moveto(210,110); lineto(210,150); lineto(180,170); setlinestyle(1,0,3); setcolor(3); moveto(150,110); lineto(150,150); lineto(120,170); moveto(150,150); lineto(210,150); moveto(300,300); outtext("Press any key to end."); getch(); closegraph(); //closes graph. } int main() { cout << "This is going to print a cube onto the screen.\n\n\n"; cout << " Press any key to continue!"; getch(); Cube_Printer(); //call to Cube_Printer. return 0; //end of program. }
IT SUCKS!
Nice job, it runs.
Leave some shards under the belly
Lay some grease inside my hand
It's a sentimental jury
And the makings of a good plan
it doesnt suck.
and if it does, then it doesnt matter because I found it anyway. LAWLZ.
Last edited by Mr. Wertz; 03-14-2006 at 05:16 PM.