Assessment 1 - Practical Test
Assessment 1 - Practical Test
Assessment 1 - Practical Test
Task #1: Write a program segment that reads the data from a file named weather.txt. Each line in the file
contains the following data separated by semicolons:
• reportID (int): The unique identifier for the weather report.
• city (String): The name of the city.
• date (String): The date of the report in the format yyyy-mm-dd.
• temperature (double): The temperature recorded in the report.
• condition (String): The weather condition (e.g., Sunny, Rainy, Cloudy).
For each data retrieved, an object of type WeatherReport will be created using a constructor before the
object is added to the ArrayList named weatherList.
Task #2: Display all the weather report data from the list in tabular format.
Task #3: Calculate and display the average temperature for all weather reports.
Sample Output:
Average temperature: 30.75
Task #4: By utilizing the bubble sort algorithm, sort the list of weather reports in ascending order according
to the temperature. Display all the weather report data from the sorted list in tabular format.
Task #5: Provide user to enter the report ID to search and update its weather condition. If the record does
not exist, display an appropriate message. Implement the binary search algorithm in your code.
Task #6: Remove all weather reports with temperature above 32.0 from the weatherList and store them
in a new ArrayList, hotWeatherList.
Please compile your complete answer into a zipped folder named with your FULL NAME.
Submit this zipped folder by privately messaging your respective lab group lecturer before
12:30 pm. The zipped folder should contain the following files:
i. Assessment 1 - Practical Test.docx. Please FILL IN your details such as name, matric
number, and group on the last page of this document.
ii. Main application class that contains the main()created by you.
iii. ADT WeatherReport.
iv. File input weather.txt.
P.S. You SHOULD NOT change or add anything to the definition of WeatherReport ADT and
ArrayList ADT. The definition of both ADTs is enough and perfect for you to work on the application
class. Good luck and mind your time!
LAB TEST/PRACTICAL TEST
CSC248: FUNDAMENTALS OF DATA STRUCTURES
SEQUENTIAL LIST DATA STRUCTURES AND SORTING
TIME: 2.5 HOURS (including + 30 minutes for downloading & uploading process)
Rubric 1
1 2
3
0 Exist with Exist with
Item Well Weight Score
Not exist a major a minor
executed
correction correction
Q1 3 /9
Q2 2 /6
Q3 2 /6
Q4 3 /9
Q5 3 /9
Q6 2 /6
Total /45
LAB TEST/PRACTICAL TEST
CSC248: FUNDAMENTALS OF DATA STRUCTURES
SEQUENTIAL LIST DATA STRUCTURES AND SORTING
TIME: 2.5 HOURS (including + 30 minutes for downloading & uploading process)
Rubric 2
1 2 3 4
Attribute Weight Score
Very Week Week Fair Good
Understands Student’s work Student’s work Student’s work Student’s work 5 /20
the Problem shows shows slight shows shows complete
and incomplete understanding understanding of understanding of
Requirements understanding of problem problem and most problem and all
of problem and requirements requirements
and/or requirements
requirements
Knowledge of Student does Student Student usually Student 5 /20
fundamental not understand struggles at produces implements
data fundamental translating workable elegant
structures data structures fundamental implementations implementations
and and data structures of fundamental of fundamental
algorithms algorithms. and algorithms data structures data structures
None of the into and algorithms. and algorithms.
steps are appropriate Most of the steps All the steps are
implemented code. Few are implemented implemented
of an steps are correctly of an correctly of an
algorithm implemented algorithm algorithm
correctly of an
algorithm
Program Program Program Program is free of Program is free of 5 /20
Execution unable to run contains few errors and output errors and output
and wrong logical errors is not properly is well formatted.
output or no and output is formatted. Demonstrates
output found. not formatted. Demonstrates a excellent problem
Demonstrate Demonstrates clear solving and
no partial understanding of creativity skills.
understanding understanding the concepts
of concepts of the concepts relevant to the
related to the relevant to the problem.
problem. problem.
TOTAL /60