Make a colorful, simple and user-friendly site. You will need to explain the following using words and code:
- Inheritance
- Interfaces
- ArrayList and Arrays
- Method overloading vs. overriding
Object Oriented Programming Using Java
With another person (or two, or by yourself), I would like you to create three classes for a Real Estate Business. The first will be a property class with an address, price, and area. The Residential class and Commercial class will be the subclasses of the Property class. Add two attributes to each subclass. ---Create a GUI to enter the information about the Residential or Commercial properties. Store them in an ArrayList.
Have the ability to output the ArrayList to the console.
The following two programs comes from Chapter 7 in your textbook. Due Monday June 16th, 2009. Please upload both as one project and make sure to zip it before using freerschool.com. P7.2 Implement a class Purse. A purse contains a collection of coins. For simplicity, we will only store the coin names in an ArrayList void addCoin(String coinName)Add a method toString to the Purse class that prints the coins in the purse in the format Purse[Quarter,Dime,Nickel,Dime]Use the following class in your solution: import java.util.ArrayList; Use the following class as your tester class: /** | ||
Write a method reverse that reverses the sequence of coins in a purse. Use the toString method of the preceding assignment to test your code. For example, if reverse is called with a purse Purse[Quarter,Dime,Nickel,Dime]then the purse is changed to Purse[Dime,Nickel,Dime,Quarter]Use the following class in your solution: import java.util.ArrayList; Use the following class as your tester class: /** |
What are they used for? Where did you find good information about the terms?
Class Doctor, Class Patient
Think of four things to keep track of for a Patient
Think of three things about a Doctor to keep track of
Design 3 methods for each and a constructor for each!
Make a Patient object and a Doctor object within your main method
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 99.
Find the largest palindrome made from the product of two 3-digit numbers.
Also attach code samples to your site. Send me the URL when it is finished. If you copy other people's words, give them credit by linking to them and quoting it.
Show me in class running on the localhost.
OR...
Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:
1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...
Find the sum of all the even-valued terms in the sequence which do not exceed four million.
Look over the code but focus on concepts not coding.
I was working on this problem:
A permutation is an ordered arrangement of objects. For example, 3124 is one possible permutation of the digits 1, 2, 3 and 4. If all of the permutations are listed numerically or alphabetically, we call it lexicographic order. The lexicographic permutations of 0, 1 and 2 are:
012 021 102 120 201 210
What is the millionth lexicographic permutation of the digits 0, 1, 2, 3, 4, 5, 6, 7, 8 and 9?
The recursive algorithm is short and mysterious. It's executed with a call visit(0). Global variable level is initialized to -1 whereas every entry of the array Value is initialized to 0.
void visit(int k)
{
level = level+1; Value[k] = level; // = is assignment
if (level == N) // == is comparison
AddItem(); // to the list box
else
for (int i = 0; i < N; i++)
if (Value[i] == 0)
visit(i);
/**
This program tests the Employee class and its subclasses.
*/
public class EmployeeTester
{
public static void main(String[] args)
{
Employee e = new Employee(''Edgar'', 65000);
Manager m = new Manager(''Mary'', 85000, ''Engineering'');
Executive v = new Executive(''Veronica'', 105000, ''Engineering'');
System.out.println(e);
System.out.println(''Expected: Employee[name=Edgar,salary=65000.0]'');
System.out.println(m);
System.out.println(''Expected: Manager[super=Employee[
name=Mary,salary=85000.0],department=Engineering]'');
System.out.println(v);
System.out.println(''Expected: Executive[super=Manager[
super=Employee[name=Veronica,salary=105000.0],
department=Engineering]]'');
}
}
Exercise P10.6
/**
This class tests class Worker and its subclasses.
*/
public class WorkerTester
{
public static void main(String[] args)
{
Worker s = new SalariedWorker(''Sally'', 40);
Worker h = new HourlyWorker(''Harry'', 40);
System.out.println(s.computePay(30));
System.out.println(''Expected: 1600'');
System.out.println(h.computePay(30));
System.out.println(''Expected: 1200'');
System.out.println(s.computePay(50));
System.out.println(''Expected: 1600'');
System.out.println(h.computePay(50));
System.out.println(''Expected: 2200'');
}
}
Due February 27, 2009
The following two programs comes from Chapter 7 in your textbook. Due Monday February 16th, 2009. Please upload both as one project and make sure to zip it before using FTP. P7.2 Implement a class Purse. A purse contains a collection of coins. For simplicity, we will only store the coin names in an ArrayList void addCoin(String coinName)Add a method toString to the Purse class that prints the coins in the purse in the format Purse[Quarter,Dime,Nickel,Dime]Use the following class in your solution: import java.util.ArrayList; Use the following class as your tester class: /** | ||
| Write a method reverse that reverses the sequence of coins in a purse. Use the toString method of the preceding assignment to test your code. For example, if reverse is called with a purse Purse[Quarter,Dime,Nickel,Dime]then the purse is changed to Purse[Dime,Nickel,Dime,Quarter]Use the following class in your solution: import java.util.ArrayList; Use the following class as your tester class: /** |