Quantcast
Channel: Visual Studio General Questions forum
Viewing all articles
Browse latest Browse all 21115

Having trouble with my code.

$
0
0
I need help with my code. I have alot of errors and I dont know how to fix it. its greatly appreciated if you can help. Thanks in advance for answering and reading this question.

The code is pretty self explanatory on what I am trying to accomplish.

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 WindowsFormsApplication1
{
    public partial class order : Form
    {
        public order()
        {
            InitializeComponent();
        }
        //declaring global variables
        double piece24;
        double piece12;
        double CokePepsi;
        double Wateryum;
        double Desert;
        double Total;
        double SubtotalPlz;
        double salestax;
        double totalprice;
        double TradeInn;
        double packageprice;
        double baseprice;
     
       
        private void order_Load(object sender, EventArgs e)
        { //changing background colour
            this.BackColor = System.Drawing.Color.Red;

            //setting prices
            double piece12 = 1299;
            double piece24 = 2199;
            double beverages = 199;
            double desert = 299;
            TotalLbl.Text = "0";
            baseprice = 0;
            packageprice = 0;
            TradeInn.Text = "0";

        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            BasePrice.Text = piece12.ToString("c");
            BasePrice = piece12;
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            BasePrice.Text = piece24.ToString("c");
            BasePrice.Text = piece24;
        }

        private void radioButton6_CheckedChanged(object sender, EventArgs e)
        {
            BasePrice.Text = Desert.ToString("c");
            BasePrice.Text = Desert;
        }

        private void radioButton4_CheckedChanged(object sender, EventArgs e)
        {
            BasePrice.Text = Wateryum.ToString("c");
            BasePrice.Text = Wateryum;
        }

        private void Calculate_Click(object sender, EventArgs e)
        {
            //Calculating prices
            TradeInn = double.Parse(TradeInn.Text);
            SubtotalPlz = BasePrice + PackagePrice - TradeInn;
            salestax = SubtotalPlz * 0.14;
            totalprice = SubtotalPlz + salestax;

            TradeInn.Text = TradeInn.ToString("c");
            SubtotalPlz.Text = SubtotalPlz.ToString("c");
            salestaxx.Text = salestax.ToString("c");
            TotalLbl.Text = Total.ToString("c");
        }

        private void radioButton5_CheckedChanged(object sender, EventArgs e)
        {
            BasePrice.Text = PepsiCoke.ToString("c");
            BasePrice.Text = PepsiCoke.ToString("c");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            BasePrice.Text = "";
            PackagePrice.Text = "";
            salestaxx.Text = "";
            SubtotalPlz.Text = "";
            TradeInn.Text = "";
            Total.Text = "";
        }


      
    }
}

Viewing all articles
Browse latest Browse all 21115

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>