This AP Course series is based on computers, and all the answers are based on Java, just to clarify, because some parts of Java share features with other coding languages. One more thing: This quiz is heavily based off of Units 1 and 2, know those well. Good luck!
5.Which of the following isn't a function in the math class?
Math.int
✓
Math.pow
✓
Math.abs
✓
Math.round
✓
6.I have declared a string variable called word that is initialized as "Super". If I were to use the substring function and enter the parameters 1 and 3 respectively, what would be the output if printed?
1,3
✓
upe
✓
Sup
✓
Super
✓
7.I worked really hard on a program to compute the area of a square using user input, but it just WON'T WORK OUT! Here is my code:
Scanner newDim = new Scanner(System.in);
System.out.println("Enter a side of your square.");
side = newDim.nextDouble();
area = Math.pow(side,2.0);
System.out.println("Area:" + area);
PLEASE HELP ME SOLVE THIS IM FREAKING OUT. MY THERAPIST IS SAYING THERE IS MORE THAN ONE ERROR SELECT THE OPTION THAT PINPOINTS BOTH ERRORS.
nextDouble isn't a real statement in Java. You must find another way to store the input.
✓
You can't declare your scanner variable a name of your choice. It must be called input.
✓
You haven't stated what data type area and side are. They should be doubles.
✓
You can't print a string and a double together. Convert the double into a string.
✓
8.Which of the following successfully calls a method by the name of jetPunk?
jetPunk();
✓
calledMethod = jetPunk()
✓
start jetPunk();
✓
jetPunk()
✓
9.Which of the following variables can store a value of 3.6?
char
✓
boolean
✓
int
✓
double
✓
10.Which of the following functions aren't in the String class?