Answer Key
Answers
-
An application that takes in two numbers, subtracts them, and prints the difference (no peeking at the one above)
Input
double
variable-
operatorOutput
-
An application that takes in two numbers and divides the first by the second if the first is less than the second. Otherwise it multiplies the two. Print the result.
Input
double
variableconditionals
/
operator OR*
operatorOutput
-
An application that takes in 2 numbers and a character. The character will be
"+"
,"-"
,"*"
, or"/"
. Using the tools above, create a calculator that prints out the sum, difference, product, or quotient of the numbers.Input
double
variableString
variableconditionals
+
,-
,*
, or/
operatorsOutput
-
An application that prints the sum of an array of numbers.
Array
double
variableloops
Output
-
A tic tac toe game in which the user clicks to add an O or X (depending on whose turn it is). After each turn, if there are three of a kind in a row, the winner (X or O) is printed and the game ends.
String
variableloops
Input
conditionals
Output