Section 1

Preview this deck

Create a scanner

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (16)

Section 1

(16 cards)

Create a scanner

Front

Scanner ___ = new Scanner(System.in);

Back

For loop to print array and print with every number on same line

Front

for (int index = 0; index < ___.length; index++) { System.out.print(___[index]); System.out.print(" "); }

Back

Create an integer

Front

int ___ = X

Back

Print

Front

System.out.println();

Back

Create a variable with a random number from 0-10

Front

int ___ = (int)(Math.random( )*10 + 1);

Back

Create a for loop that prints odd numbers starting at 13.

Front

for (int index = 0; index < ___.length; index++) { ___[index] = index * 2 + 13; System.out.print(___[index]); System.out.print(" "); }

Back

Create an integer array

Front

int ___[ ] = {W,X,Y,Z};

Back

Create a string

Front

String ___ = "___";

Back

Main method

Front

public static void main(String[ ] args)

Back

Use the substring method.

Front

String ___ = str.substring(x,y)

Back

Create an array with each house on a separate line (order Strath, ren, kayes, groves, lakes, lons, rips, dux, copes)

Front

String [] houses = new String [9]; houses[0] = "Strathcona"; houses[1] = "Renfrew"; houses[2] = "Kayes"; houses[3] = "Groves"; houses[4] = "Lakes"; houses[5] = "Lonsdales"; houses[6] = "Ripleys"; houses[7] = "Duxbury"; houses[8] = "Copemans";

Back

Capture response into int variable

Front

variableName = userInput.nextInt();

Back

Import Scanner

Front

import java.util.Scanner;

Back

Create an integer array that will hold X amount of numbers

Front

int ___[ ] = new int [X];

Back

Capture response into string variable

Front

variableName = userInput.next();

Back

Create a 2D array with 3 rows and 4 columns

Front

int ___[ ] [ ] = new int [3] [4]; / int [ ] [ ] ___ = {{W,X,Y,X}{W,X,Y,Z,}{W,X,Y,Z}};

Back