Problem 1 (6 points): Fill in the missing information in the following three rec
ID: 3735800 • Letter: P
Question
Problem 1 (6 points): Fill in the missing information in the following three rectangles. You are asked to give the names for types of variables (focus on the scope). public class Student ( String name; String phone; public StudentO int age age 1; public Student(String name, String aPhone) this.name name, phone - aPhone; Answer: see above Problem 2 (6 points): Write the for loop statement for a loop that counts from 1000 to 0 by interval of -2. For example, the value of index in the first iteration is 1000, the second teration is 998, ..., 0Explanation / Answer
Question 1 :
public class Student{
String name; // instance variable
String phone // instance variable
public Student(){
int age; // Local variables
age = 1;
}
public Studnet(String name,String aPhone){ // Constructor parameters
this.name = name;
phone = aPhone;
}
}
Question 2:
public class Testing {
public static void main(String[] args) {
for (int i = 1000; i >= 0; i = i - 2) {
System.out.println(i);
}
}
}
Output:
prints from 1000 to 0
1000
998
996
994
992
990
988
986
984
982
980
978
976
974
972
970
968
.
.
Question 5:
Java IO
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.