Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Bookkeeping Guidebook A Practitioners Guide

Authors: Steven M. Bragg

1st Edition

1938910419, 978-1938910418

Students also viewed these Databases questions