Now, as we've made enough preparation, let's co-operate with each other and do something fun!
In this phase your company is going to make real business. You are going to make profits! The web-services you've already set up can sell products to your customers. Meantime, you'll collect commodity information for your customers as well.
You will learn how to create a complex web service client through this project. And you'll have fun to run your business.
This phase in divided into 2 parts:
Provide another web service for book information transmission that can accept some basic information on books from the book provider, and update your database accordingly. The formal description of the web service is:
struct commodityTransInfo{
string ISBN, // book ISBN, given in a string
string title, // book title or music album name
string category, // the category of the book
string author, // the first author of the book
float weight, // book weight, it may be needed to compute the shipping cost, NEW
float suggestedPrice, // suggested book selling price. You can choose your own price based on it
float cost, // the cost of selling each book. That's the cost you buy the book from the provider, plus some other minor costs
int maximalQuan // the maximal number of books you can get from the provider. The total quantity in stock at your warehouses should not exceed that
}struct commodityTransInfoArray{
int size, // the size of the array
commodityTransInfo cInfo[]
}
public void acceptCommodityInfo(commodityTransInfoArray ctInfo)
Note that besides the basic information of the book/CD, you are provided a cost and a suggested price. Cost is the cost to sell each book, including the price of buying the book/CD from the provider and other operating cost. It is fixed and the same to all companies. Suggested price is the price we suggest on selling each book/CD. You can give your own price and discounts based on that. Obviously, the higher the price, the more you earn for each book. But consequently, you may not get a large number of orders.
For each item, you can decide how many to get from the provider. However, you cannot get more than the maximal quantity.
Besides the web services you provided in Phase II, now you are expected to add 3 more web services.
struct commoditySaleInfo{
string company
int quantity,
float price,
float discount
}struct commoditySaleInfoArray{
int size,
commoditySaleInfo comm[]
}
public commoditySaleInfoArray saleInfoCollection(
int commodityType, // type = 0 - book; 1 - CD
string title // book title or music album name
)
struct transactionInfo{
string companyName, // From which company you buy this book? (this should also include your own company)
int quantity, // How many books you buy from that book?
float buyPrice, // What is the price you buy the books from that company? It should be the price provided by the company
float sellPrice, // What is the price you sell the books to your customers? It may include the service fee you get as an agency; if the company is your own company, it should equal the buyPrice.
string invoiceNo // What is the invoice no.?
}struct transactionInfoArray {
int size,
transactionInfo saleReport[]
}public transactionInfoArray transactionAsAgency(
int commodityType, // type = 0 - book; 1 - CD
string title, // book title or music album name
int quantity, // quantity to buy
string shippingCompanyName, // shipping company name
string shippingMethodType, // shipping method
int deliveryYear, // delivery time
int deliveryMonth,
int deliveryDate,
string deliveryInstruction, // special delivery instruction
string shippingCustormerName, // shipping customer info
string shippingCustormerPhone,
string shippingCustormerEmail,
string shippingAddrStreet,
string shippingAddrCity,
string shippingAddrState,
string shippingAddrZip,
string billingCustomerName, // billing customer info
string billingCustomerPhone,
string billingCustomerEmail,
string billingAddrStreet,
string billingAddrCity,
string billingAddrState,
string billingAddrZip,
string paymentMethod, // payment method
string creditCardType, // credit card info
string creditCardNo,
int creditCardExpirationYear,
int creditCardExpirationMonth
)
struct businessPerformance{
string title, // book title
int soldQuan, // how many you've sold out
float sellingPrice, // the selling price (after discount) of your own books
float totalCost, // how much do you spend on buying those books from providers (for those books you've sold out) and from other companies as an agency
float totalProfit, // how many profits do you gain on selling your own books and acting as agencies
}struct businessPerformanceArray{
int size,
businessPerformance perf[],
float totalProfit
}
public businessPerformanceArray businessReport()
This will be updated Friday November 21, 2003