I am new to C# and have a practice activity I'm really struggling with however am unable to get guidance from my tutor as he is currently ill.
I believe I'm stuck on multiple things so I'll try to be as descriptive as possible..
A screenshot of the application will be linked below. The idea of this application is to create a gym membership system, which allows users to see 'Membership cost', 'Extra charges', 'Total discount', 'Net Membership cost' and 'Regular payment amount', so 5 different calculations are required to be put into the textboxes at the bottom of the application.
These different calculations are done by clicking on separate radio buttons and checkboxes. For example as seen in the picture one radio button may equal '$10' and another may equal '$15'
I wish I had more code to show but I'm really confused so all help is appreciated.
My questions are:
How would I get the application to display 5 different calculations each for a different text box?
How would you get an equation to calculate a percentage discount?
Kind Regards :)
My 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 WindowsFormsApp11
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
double results;
int x, y, z, a, b;
x = Convert.ToInt16(textbox5.text)
y = Convert.ToInt16(textbox6.text)
z = Convert.ToInt16(textbox7.text)
a = Convert.ToInt16(textbox8.text)
b = Convert.ToInt16(textbox9.text)
if (radioButton1.Checked == true)
{
value = 10
}
else if (radioButton2.Checked == true)
{
value = 15
}
else if (radioButton3.Checked == true)
{
value = 20
}
if (radioButton4.Checked == true)
{
value = 10
}
else if (radioButton5.Checked == true)
{
value = 15
}
else if (radioButton6.Checked == true)
{
value = 20
}
if (radioButton7.Checked == true)
{
value = 10
}
else if (radioButton8.Checked == true)
{
value = 15
}
if (radioButton9.Checked == true)
{
value = 10
}
else if (radioButton10.Checked == true)
{
value = 15
}
if (checkBox1.Checked == true)
if (checkBox2.Checked == true)
if (checkBox3.Checked == true)
if (checkBox4.Checked == true)
}
}
}