Prog6112tc THT
Prog6112tc THT
19; 20; 21; 22 2022
MODULE NAME: MODULE CODE:
PROGRAMMING 1B PROG6112
ASSESSMENT TYPE: TAKE‐HOME TEST (PAPER ONLY)
TOTAL MARK ALLOCATION: 60 MARKS
TOTAL TIME: 21 Hours (midnight to 9PM on the same day)
By submitting this assessment, you acknowledge that you have read and understood all the rules
as per the terms in the registration contract, in particular the assignment and assessment rules in
The IIE Assessment Strategy and Policy (IIE009), the intellectual integrity and plagiarism rules in
the Intellectual Integrity Policy (IIE023), as well as any rules and regulations published in the
student portal.
INSTRUCTIONS:
1. Please adhere to all instructions. These instructions are different from what is normally
present, so take time to go through these carefully.
2. Independent work is required. Students are not allowed to work together on this
assessment. Any contraventions of this will be handled as per disciplinary procedures in The
IIE policy.
3. No material may be copied from original sources, even if referenced correctly, unless it is
a direct quote indicated with quotation marks.
4. All work must be adequately and correctly referenced.
5. You should paraphrase (use your own words) the concepts that you are referencing, rather
than quoting directly.
6. Marks will be awarded for the quality of your paraphrasing.
7. This is an open‐book assessment.
8. Assessments must be typed unless otherwise specified.
9. Ensure that you save a copy of your responses.
9.1. Complete your responses in a Word document.
9.2. The document name must be your name.student number.Module Code.
9.3. Once you have completed the assessment, upload your document under the
submission link in the correct module in Learn.
Additional instructions:
Calculators are allowed
Answer All Questions.
© The Independent Institute of Education (Pty) Ltd 2022
Page 1 of 7
18; 19; 20; 21; 22 2022
1. ASSESSMENTS WRITTEN AT HOME:
a) No material may be copied from original sources, even if referenced correctly, unless
it is a direct quote indicated with quotation marks.
b) All work must be adequately and correctly referenced.
c) You should paraphrase (use your own words) the concepts that you are referencing,
rather than quoting directly.
d) This is an open‐book assessment.
e) Assessments must be typed unless otherwise specified.
f) Ensure that you save a copy of your responses.
i. Complete your responses in a Word document.
ii. The document name must be your.student number.Module Code.
iii. Once you have completed the assessment, upload your document under the
submission link in the correct module in Learn.
© The Independent Institute of Education (Pty) Ltd 2022
Page 2 of 7
18; 19; 20; 21; 22 2022
Question 1 (Marks: 30)
Write a Java application to print the number of hospital health inspections performed at three (3)
different hospitals over three (3) months. The following table represents the hospitals and the
number of inspections per month:
JAN FEB MAR
Hospital 1 4 8 6
Hospital 2 5 4 2
Hospital 3 4 2 8
Using single and two‐dimensional arrays, produce the hospital inspection report and include each
hospital's average monthly inspection and totals.
Sample screenshot
© The Independent Institute of Education (Pty) Ltd 2022
Page 3 of 7
18; 19; 20; 21; 22 2022
1‐4 0
5‐9
10
Single and Single and
Declaring and
Single and two‐ two‐
Single and
Populating Arrays two‐ dimensional dimensional
two‐
Declaration and dimensional arrays were arrays were
dimensional
populating a single arrays were arrays were not declared not declared
declared and or declared or declared
and two‐ declared and
populated incorrectly, incorrectly,
dimensional array. populated
with one or and the and the
without any
two minor populated populated
errors.
errors. arrays had arrays had
many errors. many errors.
3‐4
5 1‐2
0
The report
Output The report The report
displays or
Printing of rows displays or has major There is no
prints some
and columns in the prints all the errors and report of
rows and
rows and little output rows and
report. columns of
columns of of rows and columns.
the report
the report. columns.
(not all).
14‐8
15
1‐7
Processing and The program
0
Output The program accumulates
The program
successfully and prints
Accumulating accumulates The program
accumulates the totals
and printing but does not does not
and prints and
the totals print the accumulate
the totals calculates
totals and nor print the
Calculating and and prints
has errors in totals and/or
and printing calculates the averages
calculating averages.
the averages and prints with one or
the averages.
the averages two minor
errors.
© The Independent Institute of Education (Pty) Ltd 2022
Page 4 of 7
18; 19; 20; 21; 22 2022
Question 2 (Marks: 30)
Write a Java console application to print a report and determine if a hospital is due for a health
inspection. Make use of an abstract class named Inspection that contains variables to store the
hospital location, hospital name and the years since the last inspection. This class also creates
methods to get the hospital location, name, and years since the last hospital inspection by using
the get methods. Create a constructor that accepts the hospital location, name and years since
the last inspection as parameters.
The Inspection class must implement an iInspection interface that contains the following:
interface iInspection {
public String getLocation();
public String getHospitalName();
public int getYearsSinceInspection();
public String getInspectionNeeded();
}
Create a subclass called Hospital Inspections that extends the Inspection class. The Hospital
Inspection class must contain a constructor to accept the hospital location, name and years since
inspection as parameters. Write code for the printInspectionReport method, which prints the
hospital location, hospital name, years since the inspection and whether a hospital inspection is
due. Any hospital that has not had an inspection for more than two years is required to have an
inspection.
Finally, write a Use_Inspection class to instantiate the Hospital Inspections class. Sample output is
shown below, and you may use the same values to test your application.
Sample screenshot
© The Independent Institute of Education (Pty) Ltd 2022
Page 5 of 7
18; 19; 20; 21; 22 2022
3‐4 1‐2
5 0
Public Public
Interface
Public Interface Interface Public
Interface class created Interface declared declared Interface
declared incorrectly but has not
correctly. with one or some declared.
two errors. errors.
5 3‐4
1‐2
0
The The
The
Abstract and abstract abstract There was
abstract
class was class was no Abstract
Constructor class was
created created class and
The abstract class was created
with a with a no
created with a without a
constructor, constructor, constructor
constructor
Constructor, Variables variables variables or
or
and Methods. and and variables
variables,
methods methods or
or
without with one or methods.
methods.
errors. two errors.
© The Independent Institute of Education (Pty) Ltd 2022
Page 6 of 7
18; 19; 20; 21; 22 2022
1‐2
3‐4
The Report / Screen 5 0
Display The report
The report
The report was The report was No report
was
was produced was
produced as per the partially
produced. with many produced.
sample produced.
errors.
5 3‐4 1‐2
0
The File The File The File
The File
File Saving and was saved was saved was saved
was not
Comments correctly, correctly, correctly,
saved, and
File saved correctly with and but not but there
there were
suitable enough were no
suitable comments used no
comments comments suitable
in the solution comments
were used were used comments
in the
in the in the in the
solution.
solution. solution. solution.
END OF PAPER
© The Independent Institute of Education (Pty) Ltd 2022
Page 7 of 7