Welcome to the Most Reliable, Essay Writing Service on the internet


Mar 23

omputer 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 on
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 the
design need to be changed to have high performance software. Would it be possible to
change or add some specifications, justify your answer?
(0.5 Marks)
Q2. Can you convert a superclass reference into a subclass reference? A subclass reference
into 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 unit

B. Consider two subclasses WeighedItem and CountedItem. WeighedItem has an additional
instance variable weight while CountedItem has an additional variable quantity.
1. Write an appropriate constructor for each of the classes making use of the constructor of
the superclass in defining those of the subclasses.
2. Override getPrice method that returns the price of the purchasedItem based on its unit
price and weight (WeighedItem), or quantity (CountedItem). Make use of getPrice of the
3. Override also toString method for each class making use of the toString method of the
superclass in defining those of the subclasses.
4. toString should return something that can be printed on the receipt.
For example
Banana @ 3.00 1.37Kg 4.11 SR (in case of WeighedItem class)
Pens @ 4.5 10 units 45 SR (in case of CountedItem class)
C. Write an application class where you construct objects from the two subclasses and print
them on the screen.



The Service Is Okay. I won’t Complain

The writers on the website are courteous and the customer service responds quickly. My paper was handled well; They promised...

Writers here are very professional and are native British

Thanks a lot for helping me out with my PhD Thesis, Writers here are very professional and are native British!!

Jack, The United Kingdom

Very Very Helpful, and On time.

Very Very Helpful, and On time.

Adelio M, Spain

I scored complete A’s in 3 out of four courses

I scored complete A’s in 3 out of four courses

Anonymous, Illinoi Chicago

CLICK HERE  To order your paper

About Essaysmiths Assignment writing service

We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.

How It Works

To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.

Are there Discounts?

All new clients are eligible for upto 20% off in their first Order. Our payment method is safe and secure.

 CLICK HERE to Order Your Assignment


Get access to cheap essays online, and forget about all your worries

Quality assurance

When we accept your assignment order, we treat it with the utmost seriousness. This means that only the best experts will conduct research on your topic and that they will deliver your paper only after making sure that it is insightful.

Total confidentiality

We use the SSL protocol to ensure that all the details of our customers are 100% safe and secure. So, forget about all worries when sharing personal information on our site. We never disclose the details of our clients.

All round service

24/7 customer support. We don’t want you to fail to submit your paper. So, we work 24 hours a day and 7 days a week to provide you with instant feedback.

Original Essays

One of the key principles of our work is to be creative and original. We hire only talented and experienced essay writers that are able to create authentic papers. Each regular essay or term paper is written from scratch in accordance with all your guidelines.

Cheap Service

Compared to our competitors, we offer a relatively cheap service. We allow you the comfort of a cheap paper writing service to improve your grades. If you are facing an academic problem, we’ll solve it by asking for a fair price.

Rocket fast Essay writing service

Don’t worry! We work in a timely manner to deliver orders before the due date. You’ll have enough time to check whether the finished paper corresponds to all your requirements. If not, provide us with feedback and ask for a revision.

Order Your Essay Today From  reliable Essay writing Service.

Order your Assignment today and save 15% with the discount code ESSAYHELP