Unformatted text preview:

Q01 d Q02 c Q03 c Q04 e Q05 b Q06 a Q07 e Q08 b Q09 a Q10 c Q11 public class Student private String name private GPA gpa public Student String name GPA gpa this name name this gpa gpa public GPA getGpa return gpa public void setName String n name n public boolean honorRoll GPA target return gpa compareTo target 0 if gpa compareTo target 0 if gpa getValue target getValue return true else return false public String toString return name gpa Q12 import java util public class GraduatingClass public static void main String args Scanner scan new Scanner System in System out println Enter the size of the class int size scan nextInt System out println Enter the school s Honor Roll threshold GPA threshold new GPA scan nextDouble Student students new Student size int total 0 scan nextLine for int i 0 i size i System out println Enter student name String name scan nextLine GPA gpa new GPA Math random 4 Math random 2 2 assuming a min 2 0 gpa to attend school students i new Student name gpa if students i honorRoll threshold total System out println total Q13 double bestInMonths double famCellBills int numCols famCellBills 0 length double bestBills new double numCols for int col 0 col numCols col double minBill Double MAX VALUE famCellBills 0 col for int row 0 row famCellBills length row if famCellBills row col minBill minBill famCellBills row col bestBills col minBill return bestBills


View Full Document

NJIT CS 113 - Practice Exam

Download Practice Exam
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Practice Exam and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Practice Exam and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?