1 / 2

Write program to print out 1-100 in 10 x 10 table Set up variable to contain number to print out

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

azura
Download Presentation

Write program to print out 1-100 in 10 x 10 table Set up variable to contain number to print out

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 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

  2. 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

More Related