Csci 717 software construction assignment


CSCI 717 Software Construction Assignment- North Dakota State University

The problems are based on the following Java code, which is part of a sales system that supports a discount. If you use a different programming language, it is your responsibility for the program translation.

public class Sale {
private static double DISCOUNT_RATE = 0.05;
private Vector itemList = new Vector();
public void addItem(Item item) {
itemList.addElement(item);
}
public double getDiscountRate(){
return DISCOUNT_RATE;
}
public double getDiscount(){
return getSubTotal()*getDiscountRate();
}
public double getSubTotal() {
double subTotal = 0.0;
Enumeration items = itemList.elements(); while (items.hasMoreElements()) { Item theNextItem = (Item)nextElement();
subTotal += theNextItem.getItemTotal();
}
return subTotal;
}
public double getDiscountedSubTotal() {
return getSubTotal() - getDiscount();
}
}

Requirements:

Clearly describe the ideas of your program design and refactoring. Copy and paste all the source code, test cases, and testing results as screen shots. Comment your code if necessary. Handwriting answers will not be accepted.

• Complete the Item class to make the program executable. The instance variables of Item should at least include title, (original) unit price, and quantity. Test the program with appropriate test cases.

• Update your program to support different discounts for seniors and preferred customers. Retest your program and add appropriate new test cases. Your program must use switch (case) statement(s).

• Update your program for 2) to support that the senior's discount is only on Tuesday. Retest your program and add appropriate new test cases. Your program must keep the switch (case) statement(s).

• Refactor your program for 3) to eliminate the switch statement(s), and retest your program.

• Update your program for 4) to handle the new discount policy "buy one, get the second (and the rest of the same item) 50% off" for certain items.

Format your assignment according to the following formatting requirements:

1. The answer should be typed, double spaced, using Times New Roman font (size 12), with one-inch margins on all sides.

2. The response also includes a cover page containing the title of the assignment, the student's name, the course title, and the date. The cover page is not included in the required page length.

3. Also include a reference page. The Citations and references should follow APA format. The reference page is not included in the required page length.

Request for Solution File

Ask an Expert for Answer!!
Software Engineering: Csci 717 software construction assignment
Reference No:- TGS03022737

Expected delivery within 24 Hours