Secondary school of chemistry, electrical engineering and computer science
2025
Quote generator
BOŠTJAN RESINOVIČ, KLAVDIJA ŠPUR JEREB
vid strmčnik R3A
SUMMARY
In this report, I created a Windows Form application in C# called Quote
generator. The program is about generating quotes with names that you write
in.
Keywords
User interface
Windows Form
Quote
Programming
C#
Visual Studio
INDEX
[Link].....................................................................2
[Link] interface...................................................................3
2.1Users point of view.......................................................................................................................3
2.2Building components....................................................................................................................4
[Link].................................................................................6
3.1First display code..........................................................................................................................6
3.2Second display code.....................................................................................................................8
[Link]........................................................................9
[Link]...........................................................................10
[Link].........................................................................11
PICTURE INDEX
1.Picture1: main site of the app............................................................................................................3
[Link]: end screen of the app...........................................................................................................3
[Link]: label amount and button.......................................................................................................4
[Link]: progress bar and rank with arena picture boxes...................................................................4
[Link]: label with the message and restart button...........................................................................5
[Link]: variables declaration.............................................................................................................6
[Link]: how the timer will look at the start.......................................................................................6
[Link]: method clicked......................................................................................................................7
[Link]: progress bar code..................................................................................................................7
[Link]: timer code...........................................................................................................................8
[Link]: code for the timer to transport and be displayed...............................................................8
[Link]: Form2 is hidden and Form1 opened...................................................................................8
[Link]
This report describes the creation of an application named Quote
Generator, developed using C# in Visual Studio with Windows Forms.
The program generates random quotes that include the user's name,
providing a personalized and fun experience. When a user enters their
name and presses the “Generate” button, a random quote is selected
from a predefined list and displayed on the screen.
2
[Link] interface
2.1Users point of view
To start I have made two forms in user interface. One is for the main part
of the app where the program is mostly based in and then the second
one for the result display where the time and a winning message is
shown.
[Link]: end screen of the app
2.2Building components
In the first display I used:
A textbox named amount that shows click counter
A button named button where u need to click
Five labels, four of them are there just for the blue coloured border
and one is named ranks that just have a word rank
A progress bar that presents the progress
Four picture boxes that have a picture of an arena
A timer named timer1 to measure how long it took
[Link]: label amount and button
[Link]: progress bar and rank with arena picture boxes
On the second display there is:
A label for the “You won!” message
A button named restart that restarts the app
[Link]: label with the message and restart button
[Link]
3.1First display code
Firstly, I needed to declare four variables. I created int seconds, int
millisecond, int i (counter) and bool stopwatchStarted. Most of them are
there just for the timer only, int i is there for the click counter.
I declared all int to zero and bool to false.
[Link]: variables declaration
In the Form1 code I just set the timer to show “00:00” at the start.
[Link]: how the timer will look at the start
Then the next one is a method clicked that is used for the button.
It firstly starts the timer and puts the counter (int i) to plus one. It does
the same to progress bar and it checks if the value of it is already one
hundred. If it is the timer is stopped and Form2 (second screen) is
displayed. String finalTime is also declared and has the final time saved
so it can be transported to the second screen. The seconds and
millisecond variable is set to 0 and Form2 is shown, Form1 closed.
[Link]: method clicked
The progress bar is also set to zero if it has reached one hundred.
[Link]: progress bar code
The last part of code on Form1 is method tick for the timer. It is set to
interval ten in the properties of it. I made the millisecond go up for one
every time the interval is made and if the millisecond reaches sixty it is
set back to zero and seconds are now up for one. How the timer will look
is set in the last line of the code.
[Link]: timer code
3.2Second display code
The code for the Form2 is shorter.
For the app to transport the finish time I made Form2 with the string
finalTime and have the label present it.
[Link]: code for the timer to transport and be displayed
And the last part of the cote is the restart button.
When the button is clicked it will have Form1 displayed back with all the
components back to their initialized value. Form2 will close.
[Link]: Form2 is hidden and Form1 opened
[Link]
The Clicker program successfully demonstrates what the purpose of it
was at the beginning. While I was working on it, I had problems with the
timer and the transportation of final time from Form1 to Form2. I solved it
all with the help of reddit and researching on google. This project
showed me a new programming language that is interesting and
extremely easy to code especially the user interface part.
In the future, the program could be expanded with additional features
such as difficulty levels, leaderboards, or different challenges to make it
more competitive and enjoyable for users. The user interface could also
be upgraded to look better overall.
[Link]
[Link]
view=windowsdesktop-9.0
[Link]
[Link]
[Link]
[Link]