Wednesday, September 19, 2012

20/9


When in pick-up mode; click confirm details button without inputting anything
Invalid input
Same error as other order type.
I just realizes the possibility that the dialog box pop-up if statement may not work at the start if it doesn’t work for the confirming of the order. I put in an additional pop to check if code was running, but it didn’t run when it was meant to. The conditional statement is the following;
 “DialogResult == System.Windows.Forms.DialogResult.Yes”
I then started playing around changing it to
(DialogResult != System.Windows.Forms.DialogResult.No)
And that ran the code?
 I did set the right message box to dialog result; this fixed the problem

After going through the program, I realised that the final order message wasn’t running because, you need to be entering your final pizza code when you click it. To make this more user friendly; I will add a check to see it the textbox is empty first.

19/9


It only goes to the invalid input method. I looked at the code and removed the part that restarts the program, in relation to the confirm details button and I removed the trigger. Although the invalid didn’t run the method that was meant to didn’t; this must mean my if statements comparison is wrong. 
I then switched the statement to check the condition of the second stage. It came up with a unhandled format exception. I forgot the syntax “.text” for reading from a textbox
                                                                               
Note; there is no need to check the customer detail details for formats and size exceptions. This is because even if the user doesn’t type the ideal input, it can’t break the program no matter what. As the input is only going to be collected and displayed. If the brief required more user guidance, I would have had to add a checking system. 
After completing entering and confirming customer details; put a letter in pizza choice textbox and click next
Invalid input should appear in a message and after exiting that message it will be as if the user didn’t enter the invalid piece of information
There was no handling of this exception. For some reason I put the line of code just above the try catch, I moved it down to fix the problem.
But after that I noticed that when the program prepared for a new order, the last input in the pizza choice text box was still there. So I added code to clear it on the start=up method.
 Doing this I also noticed the progress counter was one out. It starts at one then it change to one without an extra space. Setting the variable to one by default fixed this.

During the above I noticed that the menu doubled up after the program is restarted a few times.Because this has to be written on the first time but not after, I clear the label every reset. Another option could have been a counter and if statement.  

I noticed that after the max amount of pizzas has been entered the text box disables but the next button doesn’t

Monday, September 17, 2012

18/9


Testing Plan

Exceptions

Try to input into the pizza choice textbox before the customer details have been confirmed
Nothing

Try to click the next button before the customer details have been confirmed
Nothing

Try to click the confirm order button before the customer details have been confirmed
Nothing

Try to click the confirm details button order button before the customer details have been confirmed
Unhandled format exception; where there is the check to see if the phone number is a number. It seems I forgot to add the try catch statement over it. This stopped the exception, but when the program is re-started on the invalid message; it brings up the starting message and then the summary of the details entered, which is nothing. Once you continue pressing yes or no to the details; the program restarts, and works like before the error. I think the confirm detail button may have something causing it to engage once the program re-starts after the error initially. To try and fix this I will disable the button and reengage it when its needed. Disabling the button the button on the invalid message method didn’t change anything.
A message saying either invalid input or the summary of the customer details
After above; if there is an invalid input when you click ok or you click no to confirming the customer details; the program will reset. But if all is correct and you click yes to the customer details; the details textboxes and confirm button will disable as the next button confirm order button and pizza choice textbox is enabled.   

Try to input into the name textbox before the customer details have been confirmed
The text will appear

Try to input into the address textbox before the customer details have been confirmed
The text will appear

Try to input into the phone textbox before the customer details have been confirmed
The text will appear

Start program and chose any order type (pick up/ delivery)
The pizza menu should look like the following;
0: Pineapple $8.50                                                                                                                                                               1: Cheesy $8.50                                                                                                                                                                                    2: Bacon $8.50                                                                                                                                                                          3: Apricot $8.50                                                                                                                                                                      4: Ham $8.50                                                                                                                                                                               5: All in one $13.50                                                                                                                                                                        6: Double Cheese $13.50                                                                                                                                               7: Chicken supreme $13.50                                                                                                                                                8: Seafood $13.50                                                                                                                                                      9: Mexican fiesta $13.50
With the program full running I found that this test failed. This problem was immediately tracked to the use of my line break syntax. I used “</br>”; then I changed all the line breaks to the other syntax I know, “\r\n”; this resolved that problem. But there was still one other difference; the first line said defult 0: Pineapple $8.50, this was the part in the label on  the form, I removed this.

17/9


Run start up method
On “confirm button” click
 Show message box with the following;   return from “customer detail” method, line break and the text “Do you want to continue?(yes) Or start again(no)”, show yes and no buttons
If the user clicked yes use” stage two” method.
If the user clicks no; use “start-up” method
On “Next” button click
Use “Pizza choice” method The processes of this button is in a method because the same thing needs to happen when the confirm button is pressed
On “Confirm order” button
Use “Pizza choice” method
Message box show the following;
Return from “customer detail” method, line break this will show all of the details the user has entered in to the program
Return from “order detail” method, line break
“Do you want to submit (yes)? Or restart (no)”
Use buttons yes and no
Run start-up method  to pretend to send the information and move onto the next order and try to enter the order again 

With no errors my program still didn't run

Wednesday, September 12, 2012

13/11 programming

I fixed the syntax for the conditional statement from the message box.


Pizza order read method (input of the code of the pizza choice) used to find the name and price of a pizza code and to update the total cost
Start looking for exceptions
Declare string named pizza set this to the content of the menu array from the index inputted (read directly) 
Declare constant double called deluxe set as 13.5 local
Declare constant double called standard set as 8.5 local
Declare variable double new Cost local
Declare constant inerter “deluxe Comparison” local
in the above it seems again I have forgotten to say what the constant is meant to be set to. I looked up the indexes for the pizzas in the menu array, the index 5 is the first deluxe pizza. So I set deluxe comparison to 5 because, this is a distinction between the two pizza costs.
If the index input is between “default”- deluxe Comparison; set pizza cost to standard, otherwise set it to deluxe this is used to calculate the final total by determining the cost of the current pizza being read
If any format of size exceptions found; run invalid input
Return “pizza”
Customer order method (returns a string) compiles a string to display as the final summary
For loop; a now declared counter variable set at “four” until its at the derived value of the array length add one each time the loop runs this loop displays all of the content of the main array, while converting the pizza codes to their number and names   
Loop start;
Declare string all order used to store the details into one string
Declare integer index set to the return from; Use array main read method, send counter variable, 
Declare string order set it to the following; counter variable converted to a string, the return from using pizza array read(sending index) and a line break.
Array write, send total and use array main read (send total) converted to a double plus the pizza cost that as a total is then converted back to a string (this is a global variable)  this creates the total
Add order to the end of all order. End of loop
Add the following to the end all over; “delivery:  $” plus the return from using array read main (sending delivery cost)
In above the text piece needs a space at the end
Return all over

Tuesday, September 11, 2012

9/12 Programming


The following checks to see if the user did input the details 
If; the return of the delivery cost array index is equal to “address” and if use read array “main” method (send name constant) = default or:” use read array method(send Address constant) = default  or use read array method(send Phone constant)= default . Here I forgot to mention what the index value is for delivery cost, this is 0; so I will use the defult constant converted to an int. The above is just used to check if input has been recorded, so I have “null” because no text doesn’t equal 0.
Then use invalid input method
if use read array “main” method (send name constant)= default 
Then use invalid input method
The two lines of code above are not needed as I combined a check for the non-delivery input into the other check
The following compiles the summary to display
Declare string called “customer detail” and set to the following; local
 “Name:” use read array method(send name constant) line break
“Address:” use read array method(send Address constant) line break
“Phone:” use read array method(send Phone constant) line break
Return customer detail this sends  the string to the caller of the method

11/9 programming


I remembered more of the message box button syntax 

If pizza code; bigger than “total” or smaller than “default”. Then run invalid input
Wasn’t sure if the next two lines are part of the if statement above, I put it in the statement
 Use array main write method; send pizza number +”four”& pizza code converted to string
Declare constant inerter “max Pizzas” local  I haven’t assigned a number here so I think it must relate to the next line of code, so it could be 8 or 5. 5 is the max number of pizzas, 8 is it’s index. I don’t think the variable is related to the array so I assume it is meant to be set to 5; but it’s possible it could be set at 4, if 0 is counted.
If pizza number is equal or bigger than “max Pizzas”; set pizza number to “default”(0) disable pizza choice this will show that the user has reached the max pizzas and will prepare the form for the next loop
Clear pizza choice textbox reads the text box for more input; only needed when next clicked, even though it isn’t needed when the confirm order button is clicked
Set pizza choice label to; “Pizza number” and pizza + one (using++) number converted to a string this will show the user how many pizzas have already been entered ( by default when the program first opens the label will read Pizza choice number one I assumed that when I said “and pizza + one”, I meant to say pizza number pluss one.
If any format or size exceptions found run invalid input method
Stage two method (no input/outputs) sets the form so the user can’t change the customer details accidently when entering the order and can put in the pizzas  
Disable name textbox
Disable address textbox
Disable phone textbox
Disable confirm detail button
Enable pizza choice textbox
Enable next button
Enable confirm order button
Customer detail method(no input returns string)  shows the user the details of the customer to check them before continuing
Declare integer constant name as 1 local to this method
Use array write method (send name and content of name textbox) stores the details in array
Use array write method (send address and content of address textbox) stores the details in array
Use array write method (send phone and content of phone textbox that is converted to a number and then back into a string) stores the details in array