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

Laboratory Activity Machine Problem #1:: NCP 3106 (Software Design Laboratory)

The document describes 5 machine problems for a software design laboratory. The problems involve creating GUI applications: 1) to view image files, 2) simulate rolling dice, 3) simulate a game of tic-tac-toe, 4) randomly select and display cards from a deck, and 5) calculate registration fees for a conference based on user selections.
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)
132 views2 pages

Laboratory Activity Machine Problem #1:: NCP 3106 (Software Design Laboratory)

The document describes 5 machine problems for a software design laboratory. The problems involve creating GUI applications: 1) to view image files, 2) simulate rolling dice, 3) simulate a game of tic-tac-toe, 4) randomly select and display cards from a deck, and 5) calculate registration fees for a conference based on user selections.
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

NCP 3106 (Software Design Laboratory)

LABORATORY ACTIVITY

Machine Problem #1:


Write an application that allows the user to view image files. The application should use
either a button or a menu item that displays a file chooser. When the user selects an image file, it
should be loaded and displayed.

Machine Problem #2:


Write a GUI application that simulates a pair of dice, similar to the figure shown. Each
time the button is clicked, the application should roll the dice, using random numbers to
determine the value of each die.

Machine Problem #3:


Create a GUI application that simulates a game of tic tac toe. The figure below shows an
example of the application’s window. The window shown in the figure uses nine large JLabel
components to display the Xs and Os.
One approach in designing this application is to use a two-dimensional int array to
simulate the game board in memory. When the user clicks the New Game button, the application
should step through the array, storing a random number in the range of 0 through 1 in each
element. The number 0 represents the letter O, and the number 1 represents the letter X. The
JLabel components should then be updated to display the game board. The application should
display a message indicating whether player X won, player Y won, or the game was a tie.

Machine Problem #4:


Write a GUI application, similar to the one shown in the figure below, that randomly
selects a card from the deck and displays it each time the user clicks the button. When a card has
been
selected, it is removed from the deck and cannot be selected again. Display a message when
no more cards are left in the deck.

1|Page
NCP 3106 (Software Design Laboratory)

Machine Problem #5:


Create a GUI application that calculates the registration fees for a conference. The
general conference registration fee is P15000 per person, and student registration is P8500 per
person. There is also an optional opening night dinner with a keynote speech for P1500 per
person. In addition, the optional preconference workshops listed in the table below are available.

Workshop Fee
Arduino Workshop P2500
3D Printing Workshop P1000
IOT Workshop P3500

The application should allow the user to select the registration type, the optional opening
night dinner and keynote speech, and as many pre-conference workshops as desired. The total
cost should be displayed.

2|Page

You might also like