Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c# Write compile and test a GUI program named NinasCookieSource. At form load, t

ID: 3691137 • Letter: C

Question

c#

Write compile and test a GUI program named NinasCookieSource.

At form load, the following object properties should be set:

• Chocolate Chip cookie radio button Checked property = True.

• One Dozen quantity radio button Checked property = True.

• DateTimePicker control MinDate property = the current date plus 3 days

• DateTimePicker control MaxDate property = the current date plus 10 days.

Changing the selected cookie type or quantity radio button should trigger an update to the total price displayed.

Changing the desired delivery date will trigger an update to the date displayed.

The following prices (per dozen) should be used for the cookie types: • Chocolate Chip: $8.99 • Oatmeal: $6.99 • Vanilla Wafer: $6.49

Explanation / Answer

Plz go through the below link and download application and run let me know your comments

https://we.tl/sS8iDLVHMi

design code

namespace NinasCookieSource
{
partial class NinasCookieSource
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region Windows Form Designer generated code

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.rbChocolateChip = new System.Windows.Forms.RadioButton();
this.label1 = new System.Windows.Forms.Label();
this.panel1 = new System.Windows.Forms.Panel();
this.rbVanillaWafer = new System.Windows.Forms.RadioButton();
this.rbOatmeal = new System.Windows.Forms.RadioButton();
this.panel2 = new System.Windows.Forms.Panel();
this.rbThreeDozens = new System.Windows.Forms.RadioButton();
this.rbTwoDozens = new System.Windows.Forms.RadioButton();
this.rbOneDozen = new System.Windows.Forms.RadioButton();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.textMinDate = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.textMaxDate = new System.Windows.Forms.TextBox();
this.maxDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.minDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.label5 = new System.Windows.Forms.Label();
this.lblTotalPrice = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.lblMinDate = new System.Windows.Forms.Label();
this.lblMaxDate = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.panel1.SuspendLayout();
this.panel2.SuspendLayout();
this.SuspendLayout();
//
// rbChocolateChip
//
this.rbChocolateChip.AutoSize = true;
this.rbChocolateChip.Checked = true;
this.rbChocolateChip.Location = new System.Drawing.Point(16, 14);
this.rbChocolateChip.Name = "rbChocolateChip";
this.rbChocolateChip.Size = new System.Drawing.Size(97, 17);
this.rbChocolateChip.TabIndex = 0;
this.rbChocolateChip.TabStop = true;
this.rbChocolateChip.Text = "Chocolate Chip";
this.rbChocolateChip.UseVisualStyleBackColor = true;
this.rbChocolateChip.CheckedChanged += new System.EventHandler(this.rbChocolateChip_CheckedChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(56, 57);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(75, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Cookie Types:";
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.panel1.Controls.Add(this.rbVanillaWafer);
this.panel1.Controls.Add(this.rbOatmeal);
this.panel1.Controls.Add(this.rbChocolateChip);
this.panel1.Location = new System.Drawing.Point(137, 27);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(178, 85);
this.panel1.TabIndex = 2;
//
// rbVanillaWafer
//
this.rbVanillaWafer.AutoSize = true;
this.rbVanillaWafer.Location = new System.Drawing.Point(16, 60);
this.rbVanillaWafer.Name = "rbVanillaWafer";
this.rbVanillaWafer.Size = new System.Drawing.Size(88, 17);
this.rbVanillaWafer.TabIndex = 2;
this.rbVanillaWafer.Text = "Vanilla Wafer";
this.rbVanillaWafer.UseVisualStyleBackColor = true;
this.rbVanillaWafer.CheckedChanged += new System.EventHandler(this.rbVanillaWafer_CheckedChanged);
//
// rbOatmeal
//
this.rbOatmeal.AutoSize = true;
this.rbOatmeal.Location = new System.Drawing.Point(16, 37);
this.rbOatmeal.Name = "rbOatmeal";
this.rbOatmeal.Size = new System.Drawing.Size(64, 17);
this.rbOatmeal.TabIndex = 1;
this.rbOatmeal.Text = "Oatmeal";
this.rbOatmeal.UseVisualStyleBackColor = true;
this.rbOatmeal.CheckedChanged += new System.EventHandler(this.rbOatmeal_CheckedChanged);
//
// panel2
//
this.panel2.BackColor = System.Drawing.SystemColors.InactiveCaption;
this.panel2.Controls.Add(this.rbThreeDozens);
this.panel2.Controls.Add(this.rbTwoDozens);
this.panel2.Controls.Add(this.rbOneDozen);
this.panel2.Location = new System.Drawing.Point(137, 118);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(178, 85);
this.panel2.TabIndex = 4;
//
// rbThreeDozens
//
this.rbThreeDozens.AutoSize = true;
this.rbThreeDozens.Location = new System.Drawing.Point(16, 60);
this.rbThreeDozens.Name = "rbThreeDozens";
this.rbThreeDozens.Size = new System.Drawing.Size(92, 17);
this.rbThreeDozens.TabIndex = 2;
this.rbThreeDozens.Text = "Three Dozens";
this.rbThreeDozens.UseVisualStyleBackColor = true;
this.rbThreeDozens.CheckedChanged += new System.EventHandler(this.rbThreeDozens_CheckedChanged);
//
// rbTwoDozens
//
this.rbTwoDozens.AutoSize = true;
this.rbTwoDozens.Location = new System.Drawing.Point(16, 37);
this.rbTwoDozens.Name = "rbTwoDozens";
this.rbTwoDozens.Size = new System.Drawing.Size(85, 17);
this.rbTwoDozens.TabIndex = 1;
this.rbTwoDozens.Text = "Two Dozens";
this.rbTwoDozens.UseVisualStyleBackColor = true;
this.rbTwoDozens.CheckedChanged += new System.EventHandler(this.rbTwoDozens_CheckedChanged);
//
// rbOneDozen
//
this.rbOneDozen.AutoSize = true;
this.rbOneDozen.Checked = true;
this.rbOneDozen.Location = new System.Drawing.Point(16, 14);
this.rbOneDozen.Name = "rbOneDozen";
this.rbOneDozen.Size = new System.Drawing.Size(79, 17);
this.rbOneDozen.TabIndex = 0;
this.rbOneDozen.TabStop = true;
this.rbOneDozen.Text = "One Dozen";
this.rbOneDozen.UseVisualStyleBackColor = true;
this.rbOneDozen.CheckedChanged += new System.EventHandler(this.rbOneDozen_CheckedChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(82, 157);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(49, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Quantity:";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(71, 234);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(50, 13);
this.label3.TabIndex = 5;
this.label3.Text = "MinDate:";
//
// textMinDate
//
this.textMinDate.Location = new System.Drawing.Point(137, 231);
this.textMinDate.Name = "textMinDate";
this.textMinDate.Size = new System.Drawing.Size(108, 20);
this.textMinDate.TabIndex = 6;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(71, 272);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(53, 13);
this.label4.TabIndex = 8;
this.label4.Text = "MaxDate:";
//
// textMaxDate
//
this.textMaxDate.Location = new System.Drawing.Point(138, 269);
this.textMaxDate.Name = "textMaxDate";
this.textMaxDate.Size = new System.Drawing.Size(100, 20);
this.textMaxDate.TabIndex = 10;
//
// maxDateTimePicker
//
this.maxDateTimePicker.Location = new System.Drawing.Point(238, 269);
this.maxDateTimePicker.Name = "maxDateTimePicker";
this.maxDateTimePicker.Size = new System.Drawing.Size(24, 20);
this.maxDateTimePicker.TabIndex = 11;
this.maxDateTimePicker.ValueChanged += new System.EventHandler(this.maxDateTimePicker_ValueChanged);
//
// minDateTimePicker
//
this.minDateTimePicker.Location = new System.Drawing.Point(242, 231);
this.minDateTimePicker.Name = "minDateTimePicker";
this.minDateTimePicker.Size = new System.Drawing.Size(20, 20);
this.minDateTimePicker.TabIndex = 12;
this.minDateTimePicker.ValueChanged += new System.EventHandler(this.minDateTimePicker_ValueChanged);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(73, 312);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(58, 13);
this.label5.TabIndex = 13;
this.label5.Text = "Total Price";
//
// lblTotalPrice
//
this.lblTotalPrice.AutoSize = true;
this.lblTotalPrice.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblTotalPrice.Location = new System.Drawing.Point(149, 307);
this.lblTotalPrice.Name = "lblTotalPrice";
this.lblTotalPrice.Size = new System.Drawing.Size(57, 20);
this.lblTotalPrice.TabIndex = 14;
this.lblTotalPrice.Text = "label6";
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(60, 342);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(71, 13);
this.label6.TabIndex = 15;
this.label6.Text = "Delivery Date";
//
// lblMinDate
//
this.lblMinDate.AutoSize = true;
this.lblMinDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMinDate.Location = new System.Drawing.Point(149, 337);
this.lblMinDate.Name = "lblMinDate";
this.lblMinDate.Size = new System.Drawing.Size(57, 20);
this.lblMinDate.TabIndex = 16;
this.lblMinDate.Text = "label6";
//
// lblMaxDate
//
this.lblMaxDate.AutoSize = true;
this.lblMaxDate.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMaxDate.Location = new System.Drawing.Point(286, 337);
this.lblMaxDate.Name = "lblMaxDate";
this.lblMaxDate.Size = new System.Drawing.Size(57, 20);
this.lblMaxDate.TabIndex = 17;
this.lblMaxDate.Text = "label6";
//
// label7
//
this.label7.AutoSize = true;
this.label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label7.Location = new System.Drawing.Point(253, 337);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(25, 17);
this.label7.TabIndex = 18;
this.label7.Text = "To";
//
// NinasCookieSource
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(497, 390);
this.Controls.Add(this.label7);
this.Controls.Add(this.lblMaxDate);
this.Controls.Add(this.lblMinDate);
this.Controls.Add(this.label6);
this.Controls.Add(this.lblTotalPrice);
this.Controls.Add(this.label5);
this.Controls.Add(this.minDateTimePicker);
this.Controls.Add(this.maxDateTimePicker);
this.Controls.Add(this.textMaxDate);
this.Controls.Add(this.label4);
this.Controls.Add(this.textMinDate);
this.Controls.Add(this.label3);
this.Controls.Add(this.panel2);
this.Controls.Add(this.label2);
this.Controls.Add(this.panel1);
this.Controls.Add(this.label1);
this.Name = "NinasCookieSource";
this.Text = "NinasCookieSource";
this.Load += new System.EventHandler(this.NinasCookieSource_Load);
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();

}

#endregion

private System.Windows.Forms.RadioButton rbChocolateChip;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.RadioButton rbOatmeal;
private System.Windows.Forms.RadioButton rbVanillaWafer;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.RadioButton rbThreeDozens;
private System.Windows.Forms.RadioButton rbTwoDozens;
private System.Windows.Forms.RadioButton rbOneDozen;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textMinDate;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox textMaxDate;
private System.Windows.Forms.DateTimePicker maxDateTimePicker;
private System.Windows.Forms.DateTimePicker minDateTimePicker;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label lblTotalPrice;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label lblMinDate;
private System.Windows.Forms.Label lblMaxDate;
private System.Windows.Forms.Label label7;
}
}

.cs code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NinasCookieSource
{
public partial class NinasCookieSource : Form
{
public NinasCookieSource()
{
InitializeComponent();
}

private void NinasCookieSource_Load(object sender, EventArgs e)
{


DateTime minResult = minDateTimePicker.Value.Add(TimeSpan.FromDays(3));
textMinDate.Text = minResult.ToString("yyyy-MM-dd");
DateTime maxDateResult = maxDateTimePicker.Value.Add(TimeSpan.FromDays(10));
textMaxDate.Text = maxDateResult.ToString("yyyy-MM-dd");
lblTotalPrice.Text = "$8.99";
lblMinDate.Text = textMinDate.Text;
lblMaxDate.Text = textMaxDate.Text;
}
double dozenval,coockiesval;
private void rbChocolateChip_CheckedChanged(object sender, EventArgs e)
{

if (rbOneDozen.Checked)
dozenval = 1;
if (rbTwoDozens.Checked)
dozenval = 2;
if (rbThreeDozens.Checked)
dozenval = 3;
lblTotalPrice.Text = "$" + 8.99 * dozenval;
lblMinDate.Text = textMinDate.Text;
lblMaxDate.Text = textMaxDate.Text;
}

private void rbOatmeal_CheckedChanged(object sender, EventArgs e)
{
if (rbOneDozen.Checked)
dozenval = 1;
if (rbTwoDozens.Checked)
dozenval = 2;
if (rbThreeDozens.Checked)
dozenval = 3;
lblTotalPrice.Text = "$" + 6.99 * dozenval;
lblMinDate.Text = textMinDate.Text;
lblMaxDate.Text = textMaxDate.Text;
}

private void rbVanillaWafer_CheckedChanged(object sender, EventArgs e)
{
if (rbOneDozen.Checked)
dozenval = 1;
if (rbTwoDozens.Checked)
dozenval = 2;
if (rbThreeDozens.Checked)
dozenval = 3;
lblTotalPrice.Text = "$" + 6.49 * dozenval;
lblMinDate.Text = textMinDate.Text;
lblMaxDate.Text = textMaxDate.Text;
}

private void rbOneDozen_CheckedChanged(object sender, EventArgs e)
{
if (rbChocolateChip.Checked)
coockiesval = 8.99;
if (rbOatmeal.Checked)
coockiesval = 6.99;
if (rbVanillaWafer.Checked)
coockiesval = 6.49;
lblTotalPrice.Text = "$" + coockiesval * 1;
lblMinDate.Text = textMinDate.Text;
lblMaxDate.Text = textMaxDate.Text;
}

private void rbTwoDozens_CheckedChanged(object sender, EventArgs e)
{
if (rbChocolateChip.Checked)
coockiesval = 8.99;
if (rbOatmeal.Checked)
coockiesval = 6.99;
if (rbVanillaWafer.Checked)
coockiesval = 6.49;
lblTotalPrice.Text = "$" + coockiesval * 2;
lblMinDate.Text = textMinDate.Text;
lblMaxDate.Text = textMaxDate.Text;
}

private void rbThreeDozens_CheckedChanged(object sender, EventArgs e)
{
if (rbChocolateChip.Checked)
coockiesval = 8.99;
if (rbOatmeal.Checked)
coockiesval = 6.99;
if (rbVanillaWafer.Checked)
coockiesval = 6.49;
lblTotalPrice.Text = "$" + coockiesval * 3;
lblMinDate.Text = textMinDate.Text;
lblMaxDate.Text = textMaxDate.Text;
}

private void minDateTimePicker_ValueChanged(object sender, EventArgs e)
{
DateTime minResult = minDateTimePicker.Value.Add(TimeSpan.FromDays(3));
textMinDate.Text = minResult.ToString("yyyy-MM-dd");
lblMinDate.Text = textMinDate.Text;

}

private void maxDateTimePicker_ValueChanged(object sender, EventArgs e)
{
DateTime maxDateResult = maxDateTimePicker.Value.Add(TimeSpan.FromDays(10));
textMaxDate.Text = maxDateResult.ToString("yyyy-MM-dd");
lblMaxDate.Text = textMaxDate.Text;
}


}
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Chat Now And Get Quote