Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2010 JBoss Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 * Copyright 2005 JBoss Inc
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * See the License for the specific language governing permissions and
 * limitations under the License.

This represents a policy that a driver is applying for. Obviously in the real world, there are actuaries to mess things up, but lets just pretend there is some simple base price and discount that we can calculate with relatively simple rules !

Michael Neale
public class Policy {
	private String type = "COMPREHENSIVE";
	private boolean approved = false;
	private int discountPercent = 0;
	private int basePrice;
	public boolean isApproved() {
		return ;
	public void setApproved(boolean approved) {
		this. = approved;
	public int getDiscountPercent() {
	public void setDiscountPercent(int discountPercent) {
		this. = discountPercent;
	public String getType() {
		return ;
	public void setType(String type) {
		this. = type;
	public void applyDiscount(int discount) {
		 += discount;
	public int getBasePrice() {
		return ;
	public void setBasePrice(int basePrice) {
		this. = basePrice;
New to GrepCode? Check out our FAQ X