Question: Using C# make these updates to the following code. Build a new startup welcome form with name XYZ This form will have two buttons. One

Using C# make these updates to the following code.

Build a new startup welcome form with name "XYZ"

This form will have two buttons. One for the original form1, to work with the ProductionWorker class.

And One for a new form, called AdminForm, to work with the new AdminWorker class.

-Replace Shift Number, with Pay rank (1-5).

-Replace Hourly rate, with Monthly rate

-Create a new AdminWorker class along the lines of the production worker class.

Form: 1

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

namespace Program10_1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } ProductionWorker pdWorker = new ProductionWorker();

private void button1_Click(object sender, EventArgs e) { try { pdWorker.Name = textBox1.Text; pdWorker.Number = int.Parse(textBox2.Text); pdWorker.HourlyRate = double.Parse(textBox3.Text); label4.Text = "Employee Name: " + pdWorker.Name + " " + "Employee Number: " + pdWorker.Number + " " + "Shift Number: " + pdWorker.ShiftNum + " " + "Hourly pay rate: " + pdWorker.HourlyRate.ToString("c"); } catch (Exception ex) { MessageBox.Show(ex.Message); } }

private void radioButton1_Click(object sender, EventArgs e) { if (radioButton1.Checked) { pdWorker.ShiftNum = 1; } }

private void radioButton2_CheckedChanged(object sender, EventArgs e) { if (radioButton2.Checked) { pdWorker.ShiftNum = 2; } } } }

Production Worker

using System; using System.Collections.Generic; using System.Linq; using System.Text;

namespace Program10_1 { class ProductionWorker : Employee { private int _shiftNum; private double _hourlyRate;

public ProductionWorker() {

}

public int ShiftNum { get { return _shiftNum; } set { _shiftNum = value; } }

public double HourlyRate { get { return _hourlyRate; } set { _hourlyRate = value; } } } }

Employee

using System; using System.Collections.Generic; using System.Linq; using System.Text;

namespace Program10_1 { class Employee { private string _name; private int _number;

public Employee() { }

public string Name { get { return _name; } set { _name = value; } }

public int Number { get { return _number; } set { _number = value; } } } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To update your C application based on the question we will create a new startup form named XYZ with two buttons one for the existing Form1 and another for a new form titled AdminForm Well also adjust ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!