Conditionals
Methods
Print Statements
Arrays
Programming to the World
100

What is the purpose of an if statement?

If statements allows an output to occur if a certain input happens -> If something is this (input), then this does this, (output)

100

public static ____ main ______

Fill in the blanks.

public static void main (String args[]) {

}

100

What is one reason someone might print something in a program. 

One example is to debug code, by printing values of different variables. 

100

What is an array?

An array is a data type in java in which users can store multiple pieces of the same data type in one thing. 

100

What is java mainly used for?

Web applications, apps, etc. 

200

What is an example use of an if statement with variables?

One example could be that if statements can allow a program to print a specific statement, if a variable is equal to a certain value. 

200

What is the point of a method?

A method allows separate chunks of code to be organized into different methods, which can be called at different times when needed. It allows clear code, and not just random code all chunked together. 

200

What is the java print statement? 

System.out.println();

200

How can someone use an array? 

They can store different weather patterns and make a double array for that. They can also name this array based on where the weather patterns are coming from. 

200

What is one way programmers for big websites or games, not assume important things about the user's preferences; could be UI, color customization, etc. 

Ask the public to review their original design, or have feedback from others to get an idea for what users want. Or they could have an extremely customizable app in which users can basically pick what they want. 

300

int x = 2;

if (x = 8) {

   System.out.println("eight");

} else {

   System.out.println("almost");

   x++;

}


What happens when x is not equal to 8?

It will print out "almost", and increase the value of x. Assume that x starts as 4. 

300

public static int girlsWhoCode(int clubMember) {

     // does something important 

     double code = 8.9;

     return code;

}


What is an error that will occur with this code. 

The method is returning a double value when it must return an integer. 

300

What is the difference between System.out.println();, and System.out.print();

Println prints it out in a new line, while print just prints it in the same line. 

300

Which one is incorrect: array.length();
                                  array.length;

array.length() -> array dot length does not have any parenthesis 

300

What two important numbers represent on and off in computers?

0 - off

1 - on

400

int girlsWhoCode = 8;

int numOfTimes = 0;

if (girlsWhoCode == 5) {

   System.out.println("hooray!");

} else {

   girlsWhoCode --;

   numOfTimes ++; 

   System.out.println("not yet!");

}

System.out.println(numOfTimes);

What will this code print?

This code will print "not yet", until the variable girlsWhoCode = 5, and will decrement by 1, each time it is not 5. Once it is five, it will print "hooray", and will print the number of times it took the program to become 5. 

Assume that the variable starts as 8, and not another number. 

400

What is the point of having different data values in methods -> public static int ... Or other types of data. 

It allows the method to return specific things that is related to the method its self. This can be stored into different variables, which is useful in programs. 

400

What does this print -> System.out.println("Girls Who Code is the best club!");

Girls Who Code is the best club 

400

How can someone go through all the elements of an array?

With a for loop; using i for all the different indexes of the array. 

400

How many coding languages are there?

Over 8,000.
500

What is the point of an else if statement, why is it useful, when is it not useful, explain the overall impact of it on a program. 

 - Else if statements can allow another related if statement to be sort of paired up with other ones. This allows clean code and good quality. 

- It is not useful when there are if statements that are unrelated, which would decrease readability. It also clearly explains that the two if statements are two separate blocks of code. 

- Its overall impact on the program is that it allows the user to have multiple related if statements, paired together which allows code to be more organized, and clear. 

500

What is the void in a method mean?

The method returns nothing 

500

What does this print -> System.out.println(4 + "hi" + 5 + "cool");

4hi5cool

500

What is a 2d array?

A 2d array, is an array of arrays. This can be helpful in storing multiple pieces of information, that is related. 2d arrays go in rows, columns. You can access each row, and specific column for a specific data point in a 2d array. With this, programmers can store things like different speeds of a car, having rows for different cars, and columns showing the different speeds in 5 tries. 

500

What is an example of conditionals being applied to real life, for example traffic lights, etc. 

If statements are a way of saying do this, if this happens, which happens in everyday life, as things like traffic lights use conditionals to change lights based on timers, or pedestrian buttons.