I have a problem in the university that simplified comes a time where the interface asks the user if he has a card or not and I do not know how to do a subprocess depending on his answer, I leave my code the interface and the statement for see if you can help me, thank you very much
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;
using Microsoft.VisualBasic;
namespace Decisiones_caso_2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void BtnProcesar_Click(object sender, EventArgs e)
{
Principal();
}
private void BtnSalir_Click(object sender, EventArgs e)
{
Close();
}
private void Principal()
{
//Valores Entrada
int CantidadCompradores = 0;
string Nombre = "";
double CantidadBoletas = 0;
//Valores Salida
double ValorPagar = 0;
//Inicia el ciclo de control de repeticiones
do
{
CantidadCompradores = int.Parse(Interaction.InputBox("Digite La Cantidad De compradores", "Cantidad Compradores", null));
} while (CantidadCompradores <= 0);
TextCompradores.Text = CantidadCompradores.ToString("#0.00");
for (int ContadorCompradores = 0; ContadorCompradores < CantidadCompradores; ++ContadorCompradores)
{
//Leer Entradas
Nombre = Interaction.InputBox("Digite Nombre Del Comprador", "Nombre", null);
CantidadBoletas = double.Parse(Interaction.InputBox("Digite Cantidad De Boletas Que Desee Comprar", "Total Boletas", null));
//Mostrar Valores Leidos
TextNombre.Text = Nombre;
TextBoletas.Text = CantidadBoletas.ToString("#0.00");
//llamar al subproceso que realiza los calculos
ValorPagar = CalcularValorPagar(CantidadBoletas);
//Mostrar Resultados
textValorPagar.Text = ValorPagar.ToString("#0.00");
}
}
// Codifique el subproceso que corresponde a su diseño
private double CalcularValorPagar(double CantidadBoletas)
{
double ValorPagar = 0.0;
if (CantidadBoletas > 5)
{
ValorPagar = (1 - 15 / 100.0) * CantidadBoletas * 12000;
}
else
{
if (CantidadBoletas >= 3)
{
ValorPagar = (1 - 10 / 100.0) * CantidadBoletas * 12000;
}
else
{
ValorPagar = CantidadBoletas * 12000;
}
}
return (ValorPagar);
}
}
}
I do not know how to make the radiobuttons work, I have searched for tutorials but I do not understand how to apply it in this context.