COMP-228程序辅导、Java编程设计讲解、辅导Programming程序
- 首页 >> Matlab编程 Java Programming COMP-228
Final Exam: Test#2 ____________Page 1 of 3
FINAL-term Exam (TEST #2)
Date: 8.30 am, Tuesday 1
st December, 2020 to Mid-night, Monday 7
th December, 2020
Marks/Weightage: 100/25%
Instructions: Be sure to read the following general instructions carefully:
This test should be completed individually by all the students.
Step1: At the start of eclipse, you must name your Eclipse workspace according to the following rule:
YourFullName_COMP228SectionNumber_Final.
For Example: JohnSmith_COMP228Sec006_Final (if your section is 006)
Step 2: And after that, you must name your Eclipse project according to the following rule:
YourFullName_COMP228SectionNumber
For Example: JohnSmith_COMP228Sec006 (if your section is 006)
Step 3: And your package should be named as follows:
YourFullName_SectionNumber_Ex01
For Example: johnsmith_sec006_ex01 (if your section is 006)
Submission/Upload Instructions:
After you complete, run and test your code, you need to do the following:
a) Close the eclipse, go to your workspace folder which you created in Step 1.
b) Zip it up. You should get a zip file like this– JohnSmith_COMP228Sec006_Final.zip. You should only
be submitting it in the .zip file format (and not .rar or any other format)
c) Upload this zip file using the Final term exam link in e-centennial.
Apply the naming conventions for variables, methods, classes, and packages:
- variable names start with a lowercase character for the first word and uppercase for every other word
- classes start with an uppercase character of every word
- packages use only lowercase characters
- methods start with a lowercase character for the first word and uppercase for every other word
Note: Academic dishonesty in any form is not allowed. This test should be completed individually by all the
students. If you fail to upload your mid exam on or before the due date, then there will 50% deduction. And
after 24 hours past the due date, it will not be accepted.
Java Programming COMP-228
Final Exam: Test#2 ____________Page 2 of 3
Exercise 1: [100 marks]
Write a GUI application in Java that allows user to select students by their city.
GUI, you can design using Scene Builder.
The user should be able to enter the city. The application should retrieve the student information from an
Oracle table named Student. ( Or you can use MySql RDBMS which is open source)
Here is the definition of the table:
CREATE TABLE Student (
studentID char(9) NOT NULL,
firstName varchar (20) NOT NULL,
lastName varchar (20) NOT NULL,
address varchar (30) NOT NULL,
city varchar(30) NOT NULL,
province char(2) NOT NULL,
postalCode char(6) NOT NULL,
PRIMARY KEY (studentID)
);
Populate the table with at least 10 rows having different city names such as Toronto, Brampton, Montreal etc.
as below:
insert into Students values ('300111222','Sam', 'Malone', '10 Somewhere Road', 'Toronto','ON','M1Y2H2');
commit;
The information should be displayed in a JTextArea (or TextArea control of SceneBuilder) component which
has scrolling abilities. Use “\t” and “\n” to format the display.
Use the most appropriate layout manager classes to implement the layout of this GUI.
Java Programming COMP-228
Final Exam: Test#2 ____________Page 3 of 3
Evaluation:
Functionality
Correct implementation of UI (using SWING or JavaFX components, event
handling)
35%
Correct implementation of data access using JDBC (connecting with server,
executing a prepared statement, displaying results)
50%
Comments, correct naming of variables, methods, classes, etc. 5%
Friendly input/output 10%
Total 100%
Final Exam: Test#2 ____________Page 1 of 3
FINAL-term Exam (TEST #2)
Date: 8.30 am, Tuesday 1
st December, 2020 to Mid-night, Monday 7
th December, 2020
Marks/Weightage: 100/25%
Instructions: Be sure to read the following general instructions carefully:
This test should be completed individually by all the students.
Step1: At the start of eclipse, you must name your Eclipse workspace according to the following rule:
YourFullName_COMP228SectionNumber_Final.
For Example: JohnSmith_COMP228Sec006_Final (if your section is 006)
Step 2: And after that, you must name your Eclipse project according to the following rule:
YourFullName_COMP228SectionNumber
For Example: JohnSmith_COMP228Sec006 (if your section is 006)
Step 3: And your package should be named as follows:
YourFullName_SectionNumber_Ex01
For Example: johnsmith_sec006_ex01 (if your section is 006)
Submission/Upload Instructions:
After you complete, run and test your code, you need to do the following:
a) Close the eclipse, go to your workspace folder which you created in Step 1.
b) Zip it up. You should get a zip file like this– JohnSmith_COMP228Sec006_Final.zip. You should only
be submitting it in the .zip file format (and not .rar or any other format)
c) Upload this zip file using the Final term exam link in e-centennial.
Apply the naming conventions for variables, methods, classes, and packages:
- variable names start with a lowercase character for the first word and uppercase for every other word
- classes start with an uppercase character of every word
- packages use only lowercase characters
- methods start with a lowercase character for the first word and uppercase for every other word
Note: Academic dishonesty in any form is not allowed. This test should be completed individually by all the
students. If you fail to upload your mid exam on or before the due date, then there will 50% deduction. And
after 24 hours past the due date, it will not be accepted.
Java Programming COMP-228
Final Exam: Test#2 ____________Page 2 of 3
Exercise 1: [100 marks]
Write a GUI application in Java that allows user to select students by their city.
GUI, you can design using Scene Builder.
The user should be able to enter the city. The application should retrieve the student information from an
Oracle table named Student. ( Or you can use MySql RDBMS which is open source)
Here is the definition of the table:
CREATE TABLE Student (
studentID char(9) NOT NULL,
firstName varchar (20) NOT NULL,
lastName varchar (20) NOT NULL,
address varchar (30) NOT NULL,
city varchar(30) NOT NULL,
province char(2) NOT NULL,
postalCode char(6) NOT NULL,
PRIMARY KEY (studentID)
);
Populate the table with at least 10 rows having different city names such as Toronto, Brampton, Montreal etc.
as below:
insert into Students values ('300111222','Sam', 'Malone', '10 Somewhere Road', 'Toronto','ON','M1Y2H2');
commit;
The information should be displayed in a JTextArea (or TextArea control of SceneBuilder) component which
has scrolling abilities. Use “\t” and “\n” to format the display.
Use the most appropriate layout manager classes to implement the layout of this GUI.
Java Programming COMP-228
Final Exam: Test#2 ____________Page 3 of 3
Evaluation:
Functionality
Correct implementation of UI (using SWING or JavaFX components, event
handling)
35%
Correct implementation of data access using JDBC (connecting with server,
executing a prepared statement, displaying results)
50%
Comments, correct naming of variables, methods, classes, etc. 5%
Friendly input/output 10%
Total 100%