20 likes | 207 Views
Write program to print out 1-100 in 10 x 10 table Set up variable to contain number to print out For loops (outer and inner) to print out row and columns Print out numbers 1-100, each row = multiples of 10 Draw header and border Evaluate numbers for Fizz Evaluate if number is divisible by 3
E N D
Write program to print out 1-100 in 10 x 10 table • Set up variable to contain number to print out • For loops (outer and inner) to print out row and columns • Print out numbers 1-100, each row = multiples of 10 • Draw header and border • Evaluate numbers for Fizz • Evaluate if number is divisible by 3 • Use if statement to test number modulus % 3==0 • Evaluate if number contains 3 • Use if statement to test number modulus % 10==3 (13,23, etc) • Use (number-(number%10))%10 ==3 (31,32,34,38)OR use number/10==3 • Print output to console
4. Evaluate numbers for Buzz • Evaluate if number is divisible by 7 • Use if statement to test number modulus % 7==0 • Evaluate if number contains 7 • Use if statement to test number modulus % 10==7 (17,37, etc) • Use (number-(number%10))%10 ==7 (71 etc)OR use number/10==7 • Print output to console 5. Evaluate numbers for FizzBuzz If number is Fizz && number is Buzz = print FizzBuzz