0% found this document useful (0 votes)
53 views2 pages

Week 5: Graphical User Interface Exercises:: False

The document discusses a weekly exercise on graphical user interfaces (GUI) in Java. It contains three parts: (1) true/false statements about GUI components in Java, (2) code snippets to create common GUI elements like labels, buttons, text fields and windows, and (3) two programming exercises - one to calculate a weighted average using user input data and buttons, and another to convert strings to uppercase and lowercase. It also provides a grading rubric for the programming exercises focusing on correctness, logic, efficiency and syntax.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

Week 5: Graphical User Interface Exercises:: False

The document discusses a weekly exercise on graphical user interfaces (GUI) in Java. It contains three parts: (1) true/false statements about GUI components in Java, (2) code snippets to create common GUI elements like labels, buttons, text fields and windows, and (3) two programming exercises - one to calculate a weighted average using user input data and buttons, and another to convert strings to uppercase and lowercase. It also provides a grading rubric for the programming exercises focusing on correctness, logic, efficiency and syntax.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

COLLEGE OF ST.

CATHERINE OF QUEZON CITY

Week 5: Graphical User Interface


Exercises:
I. Mark the following statement as true or false
1. Every window has a width and height TRUE
2. In Java, JFrame is a class. TRUE
3. To display the window, you need not invoked a method such as setVariable.
FALSE
4. In Java, reserved word extends allows you to create a new class from an
existing one. TRUE
5. The window you see displayed on your screen is a class. FALSE
II. Write the statements to create the following components
1. A JLabel with the text string “Enter the number of Courses”
2. A JButton with the text string “run”.
3. A JTextField tha can display 15 characters
4. A window with the title “Welcome Home!”
5. A window with a width of 200 pixels and aheight of 400 pixels
6. A JTextField that displays the string “Apple Tree”
III. Programming Exercise
1. Design a GUI program to find the weighted average of four test scores. The
four test scores and their respective weights are given in the following
format:
testscore1 weight1
….
Use the sample data to test your program
75 0.20
95 0.35
85 0.15
65 0.30
The user should enter the data, and once button Calculate is pressed, the
program must display the weighted average. The program should also
consist of button Exit to close the program.
2. Write a GUI program to convert all lower case letters in a string to uppercase
letter and vice versa. For example: ghenmacatangay will be converted to
GHENMACATANGAY.
Rubric for grading programming exercise.
Grading Rubric
Criteria Performance Indicators Points
Correctness The code produces the expected results 5
Logic The code meets the specifications of the problem 5
Efficiency The code is concise without sacrificing correctness and logic. 5
Syntax The code adheres to the rules of the programming language. 5
Total 20

Computer Programming 2
Activity Sheet 1
COLLEGE OF ST. CATHERINE OF QUEZON CITY

Computer Programming 2
Activity Sheet 2

You might also like