Professional Documents
Culture Documents
Assignment SC025
Assignment SC025
You must complete this assignment by yourself. You cannot work with anyone else in
the class or with someone outside of the class.
1. Choose ONE of the questions given below. For each question you need to
1
Question 1:
Koop KMPP Sdn. Bhd is doing an analysis of its 10 best sales representatives. The
analysis is important for the management to search for the best salesperson among
them. That particular salesperson will be awarded a token of appreciation from the
company. A computer program is required to assist the company in doing the
analysis. Write a complete Java program that prompt the user to enter salesperson’s
name, staff id, and their respective sales. Then a program read the input into the
corresponding arrays.
(a). Print salesperson’s staff id and the amount of sales in the format of a table.
(b). Print total sales and average sale.
(c). Print the salesperson Staff id with the highest sales.
Sample output:
2
Question 2:
(a). Prompt number of participants and playerID for the game from user
(b). Find the total and average of score
(c). Find highest score
(d). Best player (playerID)
Sample Output:
3
Question 3:
YES.Fit VR Club will be handling a virtual run in February 2019. The organizer needs a
system to analyse records of the event should be stored in array. The organizer as a
user of the system needs to determine the number of runner per group before they
can record the total distance for each runner. The output of the analysis will help
them to identify the highest and lowest distance and respective runner ID, the total
distance and average distance. The output of the system are as follows:
SAMPLE OUTPUT:
4
Question 4:
Write a complete Java Program to determine the month of highest rainfall reading
and average rainfall for one year at Cameron Highlands. Prompt user to enter month
and rainfall for 12 months, then display the month with the highest rainfall, the highest
and average rainfall reading.
Sample Output
5
Question 5:
Sample output:
6
Question 6:
The haze phenomenon has hit Malaysia in June 2013. Schools, the government and
private sectors, have all been badly hit by closures or their employees who get in
medical leave. The quality of air is measured using the Air Pollutant Index (API) reading
and status for a particular district. Mr. Razak Husin, the managing director of Sulaiman
& Ahmad Co., a company located in X city, has directed you to update API reading
for 10 main districts.
Prompt user to enter district’s name and their API reading. Then a program read the
input into the corresponding arrays. Write a complete Java program to do the
following:
(a). Print district’s name and API reading in the format of a table.
(b). Print total API and average API.
(c). Prints the district’s name with the highest API.
Sample Output:
7
Attachment 1
ARRAY
NAME:
MATRIC NUMBER:
PRACTICUM CLASS:
LECTURER’S NAME:
QUESTION NO:
Copy your question here!