Lab 2 Applications Development SD2 Q1. Allow the use to enter their data of birth (use the DateTimePicker control) the program should then display a message box as follows – “Sorry you are not over...

1 answer below »
Dummy


Lab 2 Applications Development SD2 Q1. Allow the use to enter their data of birth (use the DateTimePicker control) the program should then display a message box as follows – “Sorry you are not over 18” – for users < 18.="" “welcome="" to="" the="" site="" you="" are="" xx”="" –="" for="" user=""> 18 and where XX is the users age. Data Validation – make sure the user cannot enter a future date. Q2. This program will calculate the cost of a stay at a hotel. The user should enter their arrival date and their departure date. The program should the calculate and display. · the number of nights the user is staying. · cost of stay – first 5 nights 100 euro, after 5 nights cost falls to 70 euro. Data Validation: the from date must be less than the future date. Q3. Q4 Process Pizza order: Create a system with the following rules: · Allow the user to enter their name and address. · Allow them to order several pizzas if they require in one order. · For each pizza · Size selects from 3 options – (small 5 euro, medium 7 euro and large 10 euro) only one size can be selected. · The user selects a base – only one from the following options (thick, thin, cheese filled) note cheese filled base costs 2 euro extra. · Allow the user to select topping – the use can select several toppings. The program should list 10 options. The user can select as many toppings as they wish – note the first 3 toppings are free then a cost of .50 cent per topping is applied to the cost of the pizza. · Allow the user to add several sides to their order each side should be priced individually, for example Large Bottle of Coke: 2.50 etc – have at least 6 sides to select from. · Provide an order summary button – when selected the user will be presented with a detail of their order as follows: Name:xxxxxxxxxxx Address:XXXXXXXXXXXXXX Date: XXXXX Time: XXXXX Order details: Pizza (1) Size:xxx Base:xxxx Toppings:xxxxxx Cost:xx.xx Pizza (2) Size:xxx Base:xxxx Toppings:xxxxxx Cost:xx.xx Sides: XXXXXXXX, XXXXXXXXXX, XXXXXXXX Cost: xxxxx Total Due: XXXXX.XX
Answered 6 days AfterJun 30, 2021

Answer To: Lab 2 Applications Development SD2 Q1. Allow the use to enter their data of birth (use the...

Nikita answered on Jul 07 2021
133 Votes
Application_Development/.vs/Application_Development/v16/.suo
Application_Development/Age_Calculator.cs
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 Application_Development
{
public partial class Age_Calculator : Form
{
public Age_Calculator()
{
InitializeComponent();
}
private void btnSubmit_Click(object sender, E
ventArgs e)
{
int CurrentYear =Convert.ToInt32( DateTime.Now.Year.ToString());
int EnterYear = Convert.ToInt32(dateTimePicker1.Value.Year.ToString());
int Age = CurrentYear - EnterYear;

if (dateTimePicker1.Value > DateTime.Now)
{
MessageBox.Show("Please enter valid date.");
}
else
{
if(Age<18)
{
MessageBox.Show("Sorry you are not over 18");
}
else if (Age > 18)
{
MessageBox.Show("Welcome to the site you are '"+Age+"'");
}
}
}
private void Form1_Load(object sender, EventArgs e)
{
}
}
}
Application_Development/Age_Calculator.Designer.cs
namespace Application_Development
{
partial class Age_Calculator
{
///
/// Required designer variable.
///

private System.ComponentModel.IContainer components = null;
///
/// Clean up any resources being used.
///

/// true if managed resources should be disposed; otherwise, false.
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.dateTimePicker1 = new System.Windows.Forms.DateTimePicker();
this.btnSubmit = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(41, 86);
this.label1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(128, 29);
this.label1.TabIndex = 0;
this.label1.Text = "Enter DOB";
//
// dateTimePicker1
//
this.dateTimePicker1.Location = new System.Drawing.Point(186, 79);
this.dateTimePicker1.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
this.dateTimePicker1.Name = "dateTimePicker1";
this.dateTimePicker1.Size = new System.Drawing.Size(309, 35);
this.dateTimePicker1.TabIndex = 1;
//
// btnSubmit
//
this.btnSubmit.Location = new System.Drawing.Point(186, 127);
this.btnSubmit.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
this.btnSubmit.Name = "btnSubmit";
this.btnSubmit.Size = new System.Drawing.Size(311, 49);
this.btnSubmit.TabIndex = 2;
this.btnSubmit.Text = "Submit";
this.btnSubmit.UseVisualStyleBackColor = true;
this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click);
//
// label2
//
this.label2.Dock = System.Windows.Forms.DockStyle.Top;
this.label2.Location = new System.Drawing.Point(0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(629, 55);
this.label2.TabIndex = 3;
this.label2.Text = "Age Calculator";
this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(14F, 29F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(629, 251);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnSubmit);
this.Controls.Add(this.dateTimePicker1);
this.Controls.Add(this.label1);
this.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Margin = new System.Windows.Forms.Padding(5, 4, 5, 4);
this.Name = "Form1";
this.Text = "Form1";
this.Load += new System.EventHandler(this.Form1_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.DateTimePicker...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here