Workshop Selector The following table shows a training company\'s workshops, the
ID: 3775463 • Letter: W
Question
Workshop Selector
The following table shows a training company's workshops, the number of days of , and their registration fees.
Workshop Number of Days Registration Fee
Handling Stress 3 $1,000
Time Management 3 $800
Supervision Skills 3 $1,500
Negotiation 5 $1,300
How To Interview 1 $500
The training company conducts its workshops in the six locations shown in the following table. The table also shows the lodging fees per day at each location.
Location Lodging Fees Per Day
Austin $150
Chicago $225
Dallas $175
Orlando $300
Phoenix $175
Raleigh $150
When a customer registers for a workshop, he or she must pay the registration fee plus the lodging fees for the selected location. For example, here are teh charges to attend the Supervision Skills workshop in Orlando.
Registration $1,500
Lodging $300 X 3 days = $900
Total $2,400
Create an application that lets the user select a workshop from one ListBox and a location from another ListBox. When the user clicks a button, the application should calculate and display the registration cost, the lodging cost, and the total cost.
Could you please help with this, It is a problem in C#, I'm not sure even where to begin?
Chapter 5 programming problem 12
Starting out with visual c# 2012
Thanks
John
Explanation / Answer
Code :
using System;
usinf 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 HW4CH4_12{
public partila class Form1 : Form
{
public Form1()
{
Initialize Component();
}
private void calculate_Click(object sender,EventArgs e){
string workshop;
double days;
double regfee;
if(workshopListBox.SelectedIndex!=-1){
workshop = workshopListBox.SelectedIndex.ToString();
switch(workshop)
{
case "Handling Stress":
days = 3;
regfee = 1000;
break;
case "Time Management":
days = 3;
regfee = 800;
break;
case "Supervision SKills":
days = 3;
regfee = 1500;
break;
case "Negotiation":
days = 5;
regfee = 1300;
break;
case "How to Interview":
days = 1;
regfee = 500;
break;
}
days = double.Parse(lodginOutputLabel.Text);
lodginOutputLabel.Text="$" + days;
regfee=double.Parse(registOutputLabel.Text);
registOutputLabel.Text = "$" + regfee;
}
else{
MessageBox.Show("Select a workshop");
}
string location;
double lodfee;
if(locationListBox.SelectedIndex!=-1)
location = locationListBox.SelectedIndex.ToString();
switch(Location)
{
case "Austin":
lodfee = 150;
break;
case "Chicago":
lodfee = 225;
break;
case "Dallas":
lodfee = 175;
break;
case "Orlando":
lodfee = 300;
break;
case "Pheonix":
lodfee = 175;
break;
case "Raleigh":
lodfee = 150;
break;
}
lodfee = double.Parse(registOutputLabel.Text);
registOutputLabel.Text ="$" + lodfee;
}
else{
MessageBox.Show("Select a location");
}
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.