Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
N

Nano Tape

@Nano Tape
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • My First Java
    N Nano Tape

    Hi and thanks for looking, Just started to learn Java and after reading various tutorials came up with this simple tables program. My question, is it as it should be? I mean it works OK but is it coded correctly?

    import java.util.Scanner; // Import the Scanner class
    public class MyTables {
    public static void main(String[] args) {
    int secondNum, answerNum;

    Scanner sc = new Scanner(System.in);  // Create a Scanner object
    System.out.println("Type a number:");
    secondNum = sc.nextInt(); // Read user input	
    
    for (int firstNum = 1; firstNum <= 12; firstNum ++) { 
    answerNum = firstNum \* secondNum;
    System.out.println(firstNum + " x " + secondNum + " = " + answerNum);
      }
    }
    

    }

    Java question java
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups