The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Computer Programming II (CS141)Assignment 1•Deadline: Saturday 20/02/2016 at 11:59 pm•Submission has to be made via the submission folder assigned by your Instructor onBlackboard.•No Email Submission will be accepted.•Late submission will result in ZERO marks.•Identical work will result in ZERO marks.•This Assignment worth 5 marks.Q1. In the waterfall model and a programmer at the implementation stage noticed thedesign need to be changed to have high performance software. Would it be possible tochange or add some specifications, justify your answer?(0.5 Marks)Q2. Can you convert a superclass reference into a subclass reference?A subclass referenceinto a superclass reference?If so, give examples.If not, explain why not.(0.5 Marks)Q3. Draw the state machine diagram for the following scenario?Consider a copy of book in a library that can go through several states: available, on loan,reserved, etc. Suppose, for simplicity, we put reservations on a copy rather than a book.(1 Mark)Q4. Write the code to declare the trivial class inside a method?(1 Mark)Q5.Consider the following problem description and write java code.(2 Marks)A.Consider a superclass PurchaseItem which models customer’s purchases. This class has:1.Two private instance variables name and unit price.2.One constructor to initialize the instance variables.3.A default constructor to initialize name to “no item”, and unit price to 0.4.A method that returns the price.5.A toString method to return the name of the item followed by @ symbol, then the unitprice.
Attachments:
-----------