time tables help
Apr 9, 2008 at 4:56pm UTC
the numbers don't output in the right amounts or order
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
#include <iostream>
using namespace std;
int Grid(double Number);
int main()
{
double Number;
bool Run = true ;
char DoAgian = 'y' ;
while (Run)
{
cout << " Pick the number your times table will go up to " << endl;
cout << " it cant be greater then 100" << endl;
cin >> Number;
if ( Number > 100 )
{
cout << " That number is to high " ;
main();
}
Grid(Number);
switch (DoAgian)
{
case 'y' :
break ;
case 'n' :
Run = false ;
break ;
default :
cout << " Invalid Responce " << endl;
}
}
system("pause" );
return 0;
}
int Grid( double Number )
{
int i = 1;
int i2 = 1;
double Output = 1;
double Number2;
bool Loop = true ;
Number2 = Number ;
while (Loop)
{
if ( i == Number2 )
{
Loop = false ;
}
for ( i = 1; i <= Number; i++ )
{
Output+=2;
cout << "|" << Output << "|" ;
if ( Output >= 10 )
{
cout << "" << Output << "" ;
}else if ( Output >= 100 ){
cout << "|" << Output << "|" ;
}
}
Number++;
cout << endl;
i2++;
i = i2;
Output = i ;
}
}
Apr 9, 2008 at 6:11pm UTC
1 2 3 4
//C++ includes the ability to add comments to your code for a reason:
//To make the intentions of the writer of a particular piece of code clear.
//I heartily recommend you use them, because I can't even make out what
//you're attempting to do.
Post something showing what you're attempting to achieve for an output, and maybe I'll be able to help.
Apr 9, 2008 at 11:11pm UTC
nevermind i got it
i will remember to comment it next time i have a problem
Topic archived. No new replies allowed.