You are on page 1of 10

WEEK 5: LABORATORY ACTIVITY

Task 1 (10 points):


Source Code:

Output:

Observation:
This code snippet demonstrates the creation of a basic graphical user
interface (GUI) using the "breezypythongui" library. It defines a class,
SampleGUI, which inherits from EasyFrame and initializes a GUI window
with the title "My First GUI" and dimensions of 300x150 pixels.
Task 2 (10 points):
Source Code:

Output:
Observation:
This code snippet uses the
"breezypythongui" library to create a
basic GUI. It customizes the GUI
window's title, size, non-resizability,
and background color within the
`SampleGUI` class constructor. The
code then launches the GUI, allowing
user interaction, serving as an
illustrative example of configuring GUI
properties with the library.
Task 3 (10 points):

Output:

Observation: This code defines a simple graphical user interface (GUI)


using the BreezyPythonGUI library. It creates a window with a title,
dimensions, and two labels containing text. The first label displays a name,
and the second label mentions a personal preference for eating and
sleeping. The second label has custom font, background color, and
foreground color settings. When the code is run, it displays this GUI window.
Task 4 (10 points):
Source Code:

Output:
Observation:
This code creates a simple GUI using
the BreezyPythonGUI library that
displays an image of a yellow car and a
text label with blue text. It demonstrates
the use of an image file ("car.gif"),
custom font settings, and label positioning within the GUI window. The GUI
is not resizable, and the image and text are displayed in specific cells with
"NSEW" sticky properties for alignment.
Task 5 (10 points):
Source Code:

Output:

Observation: This code creates a simple graphical user interface (GUI)


using the BreezyPythonGUI library. It includes a label that initially displays
"Hello MMCM!" and two buttons, one to enable the other. When the "Enable"
button is clicked, it activates the "Change" button, allowing it to be clicked.
Clicking the "Change" button updates the label text to "You clicked the
button."
Task 6 (10 points):
Output 1:
Observation: The provided code
attempts to create a simple calculator
GUI, but it has a critical issue. It
concatenates the two input strings
(num1 and num2) instead of
performing addition, resulting in
incorrect behavior.
Output 2:
Observation:This Python code creates a
simple GUI calculator using the
BreezyGUI library. Users can input two
numbers, click "Add," and see the result
displayed in the GUI. This code also
provide a result in correct behavior unlike
the first output.
Task 7 (10 points):
Output:
Observation:
This code update enhances the calculator
application by enforcing integer input through
`addIntegerField` for input fields and improving
the `sum` method's robustness by using
`getNumber()` to retrieve values as integers.
These changes collectively improve the application's reliability and user-
friendliness.
Task 8 (10 points):
Source code:
Output:
Observation:
This code creates an advanced calculator
GUI application using the BreezyGUI library.
Users can input two numbers, select an
operation (addition, subtraction,
multiplication, integer division, float division,
modulus division, or exponentiation) by
clicking corresponding buttons, and see the
result displayed in a read-only text field. The
calculator handles division by zero
gracefully, displaying an appropriate message.
Overall, this calculator provides a user-friendly interface for performing a
variety of mathematical operations and ensures error handling for division by
zero scenarios.
Task 9 (10 points):
Output:
Observation:
This code creates a simple calculator GUI
with two input fields and basic arithmetic
buttons for addition, subtraction,
multiplication, and division.
Task 10 (10 points):
Output:
Observation:

You might also like