Microsoft Visio代写-CS521
时间:2021-06-11
CS521 - Midterm Exam St. Name: ____Manvi_, ___Srujana Shravankumar______ Last Name, First Name Important Notes:  There are 3 questions in the exam paper  Type your answers (NO hand-writing) below every question, and please make sure you distribute your time wisely to cover all questions.  The exam is an individual-work NOT team-work. Please do NOT communicate the exam content in any shape or form to anyone except myself or the TA Your midterm exam is due on Blackboard as a SINGLE PDF document by 11:59pm on Wednesday 6/22/16. Q1. (15 points). (Provide short answers for the following question; a paragraph 5 to 10 lines) 1. The intelligent object-oriented design has to be reusable, flexible, and extensible. Explain. Intelligent design must be designed to super type. Example: This leads to modular design where complex structure is broken down into simpler and manageable units called modules. Modular design is necessary for reusable, extensible and flexible models. Hence we can infer the intelligent object-oriented design is reusable, flexible and extensible. Reusable: If the design is reusable, we reuse design so that you don’t have to test it again. For example, if we are given a choice to design from scratch or use a design which is tested and used, it would any day be better to use a design which is tested and proven to be correct rather than building from scratch. This saves time and increases performance. Flexible: Flexibility provides design with the room to grow, to cater for requirement changes during development and for additional requirements that the users will want in future. Hence, design models have to be flexible. Putting the right amount of flexibility into the design is an important part of the act of designing. Extensible: Extensibility requires the unit of code to not be fragile with respect to changes in the entities with which it interacts: it must neither break when units of code are added or replaced, nor when the data that it manipulates is moved. Hence, a good design model has to be extensible in order to accommodate changes without effecting the existing model. 2. Explain the difference between Requirement Analysis and Requirement Specifications. Requirement specification is the invention and definition of the behavior of a new system (solution domain) such that it will produce the required effects in the problem domain. We come up with the problem in requirement specification. We start from a knowledge of the problem domain and the required effects determined by elicitation and analysis and come up with the specification document. Requirement analysis is the understanding of the problem. Our goal during requirements analysis is to understand “what” the customer “needs” us to build. We build a model of the application and validate that our model will actually meet the customer’s needs. The process of studying and analyzing the customer and the user needs to arrive at a definition of the problem domain and system requirements is called requirement analysis. 3. Software is composed of two primary elements: structure and behavior, name at least one UML notation that could be used to capture each element. Structure diagrams are not utilizing time related concepts, do not show the details of dynamic behavior. Class diagram is a static structure diagram which describes structure of a system at the level of classifiers (classes, interfaces, etc.). It shows some classifiers of the system, subsystem or component, different relationships between classifiers, their attributes and operations, constraints. Other structure diagrams include object diagram, package diagram, Model diagram etc. Ex: AccountSpecialist -accountSpecialistName : string -accountSpecialistID : int -address : string -email : string -phoneNo : int +createCustomerAcct() +editCustomerAcct() +createIncidentTicket() +placesOrderPPV() Technician -TechSupportID : int -TechSupportName : string -address : string -email : string -phoneNo : int +getIncident() +scheduleIncidentTicket() +cancelIncidentTicket +closeIncidentTicket() RentGamesOnline -GameID : int -GameName : string -Type : string InternetPlan -PlanID : int -PlanName : string -PlanType : string PPVEvents -EventID : int -EventType : string -EventName : string +getEventType() +getEventName() PPVLiveSports -EventID : int -EventName : string -EventType : string TV plan -PlanID : int -PlanName : string +getHDBox() Manager -managerID : string -managerName : string -address : string -email : string -phoneNo : int +login() +cancelOrder() +updateOrder() +deleteOrder() Orders -OrderID : int -CustomerID : int +getOrderDetails() +getOrderProducts() Product -ProductID -ProductName -ProductType +displayProducts() CustomerAccountInfo -firstName : string -lastName : string -email : string -Address1 : string -Address2 : string -phone : int -city : string -state : string -zipcode : string +getAccountDetails() PayMonthlyBill -CustomerID : int -TotalAmount : int -CardNo : int +makePayment() HighDefinitionBox needs has PPVMovies -EventID : int -EventType : string -EventName : string 1..* 1..* 0..* edits -BoxID : int -BoxName : string updates Assigns 1..* n Has Privileges Places n n 0..* 1..* 1..* creates 0..* 0..* Customer -customerID : int -customerName : string -address : string -email : string -phoneNo : int +login() +payMonthlyBill() +getOrders() +updateRecord() Behavior diagrams show the dynamic behavior of the objects in a system, which can be described as a series of changes to the system over time Sequence diagram is the most common kind of interaction diagrams, which focuses on the message interchange between lifelines (objects). Other Behavior diagrams include use case diagram, activity diagram, timing diagram etc. Ex: :Ticket:AccountSpecialist Technician:Schedule CreateIncidentTicket() [Created] AssignIncidentTicket() [Assigned] ScheduleIncidentTicket() CloseIncidentTicket() CancelIncidentTicket() [TicketScheduled] [TIcketClosed] [TIcketCancelled] loop For each of the incident ticket created 4. Which mechanism you should favor to use in producing your design: Inheritance or Composition? Is a relationship between extensibility and inheritance? Is a relationship between flexibility and composition? Explain. Favor object composition over class inheritance. It gives design higher flexibility. In other words, HAS-A can be better than an IS-A relationship. Initial design is simplified by identifying system object behaviors in separate interfaces instead of creating a hierarchical relationship to distribute behaviors among business-domain classes via inheritance. This approach more easily accommodates future requirements changes that would otherwise require a complete restructuring of business-domain classes in the inheritance model. Additionally, it avoids problems often associated with relatively minor changes to an inheritance- based model that includes several generations of classes Extensibility is inheritance where in you can add new requirements as an extension to the existing model. Flexibility is extensibility. Flexibility is when you can make changes to the existing system without effecting it. Hence composition provides this facility and leads to flexibility of the design. 5. Explain the difference between the Observer design pattern and MVC architectural pattern. Observer Design Pattern: Observer pattern is used when there is one-to-many relationship between objects such as, if one object is modified, its dependent objects are to be notified automatically. Observer pattern falls under behavioral pattern category. Intent:  Define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically.  Encapsulate the core (or common or engine) components in a Subject abstraction, and the variable (or optional or user interface) components in an Observer hierarchy.  The "View" part of Model-View-Controller. Observer pattern uses three actor classes. Subject, Observer and Client. Subject is an object having methods to attach and detach observers to a client object. We have created an abstract class Observer and a concrete class Subject that is extending class Observer. Model-View-Controller: Intent: Model–view–controller (MVC) is a software architectural pattern for implementing user interfaces on computers. It divides a given software application into three interconnected parts, so as to separate internal representations of information from the ways that information is presented to or accepted from the user. The central component of MVC, the model, captures the behavior of the application in terms of its problem domain, independent of the user interface.  The model directly manages the data, logic and rules of the application.  A view can be any output representation of information, such as a chart or a diagram. Multiple views of the same information are possible, such as a bar chart for management and a tabular view for accountants.  The third part, the controller, accepts input and converts it to commands for the model or view. Q2. (35 points) A retailer sells software games, accessories, devices, and consoles for a number of gaming platforms: Xbox, Wii, and PlayStation. The games have three rating categories: EveryOne, Teen, and Mature. The retailer would like you to build an object-oriented application that will meet the following requirements: High-Level Requirements: Consider the following high-level description for the retailer:  The intent is to build an application that will allow customer to buy/trade-in products from the retailer either in-store or online  The store has a StoreManager, Customers, and Salesmen  The retailers sells new and pre-owned different game consoles, games, and tablets  The StoreManager can Add/Delete/Update products  Salesman can create Customer accounts  There are 3 Console Manufacturers and each offers its own models: 1. Microsoft 1. XBOX One 2. XBOX 360 2. Sony 1. PS3 2. PS4 3. Nintendo 1. Wii 2. WiiU  There are 3 Game Makers 1. Electronic Arts 2. Activision 3. Take-Two Interactive  Every console might have accessories that could be bought separately  Retailer offers warranty that can be purchased by the customer for every console  The customer can pre-order products  The customer can trade-in products  The customer can place an order online, check the status of the order, or cancel the order.  The customer can pay in cash, check, or credit card  The customer has the choice to enroll (or cancel) and become Power Member in order to receive 5% discount for every item purchased for an annual fee of $100  Some of the products may have store special-discounts  Some of the products may have manufacturer rebates  The customer can choose one of the following options when buying a new console 1. Buy the new console with no replacement 2. Buy the new console with 1 year replacement for 50% fee of the console retail price; under this plan the customer can replace the console by a new one any time during the year (The console can be replaced only once for the customer). 3. Buy the new console with lifetime replacement for 65% fee of the console retail price; under this plan the customer can replace the console by another new one any time (The console can be replaced only once for the customer).  The customer can rent a console. However, there are a number of lease plans that the store like to offer its customers 1. Daily rental (for example renting the console for 2 days) 2. Monthly rental (for example rent the XBOX ONE console for 2 months with rental $20/month) 3. Yearly rental (for example rent the XBOX ONE console for $100/year) Provide your answers for the following: 1. Domain Dictionary 2. Analysis Class Diagram 3. Design Class Diagram 4. Object Data Model Domain Dictionary: Name Type Description Store Manager Role The store manager Adds, deletes and updates products. Add Product Process The process of adding new product. Performed by Store Manager. Delete Product Process The sequence involved in deleting a product. Performed by Store Manager Update Product Process The process of updating the product. Performed by the Store Manager Product Object The product which is added, deleted or updated. Choose Gaming Platform Process The process choosing one of the platforms: Xbox, Wii, and PlayStation. Store Management Function Act of adding, deleting, and updating a product by the store Manager. Platform Object The platform chosen as a result of choose gaming platform. Choose Rating Category Process The process of choosing rating category: Everyone, Teen, and Mature. Category Object The category chosen as a result of the choose rating category process. Customer Role Buys/trades-in products from the retailer either in-store or online. Salesmen Role Creates customer account. Create customer account Process The process involved in order to create an account for the customer. Performed by the Salesmen. Account Object The account number associated with a particular customer. Retailer Role Retailer sells software games, accessories, devices, and consoles for a number of gaming platforms. Retailer Management Function The act of selling new and pre- owned different game consoles, games, and tablets by the retailer Sell Products Process The process of selling various products. Performed by the Retailer. Offer Warranty Process Retailer offers warranty that can be purchased by the customer for every console. warranty Object The warranty period offered by the retailer. Pre order products Process The process of pre-ordering the products. Performed by the Customer. Order Object The order number associated with product. Trade in products Process The process of trading in products. Performed by the Customer Place order online Process The process of placing an order online. Performed by the Customer Check Order Status Process Sequence of actions involved in Checking the order status. Performed by the Customer. Status Object The status of the order. Cancel Order Process The process of cancelling the order. Performed by the Customer. Bill Payment Process The actions involved in making bill payment. Performed by the Customer Payment Receipt Object The receipt associated with the bill payment. Enroll for Power member Process Enrolling the customer as power member. Enrollment Object The enrollment ID associated with the power member. Cancel enrollment Process The process of cancelling the enrollment. Apply Store Special Discounts Process The process of applying the discount associated with the store. Discounted price Object The price after applying the discount. Apply manufacturer rebate Process Applying the manufacturer rebate Buy new console Process Sequence of steps involved in buying new console. Performed by the customer Apply replacement period Process Process of applying replacement period. Performed by the customer. Replacement Object The replacement period chosen as a result of apply replacement period process. Rent console Process The process of renting console. Performed by the customer. Rent Object The rented console associated as a result of rent console process. Apply rental Plan duration Process The process of choosing rental plan duration. Duration Object The duration associated with the plan as a result of applying rental plan duration. Analysis Class Diagram: Store Manager Customer Retailer CustomerAccount Products Order Store Games Tablets GameConsoles Accessories Power Member Inventory Salesmen 1 0..* Has privileges n 1 creates 1 1 has 1..* 0..* places/access 0..* 1 purchases 1 0..* sells Bill 1..* 1..* Pays 0..* Rent 1..* 1 n offers warranty In-store Customer Online Customer Design Class Diagram: Store Manager -managerID : int +addProduct() +deleteProduct() +UpdateProduct() Customer -custID : int +getCustomerDetails() : void +enrollPowerMember() : Boolean +rentConsole() : GamesConsoles Retailer -retailerID : int -retailerProductType : String +getRetailerDetails : Retailer CustomerAccount -CustID: int -custName: String -username: String -password: String -DOB: Date -email : String +getAccountDetails() : CustomerAccount Products -productID : int -price : double -productType : String Order -orderID : int -custID : int -orderDate : Date -deliveryDate : Date -orderDetails : List










































































































































































































































































































































































































































































































































































-totalAmount : double
Store
-StoreID: int
-storeName : String
+getStoreDetails()
Games
+chooseRatingCategory() : double
Tablets
GameConsoles
+chooseReplacementOption()
+chooseLeasePlans()
+getAccessories()
Accessories
Power Member
-discountPercentage : int
+applyDiscount() : int
Inventory
-numberOfproducts : int
-productsPerCategory : int
+getNumberOfProducts() : int
+getNumberOfTypes() : int
+setNumberOfProducts() : void
+setNumberOfTypes() : void
Salesman
+createAccount() : Boolean
1
0..*
Has privileges
n
1
creates
1
1
has
1..*
0..*
places/access
0..*
1
purchases
1
0..*
sells
+getOrderDetails() : void
1..*
1..*
Pays
0..*
Rent
1..*
1
n
offers warranty
In-store Customer
+tradeProduct() : Products
+preorderProducts() : Products
Online Customer
-custID: int
-username : String
-password : String
+login() : void
+logout() : void
+placeOrder() : Order
+checkStatus : String
+cancelOrder() : Order
+getProductDetails() : Products
+getRetailerDetsils() : Retailer
+getProductType() : Products
+applyStoreSpecialDiscount() : Boolean
+applyManufacturerRebate() : Boolean
Bill
-orderID : int
-grandTotal : double
-paymentMethod : String
+getBilling Details() : Bill
+validatePayment() : Boolean
-staffID : int
















Object Data Model:


Bill
-memberName
-memberName
Order
-memberName
-memberName
Products
-memberName
-memberName
Retailer
-memberName
-memberName
Customer
-memberName
-memberName
Salesman
-memberName
-memberName
StoreManager
-memberName
-memberName
One
Many
One
Many
One
Many
One
Many
Many
Many
Many
Many
Many
Many

Q3. (50 points). Waiters and waitresses at the Royal Casino’s main dining room in Las Vegas use
handheld, radio-frequency devices to take diners’ orders and relay the orders to the kitchen. The data
entry devices weigh just a few ounces and open like a wallet to reveal a keypad and a small screen.
The devices are connected by radio signal to the dining room’s computer. As diners place their orders,
the device prompts the waiter through the order. For instance, if the customer asks for a sirloin steak,
the system asks the waiter to choose a key corresponding to the desired degree of doneness (i.e., rare,
medium rare, and so forth).



There are different menus to choose from: vegetarian, sea-food, white-meat, and red-meat. The
customer can order appetizers as well, from the two choices soup or salad. The restaurant offers
three types of deserts: chocolate pie, cheesecake, strawberry shake.

When the customer has completed ordering, the waiter hits a key to indicate that fact. The system
prints or displays the incoming order for cooks in the kitchen. When the dining party has finished
its meal, the waiter indicates this fact by pressing the appropriate key on the handheld device. The
system communicates, over conventional wiring, with a point-of-sale (POS) computer at the cash
register station, which prints out a guest check. At this time, the system also records the sales event
data on the host computer. Customer can pay through credit card or cash. Regular tip for the
waitress is 16% of the order total for family/friends gathering, and it is 20% for corporate-event
gatherings. Customers might have discount coupons and might subscribe with Royal Casino to
receive discount coupons

Based on the description listed above, provide your answers for the following:

1. Actor Dictionary
2. Domain Dictionary
3. Use-Case Diagram
4. Analysis Class Diagram
5. Design Class Diagram
6. Object Data Model
7. Sequence diagram for placing an order

Domain Dictionary:

Name Type Description
Customer Role The customer places the food
order using the device.
Choose menu Process The process of choosing
vegetarian, sea-food, white
meat or red meat.
Choose food items Process The process of choosing the
food items in the menu. This is
performed by the customer.
Choose appetizers Process The process of choosing from
two choices soup or salad.
Choose desert Process The process of choosing
chocolate pie, cheesecake
or/and strawberry shake.
items objects The food items chosen by the
customer
Ordering food Function The act of choosing menu,
appetizers and/or desert in
order to place food order.
Performed by customer with
the help of waiters.
Handheld Device Role Takes diners order and relays
orders to the kitchen.
Relay order to kitchen Process The action of pressing
appropriate key on the
handheld device which will
relay the order to the Dining
computer. Performed by the
waiter
Waiter Role The waiter is prompted by the
device through the orders after
the diners have placed their
order.
Place order Process The waiter confirms the order
by pressing the appropriate key
on the hand held device.
Order Object The order number associated
with a particular customer.
Dining computer Role Displays or prints the incoming
order for the cooks in the
kitchen.
Receive order Process The process of receiving the
incoming order relayed by the
waiter. Performed by the dining
computer.
POS computer Role Prints out a guest check after
the waiter presses appropriate
key on the handheld device
indicating the dining party has
finished their meal.
Print check Process The communication between
the handheld device and the
POS computer initiated by the
waiter after the diners are
finished with the meal.
Check Object The check printed by the POS
computer
Pay tip Process The process of paying 16% or
20% of the order.
Tip Object The amount payed as tip by the
customer.
Record sales Process The process of recording the
total sales by the order on the
host computer.
Sales Object The total sales recorded in the
host computer.
Apply coupon Process The process of using the
discount coupon to pay the bill.
Coupon Object The discount offer which the
customer can avail



Actor Dictionary:


Actor Description Abstract Use case(s)
Customer The customer places
the food order using
the device.
Place Order

Make Payment

Apply discount coupon

Pay Tip

Device Takes diners orders
and relays the orders to
the kitchen
Take Order

Relay to kitchen

Communicate with
POS computer

Waiter The waiter is prompted
by the device through
Choose appropriate
key
the orders after the
diners have placed
their order.

Dining computer Displays or prints the
incoming order for the
cooks in the kitchen.
Display incoming
order

Print incoming order

Cook(s) Looks into the
incoming order and
prepares accordingly.

Prepare food
POS computer Prints out a guest
check after the waiter
presses appropriate
key on the handheld
device indicating the
dining party has
finished their meal.
Print check




























Use case Diagram:



Customer
Waiter/waitress
Handheld Device
Dining Computer
Chef
POS Computer
place order
make payment
apply discount couponSubscribe with RoyalCasino
pay tip
Order
relay to kitchen computer
communicate with POS computer
choose appropriate key
Display/print incoming Order
Prepare food ordered
print check
Listen to handheld device
<>
<>
<>
<>
<>
<>
<>
<>
<>
gathering type
family/friends
corporate-event
<>











Analysis class diagram:

Customer
Dining Computer
Waiter
Cook
Order
POS computer
Handheld device
Discount Coupon
1..*
1
1..*
1
places order
FoodItems
MenuType
Appetizers Deserts
reads/prints order
1
n
communicates
1
1..*
chooses items
Bill Payment
1
1
makes
CreditCard
Cash





Design Class Model:



Customer
-customerID: int
-typeOfGathering: String
+chooseItems() : FoodItems
+giveTips(): int
+subscribe(): Boolean
Dining Computer
+receiveOrder() : Order
+displayOrder() : Order
Waiter/waitress
-customerID: int
+placeOrder() : Order
Order
-orderID : int
-customerID: int
-foodItemID : int
-totalAmount : double
-typeOfGathering: String
+getOrderDetails() : Order
POS computer
-orderID: int
+generateCheck()
Handheld device
-orderID : int
+sendOrderDetails()
+signalToGenerateCheck()
+recordSalesData()
+getTypeOfGathering()
Discount Coupon
-discountPercentage: int
-grandTotal: int
+applyDiscount() : Boolean
1..*
1
communicates
1..*
1
FoodItems
-foodItemID : int
+getFoodItems() : FoodItems
MenuType
Appetizers Deserts
1
n
communicates
1
1..*
chooses items
Bill Payment
-grandTotal: int
+makePayment(): int
+validatePayment(): Boolean
1 1makes
creditcard
-cardNo:int
-nameOnCard: String
-cardType: String
-expiryDate: Date
cash




Object Design Model:


Order
-memberName
-memberName
FoodItems
-memberName
-memberName
devices
-memberName
-memberName
Customer
-memberName
-memberName
payment
-memberName
-memberName
waiter/waitress
-memberName
-memberName
DiscountCoupon
-memberName
-memberName
one
one
Many
Many
one
oneone
Many
Many
ManyMany
one
Chef
-memberName
-memberName
Many
one
Many
One
Tip
-memberName
-memberName
One
One



Sequence Diagram:


:Customer
:Waiter/
Waitress
:Handheld device
Dining
Computer
chooseItems()
promptWaiter()
askCustomerChoice()
[itemschose]
sendOrderDetails()
[orderDisplayed]
Choose
pressConfirmationKey()
[orderplaced]
displayOrder()
[OrderPlaced]


学霸联盟


essay、essay代写