Jump to content

how to change a vb,c# program to a non hard-code one?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
reja

reja

    Newbie

  • Members
  • PipPip
  • 12 posts
i have had an assignment which i have done the first part.
question:a pizza company has contracted you to design an application program to help the company calculate cost of an order.Your program is to be used by their telephone operator who has to take orders and let the customer know the total cost of the pizza and delivery quickly and accurately.Currently the pizza company only sells 1 type of pizza.Below is some additional information relevant to the proposed application.
Neccesary inputs:
-number of pizzas ordered
-number of extra toppings ordered
-pice of pizza
Details:
-extra toppings at $0.50 each
-Delivery charge of $2
-Tax charge of 7%

I have attached the form that i have designed to calculate cost of pizza.

Now,im required to change the program abit.The programme should not hard-code the delivery charges,price of extra toppings and Tax charge.A separate area in the GUI should be identified to display these data for the purpose of them being editable by the user.However,the default values as per original user requirements should be displayed in the beginning.The program should not close if a user entered a non-numeric data.
I know that i have to use the "TryParse" eg:int noOfPizza;
if (int.TryParse(noOfPizzaTb.Text,,out numOfPizza)==false
{
numOfPizza = 0;
}

					
					

#2
gokuajmes

gokuajmes

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 518 posts
i will just provide you the idea , make a File .write down the default values onto that file .Make a application that can read from that file & let users modify that value for further help see this tutorial http://forum.codecal...-basic-net.html