CS 141 Saudi electronic university Interface Java Coding Case Study
College of Computing and InformaticsAssignment 1
Deadline: Sunday 14/02/2021 @ 23:59
[Total Mark for this Assignment is 5]
Student Details:
Name: ###
ID: ###
CRN: ###
Instructions:
•
•
•
•
•
•
•
•
•
•
You must submit two separate copies (one Word file and one PDF file) using the Assignment Template on
Blackboard via the allocated folder. These files must not be in compressed format.
It is your responsibility to check and make sure that you have uploaded both the correct files.
Zero mark will be given if you try to bypass the SafeAssign (e.g. misspell words, remove spaces between
words, hide characters, use different character sets or languages other than English or any kind of
manipulation).
Email submission will not be accepted.
You are advised to make your work clear and well-presented. This includes filling your information on the cover
page.
You must use this template, failing which will result in zero mark.
You MUST show all your work, and text must not be converted into an image, unless specified otherwise by
the question.
Late submission will result in ZERO mark.
The work should be your own, copying from students or other resources will result in ZERO mark.
Use Times New Roman font for all your answers.
Question One
Pg. 01
Learning
Outcome(s): LO1
Instructors:
Outline concepts
such as
inheritance,
polymorphism
and reusability
with special
emphasis on
object oriented
programming.
Question One
2.5 Marks
Write a java program that make use of the following interfaces and classes to
display the steps one should follow to prepare tea, coffee, and warm milk.
Classes:
1- A class called ‘Tea’ to prepare tea.
2- A class called ‘Coffee’ to prepare coffee.
3- A class called ‘WarmMilk’ to prepare warm milk.
Interfaces:
12345-
‘Pot’ has void FillPot(); method signature.
‘Stove’ has void PutOnStove(); method signature.
‘Cup’ has void PourIntoCup();method signature.
‘Boil’ has void BoilPot(); method signature.
‘HeatWithoutBoil’ has void JustHeat(); method signature.
To prepare tea or coffee, one should make sure that cold water and tea or
coffee is mixed into the pot, boiled, and then it should be poured in cup.
To prepare warm milk, one should pour cold milk into a pot, heat the milk
without reaching its boiling point. Then, pour the milk in a cup.
Make sure that you only use the interfaces that are appropriate for each class.
For example, the ‘Tea’ class will only implement pot, stove, cup, boil
interfaces.
Question One
Pg. 02
Use a tester class to print the following output:
Question Two
Pg. 03
Learning
Outcome(s): LO1
Instructors:
Outline concepts
such as
inheritance,
polymorphism
and reusability
with special
emphasis on
object oriented
programming.
Question Two
1 Mark
When formal development processes were first established in the early 1970s,
software engineers had a very simple visual model of these phases. They
assumed that one phase would run to completion, its output would spill over to
the next phase, and the next phase would begin. This model is called the
waterfall model of software development. In your own words, write any five
disadvantages of using this model.
Question Three
Pg. 04
Learning
Outcome(s): LO3
Instructors:
Design and
implement
programs using
object oriented
programming
concepts such as
encapsulation,
inheritance,
polymorphism,
abstract classes
and methods.
Question Three
0.5 Marks
Can a derived class (i.e., Subclass) directly invoke a private method of the
base class (i.e., Super class)? Explain your Answer.
Question Four
Pg. 05
Learning
Outcome(s): LO3
Instructors:
Design and
implement
programs using
object oriented
programming
concepts such as
encapsulation,
inheritance,
polymorphism,
abstract classes
and methods.
Question Four
1 Mark
Draw an Inheritance hierarchy for students at a university similar to the hierarchy
as shown in the Figure below.
Figure: Inheritance hierarchy for university CommunityMember
Use Student as the superclass of the hierarchy, then extend Student with
classes UndergraduateStudent and GraduateStudent. Continue to extend the
hierarchy as deep (i.e., as many levels) as possible. For example, Freshman,
Sophomore, Junior and Senior might extend UndergraduateStudent.
DoctoralStudent and MastersStudent might be subclasses of GraduateStudent.
After drawing the hierarchy, discuss the relationships that exist between the
classes.
[Note: You do not need to write any code for this question]
Pg. 06
Question Four
Top-quality papers guaranteed
100% original papers
We sell only unique pieces of writing completed according to your demands.
Confidential service
We use security encryption to keep your personal data protected.
Money-back guarantee
We can give your money back if something goes wrong with your order.
Enjoy the free features we offer to everyone
-
Title page
Get a free title page formatted according to the specifics of your particular style.
-
Custom formatting
Request us to use APA, MLA, Harvard, Chicago, or any other style for your essay.
-
Bibliography page
Don’t pay extra for a list of references that perfectly fits your academic needs.
-
24/7 support assistance
Ask us a question anytime you need to—we don’t charge extra for supporting you!
Calculate how much your essay costs
What we are popular for
- English 101
- History
- Business Studies
- Management
- Literature
- Composition
- Psychology
- Philosophy
- Marketing
- Economics