Professional Documents
Culture Documents
Task 3
Task 3
Radio Buttons- For the burgers I used radio buttons so the user can only select
one burger. The drop down menu brings up 3 different sizes of burgers and the
price of the burger is based on the burger size e.g. 4oz buffalo burger is $8.50.
Checkboxes- I used Checkboxes for the toppings so the user can have multiple
toppings on their burger because it adds flavour to the burger and gives the
customer more of a choice. E.g. instead of just having onions, you could have
onions and ketchup. When adding topping in I used labels so I could write what
the toppings were.
Radio Buttons- I used radio buttons for the drinks because I think the user
would only like one drink. By adding checkboxes it would just be a mess if I
added up all the drinks or the ones the user selected.
Textboxs- For the credit card details I used text boxes but resized them for the
16 digit number. Text boxes are good because the user and type a number in
them. I done the same for the 3 digit CVC.
Code
I used this code because every time I want to add an item it will add it to the
receipt which makes a lot of easier. This piece of code is used when you want to
add item.
2. Loop
private void frmLogin_Load(object sender, EventArgs e)
{
staffArray[0] = "Ann";
staffArray[1] = "Tom";
staffArray[2] = "Sam";
staffArray[3] = "Doug";
txtPassword.Focus();
}
For the login the staff array can contain a list of names. The names that
have been put into the staff array is what is the password for the login. So
whenever you type in a name the staff array will loop around to it finds a
match. If it does not find a match then it will say login unsuccessful and
close down.
3. Variables
private void btnPlaceOrder_Click(object sender, EventArgs e)
{
double mealTotal = 0;
double toppingsCost = 0;
double burgerCost = 0;
double drinkCost = 0;
A variable is a symbolic name associated with a value. I used this for the meal
total, topping cost, burger cost and the drink cost.
4. Procedures
private void rdoBuffalo_Click(object sender, EventArgs e)
{
5. Event Triggers
Example
Click
private void rdoTexas_Click(object sender, EventArgs e)
{
Timer
private void timer1_Tick_1(object sender, EventArgs e)
{
Key Press
private void txtNum2_KeyPress(object sender, KeyPressEventArgs e)
{