01.02.2013 Views

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Now implement the code to make your test pass. Remember, you just<br />

want the simplest code possible to get the test passing.<br />

public class OrderInformation {<br />

}<br />

private String customerName;<br />

private String drinkDescription;<br />

private int giftCardNumber;<br />

private int preferredStoreNumber;<br />

public void setCustomerName(String name) {<br />

customerName = name;<br />

}<br />

public void setDrinkDescription(String desc) {<br />

drinkDescription = desc;<br />

}<br />

public void setGiftCardNumber(int gcNum) {<br />

giftCardNumber = gcNum;<br />

}<br />

public void setPreferredStoreNumber(int num) {<br />

preferredStoreNumber = num;<br />

}<br />

public String getCustomerName() {<br />

return customerName;<br />

}<br />

public String getDrinkDescription() {<br />

return drinkDescription;<br />

}<br />

public int getGiftCardNumber() {<br />

return giftCardNumber;<br />

}<br />

public int getPreferredStoreNumber() {<br />

return preferredStoreNumber;<br />

}<br />

Download at WoweBook.Com<br />

This class is really just a few member<br />

variables, and then methods to get<br />

and set those variables.<br />

Is there anything less you could do<br />

here and still pass the test case?<br />

test-driven development<br />

OrderInformation<br />

- customerName : String<br />

- drinkDescription : String<br />

- giftCardNumber : int<br />

- preferredStoreNumber : int<br />

+ setCustomerName(name : String)<br />

+ setDrinkDescription(desc : String)<br />

+ setGiftCardNumber(gcNum : int)<br />

+ setPreferredStoreNumber(num : int)<br />

+ getCustomerName() : String<br />

+ getDrinkDescription() : String<br />

+ getGiftCardNumber() : int<br />

+ getPreferredStoreNumber() : int<br />

you are here 4 285

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!