review game 1. teams: a scott, michael o, myles, ryan haris, william, matt c, jack jessica, patrick,...
TRANSCRIPT
Teams: A• Scott, Michael O, Myles, Ryan • Haris, William, Matt C, Jack• Jessica, Patrick, Lexa, Kyle• Josh, Nico, Betsey, Brian• Tanner, Evan, Sean, Dan• Alexandra, Genesis, Michael S • Taylor, Matt B, Jen, Ripton
Teams: C
• Gabe, Finn, Nathan, Rachel• Thomas, Darby, Sabrina, Greg• Stephanie, Dustin, Sammi, Eric• Philip, Will, Nicole, Killian• Avery, Matt, Michael M, Rhett• Skyler, Zack, Tim, Soula• Brandon, Michael B, Meggie
Teams: D
• McKay, Tyler L, Ryan, Nevin• Connor, Mike, Muriel, Ian• Carly, Ty, Millie, Sebastian• Nick, Andrew, Mack, Ben• Chris, Nathan, Shaye, Parker• John, Erin, Conor, Alec• Zack, Ellie, Brady, Tyler A
1.
• Describe what gets drawn:
fill(0,255,0);stroke(255,0,0);ellipseMode(CORNER);
ellipse(0,0,100,100);
8.
• Suppose I want to write a method to tell whether or not a number is positive.
• What would the input and output types be?
9.
• Suppose I want to write a method that takes a letter and whether or not it should be upper case and computes the new letter.
• What should the input and output types be?
21.
• Suppose the Tiger class has this behavior:public int countTeeth()
What line of code calls the countTeeth behavior on the Tiger tony?
22.
• Suppose the Tiger class has this behavior:
• public void grabMice(int mice)• What line calls the grabMice behavior
on the Tiger tony for 3 mice?
25.• What is the error?
public int mystery(int a, int b){
if(a<b){
return a;
}else if (a>=b){
return b;
}
}
Write a method
The above formula calculates a person’s BMI given their height in centimeters and weight in kilograms. Write a method to calculate a person’s BMI given their height and weight, but the weight is given in grams. (1 kilogram = 1000 grams).
public double bmi(double wt, double ht){
Write a methodYou need to write a program to help out your weekend business doing lawn care. You really need to buy $15 bags of grass seed, but if any money is left over, you also need some $2 bags of mulch. Write a method that takes as input how much money you have and prints how many bags of grass seed and mulch I can buy. For example, if I have 52 dollars, I can buy 3 bags of seed (that’s $45) and 3 bags of mulch ($6 more).
public void purchaseOrder(int dollars)
The line System.out.println(x) prints the value of the variable x.