Page 524 - AP Computer Science A, 7th edition
P. 524

1. A large Java program was tested extensively, and no errors were found. What can be concluded?
(A) All of the preconditions in the program are correct. (B) All of the postconditions in the program are correct. (C) The program may have bugs.
(D) The program has no bugs.
(E) Every method in the program may safely be used in other programs.
Questions 2–4 refer to the Worker class below:
public class Worker {
private String name;
private double hourlyWage; private boolean isUnionMember;
public Worker()
{ /∗ implementation not shown ∗/ }
public Worker(String aName, double anHourlyWage, boolean union)
{ /∗ implementation not shown ∗/ }
//Accessors getName, getHourlyWage, getUnionStatus are not shown.
/∗∗ Permanently increase hourly wage by amt. ∗ @param amt the amount of wage increase ∗/
public void incrementWage(double amt) { /∗ implementation of incrementWage ∗ / }
/∗∗ Switch value of isUnionMember from true to false and
∗ vice versa.
∗/
public void changeUnionStatus()
{ /∗ implementation of changeUnionStatus ∗ / }















































































   522   523   524   525   526