C How can I create program NinasCookieSource ithat includes

C#:

How can I create program NinasCookieSource ithat includes a Form for a company named The Cookie Source. Allow the user to select from at least three types of cookies using Radio Button, each with different price per dozen. Allow the user to select one-half, one, two, or three dozen cookies. Assuming that shipping takes three days, display the estimated arrival date for the order.

Requirement the program must have:

The Quantity list must store references to objects. The calculations for cookie price, accumulated total, and the delivery date should not happen in your Form class. Those calculations should happen down in your \"business layer\", separate from your \"presentation\" (or \"GUI\") layer (e.g., with something like \"Cashier\" and/or \"DeliveryPlanner\" classes being part of your business layer).

The price for a dozen of cookies is:

·         Chocolate Chip: $8.98

·         Oatmeal: $6.98

·         Vanilla Wafer: $6.48

Solution

Code :

namespace NinasCookieSource
{
   public parial class Form1 : Form
   {
       private const int priceChocolateChip = 8.98;
       private const int priceOatmeal = 7;
       private const int priceVanillaWafer = 6.48;
       private double totalPrice;

       private const double OneHalf = 0.5;
       private const double dozen = 1;
       private const double twodozen = 2;
       private const double threedozen = 3;

   public Form1()
   {
       InitializeComponent();
   }

   private void checkboxChocolateChip_CheckedChanged(object sender,EventArgs e)
   {
   if(checkboxChocolateChip.Checked)
       totalPrice += priceChocolateChip;
   else
       totalPrice -= priceChocolateChip;
   lblTotal.Text = \"Total is \" + totalPrice.ToString(\"C\");
   }


   private void checkboxOatMeal_CheckChanged(object sender, EventArgs e)
   {
       if(checkboxOatMeal.Checked)
       totalPrice += priceOatMeal;
   else
       totalPrice -= priceOatMeal;
   lblTotal.Text = \"Total is \" + totalPrice.ToString(\"C\");
   }


   private void checkboxVnillaWafer_CheckChanged(object sender, EventArgs e)
   {
       if(checkboxVanillaWafer.Checked)
       totalPrice += priceVanillaWafer;
   else
       totalPrice -= priceVanillaWafer;
   lblTotal.Text = \"Total is \" + totalPrice.ToString(\"C\");
   }  

   private void radioOneHalf_CheckedChanged(object sender, EventArgs e)
   {
       if(checkboxChocolateChip.checked)  
           totalPrice = priceChocolateChip * oneHalf;
       else if (checkboxOatMeal.Checked)
           totalPrice = priceOatMeal * oneHalf;          
       else if(checkboxVanillaWafer.Checked)
           totalPrice = priceVanillaWafer * oneHalf;
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked)
           totalPrice = (priceChocolateChip+priceOatMeal ) * oneHalf;
       else if(checkboxChocolateChip.checked && checkboxVanillaWafer.Checked)
               totalPrice = (priceChocolateChip+priceVanillaWafer ) * oneHalf;
       else if(checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =( priceOatMeal +priceVanillaWafer ) * oneHalf;
      
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =(priceChocolateChip + priceOatMeal +priceVanillaWafer ) * oneHalf;
       lblTotal.Text = \"Total is \" + totalPrice.ToString(\"C\");
   }

   private void radioOne_CheckedChanged(object sender, EventArgs e)
   {
       if(checkboxChocolateChip.checked)  
           totalPrice = priceChocolateChip * dozen;
       else if (checkboxOatMeal.Checked)
           totalPrice = priceOatMeal * dozen;
       else if(checkboxVanillaWafer.Checked)
           totalPrice = priceVanillaWafer * dozen;
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked)
           totalPrice = (priceChocolateChip+priceOatMeal ) * dozen;
       else if(checkboxChocolateChip.checked && checkboxVanillaWafer.Checked)
               totalPrice = (priceChocolateChip+priceVanillaWafer ) * dozen;
       else if(checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =( priceOatMeal +priceVanillaWafer ) * dozen;
      
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =(priceChocolateChip + priceOatMeal +priceVanillaWafer ) * dozen;
       lblTotal.Text = \"Total is \" + totalPrice.ToString(\"C\");
   }

   private void radioTwo_CheckedChanged(object sender, EventArgs e)
   {
       if(checkboxChocolateChip.checked)  
           totalPrice = priceChocolateChip * twodozen;
       else if (checkboxOatMeal.Checked)
           totalPrice = priceOatMeal * twodozen;
       else if(checkboxVanillaWafer.Checked)
           totalPrice = priceVanillaWafer * twodozen;
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked)
           totalPrice = (priceChocolateChip+priceOatMeal ) * twodozen;
       else if(checkboxChocolateChip.checked && checkboxVanillaWafer.Checked)
               totalPrice = (priceChocolateChip+priceVanillaWafer ) * twodozen;
       else if(checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =( priceOatMeal +priceVanillaWafer ) * twodozen;
      
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =(priceChocolateChip + priceOatMeal +priceVanillaWafer ) * twodozen;
       lblTotal.Text = \"Total is \" + totalPrice.ToString(\"C\");
   }
  
   private void radioThree_CheckedChanged(object sender, EventArgs e)
   {
       if(checkboxChocolateChip.checked)  
           totalPrice = priceChocolateChip * threedozen;
       else if (checkboxOatMeal.Checked)
           totalPrice = priceOatMeal * threedozen;
       else if(checkboxVanillaWafer.Checked)
           totalPrice = priceVanillaWafer * threedozen;
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked)
           totalPrice = (priceChocolateChip+priceOatMeal ) * threedozen;
       else if(checkboxChocolateChip.checked && checkboxVanillaWafer.Checked)
               totalPrice = (priceChocolateChip+priceVanillaWafer ) * threedozen;
       else if(checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =( priceOatMeal +priceVanillaWafer ) * threedozen;
      
       else if(checkboxChocolateChip.checked && checkboxOatMeal.Checked&& checkboxVanillaWafer.Checked)
               totalPrice =(priceChocolateChip + priceOatMeal +priceVanillaWafer ) * threedozen;
       lblTotal.Text = \"Total is \" + totalPrice.ToString(\"C\");
   }

   }
}

I have included calender inthis scenario for delivery time, you can drop a calender and label it to delivery date.

C#: How can I create program NinasCookieSource ithat includes a Form for a company named The Cookie Source. Allow the user to select from at least three types o
C#: How can I create program NinasCookieSource ithat includes a Form for a company named The Cookie Source. Allow the user to select from at least three types o
C#: How can I create program NinasCookieSource ithat includes a Form for a company named The Cookie Source. Allow the user to select from at least three types o

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site