Using C# create a Windows Form Application for a Pizza Delivery Company. You mus
ID: 3740608 • Letter: U
Question
Using C# create a Windows Form Application for a Pizza Delivery Company. You must provide a place for the user to enter their contact information (address, phone number, email) and some contact information should be displayed when an order is placed. Your application should have a picture logo and company name. Provide selections such as Small, Medium, or Large for size. Allow users to select from at least a dozen items to place on their pizza. Consider offering different types of sauce (tomato, pesto, none), different types of crust, different specialty types of pizza (Supreme, Veggie, Meat Lovers, etc). You can sell wings, bread sticks, chicken strips, or something else. Consider offering beverages. You must display the price for the order and allow the user to change their mind while they are ordering and reset the order form. (Please post a visual display of this in action as well as editable code, I also have the display done using tabbed controls so something similar please, I just need the code.)
Explanation / Answer
Hi below i have written application sample function for your reference,
HTML>
<HEAD>
<TITLE>Inside Visual C++ HTML Form 1</TITLE>
</HEAD>
<BODY>
<H1></H1>
<CENTER><B><FONT color="#0000FF" face="Verdana" size="4">Welcome to Vicky'sPizza</FONT></B></CENTER>
<H1></H1>
<P><FONT color="#FF0000" face="Tahoma">Enter your order.</FONT> </P>
<FORM action="scripts/myex34a.dll?ProcessPizzaForm" method="POST">
<P>Your Name: <INPUT type="text" name="name" value> </P>
<P>Your Address: <INPUT type="text" name="address" value> </P>
<P>Number of Pies: <INPUT type="text" name="quantity" value="1"> </P>
<P>Pizza Size: </P>
<MENU>
<LI><INPUT type="radio" name="size" value="8">8-inch </LI>
<LI><INPUT type="radio" name="size" value="10">10-inch </LI>
<LI><INPUT type="radio" name="size" value="12" checked>12-inch </LI>
<LI><INPUT type="radio" name="size" value="14">14-inch </LI>
</MENU>
<P>Toppings: </P>
<P><INPUT type="checkbox" name="top1" value="Pepperoni" checked> Pepperoni
<INPUT type="checkbox" name="top2" value="Onions"> Onions
<INPUT type="checkbox" name="top3" value="Mushrooms"> Mushrooms
<INPUT type="checkbox" name="top4" value="Sausage"> Sausage </P>
<P><EM>(you can select multiple toppings)</EM> </P>
<P><INPUT type="submit" value="Submit Order Now"><INPUT type="reset"> </P>
</FORM>
</BODY>
</HTML>
Optional Parameters:
The DLL's ProcessPizzaForm() function reads the parameter values and produces an HTML confirmation form, which it sends to the customer. Here is part of the function's code:
*pCtxt << "<form action="myex34a.dll?ConfirmOrder" method=POST>";
*pCtxt << "<p><input type="hidden" name="name" value="";
*pCtxt << pstrName << "">"; // xref to original order
*pCtxt << "<p><input type="submit" value="Confirm and charge my credit card">";
*pCtxt << "</form>";
// Store this order in a disk file or database, referenced by name
}
else {
*pCtxt << "You forgot to enter name or address. Back up and try again. ";
}
EndContent(pCtxt);
Processing the Confirmation:
void CMyex34aExtension::ConfirmOrder(CHttpServerContext* pCtxt, LPCTSTR pstrName)
{
StartContent(pCtxt);
WriteTitle(pCtxt);
*pCtxt << "<p>Our courteous delivery person will arrive within 30 minutes. ";
*pCtxt << "<p>Thank you, " << pstrName << ", for using CyberPizza. ";
// Now retrieve the order from disk by name, and then make the pizza.
// Be prepared to delete the order after a while if the customer doesn't confirm.
m_cs.Lock(); // gotta be threadsafe
long int nTotal = ++m_nTotalPizzaOrders;
m_cs.Unlock();
*pCtxt << "<p>Total pizza orders = " << nTotal;
EndContent(pCtxt);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.