Coding Flashcards

1
Q

Import

A

import javax.swing.*;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Class

A

public class ________
{
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Main Method

A

public static void main (String [] args)
{
}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Print

A

System.out.println(____);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Allows the user to input

A

____ = JOptionPane.showInputDialog(“_____”);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Variable WORDS

A

String _____ = “____”;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Variable INTEGER

A

int ______ = _______;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Allows users to input integer

A

int ____ = Integer.parseInt (JOptionPane.showInputDialog (“________”));

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Variable REAL NUMBER

A

double _______ = _______;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Allows users to input real number

A

double ______ = Double.parseDouble(JOptionPane.showInputDialog(“_____”));

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Addition

A

+

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Subtraction

A

-

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Multiplication

A

*

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Division

A

/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

String -> int

A

String a = “______”;
int i = Integer.parseInt(a);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

int -> double

A

int i = ____;
double d = i;

17
Q

char -> int

A

char c = ‘___’;
int i = c ;

18
Q

int -> String

A

int i = ___;
String num = i + “”;

19
Q

String -> char

A

String name = “___”;
char c = name.charAt(___);

20
Q

char -> double

A

char r = ‘___’;
int i = (int) r;
double d = i;

21
Q

Give char value for what the user inputs

A

char ____ = JOptionPane.showInputDialog(“___”).charAt(__);

22
Q

Prints specific letters from words in char

A

System.out.println(word___.charAt(___));

23
Q

If statement numbers & true and false

A

if (ask == true)
{

}
If (ask == false)
{

}

24
Q

Boolean

A

boolean ask = Boolean.parseBoolean(JOptionPane.showInputDialog(“_______”));

25
Q

Incrementing

A

int num = _____;
++num;

26
Q

Decrementing

A

int num = ____;
- -num;

27
Q

Modulus number

A

int/double num = ______.parse____(JOptionPane.showInputDialog(“Enter a number”));
if (num%2 == 0)
{
______
}
if (num%2 == 1)
{
_____
}

28
Q

Print char for whole word

A

System.out.println(word___.substring(__,__));

29
Q

if statement words

A

if (_____.equals(_____))
{
_____
}
if (_____.equals(____))
{
____
}