Assignment 01
Assignment 01
Assignment 01
Assignment #1
EX 9_02
class Stock{
private String symbol;
private String name;
private double previousClosingPrice;
private double currentPrice;
EX 9_06
class StopWatch{
private int startTime;
private int endTime;
selectionSort(testNums);
stopWatch.stop();
EX 9_07
import java.util.*;
public class Account {
private int id;
private double balance;
private double annualInterestRate;
private Date dateCreated;
public Account() {
id = 0;
balance = 0;
annualInterestRate = 0;
}
this.id = newId;
this.balance = newBalance;
dateCreated = new Date();
annualInterestRate = 0;
}
return id;
}
this.id = newID;
}
return balance;
}
this.balance = newBalance;
}
this.annualInterestRate = newInterestRate;
}
return startDate;
}
return InterestRatePerMonth;
}
return monthlyInterest;
}
balance -= amount;
}
public void deposit(double amountDeposit) {
balance += amountDeposit;
EX 9_11
public class LinearEquation {
private double a;
private double b;
private double c;
private double d;
private double e;
private double f;
return e;
}
return a * d - b * c != 0;
}
return x;
}
import java.util.*;
public class LinearEquationMain {
public static void main(String[] args) {
double a, b, c, d, e, f;
a = input.nextDouble();
b = input.nextDouble();
c = input.nextDouble();
d = input.nextDouble();
e = input.nextDouble();
f = input.nextDouble();
if (tester.isSolvable()) {