//Calories Counter Application Program.
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 WindowsFormsApplication2
{
public partial class CalorieCounter : Form
{
int input1 = 0; //Declaring variable for input of calories 80
int input2 = 0;//Declaring variable for input of calories 115
int input3 = 0;//Declaring variable for input of calories 90
int input4 = 0;//Declaring variable for input of calories 120
char operation;
double result = 0.0; // Holds the total calculation of calories
public CalorieCounter()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
Private void TotalCalories_TextChanged(object sender, EventArgs e)
{
}
private void btn1_Click(object sender, EventArgs e)
{
this.TotalCalories.Text = "";//New Lines
input1 += 80;//Records user inputs for 80 Calories
this.TotalCalories.Text += input1;//New Lines
operation = '+';//Addition operator
if (operation == '+')
{
result = result = input1 + input2 + input3 + input4;//Calculates the total after clicking
TotalCalories.Text = result.ToString();//Display the total Calories at the textbox
}
}
private void btn2_Click(object sender, EventArgs e)
{
this.TotalCalories.Text = "";//New Lines
input2 += 115;//Records user inputs for 115 Calories
this.TotalCalories.Text += input1;//New Lines
Operation = '+';//Addition operator
if (operation == '+')
{
result = result = input1 + input2 + input3 + input4;//Calculates the total after clicking
TotalCalories.Text = result.ToString();//Display the total Calories at the textbox
}
}
private void btn3_Click(object sender, EventArgs e)
{
this.TotalCalories.Text = "";//New Lines
input3 += 90;//Records user inputs for 90 Calories
this.TotalCalories.Text += input1;//New Lines
operation = '+';//Addition operator
if (operation == '+')
{
result = result = input1 + input2 + input3 + input4;//Calculates the total after clicking
TotalCalories.Text = result.ToString();//Display the total Calories at the textbox
}
}
private void btn4_Click(object sender, EventArgs e)
{
this.TotalCalories.Text = "";//New Lines
input1 += 120;//Records user inputs for 120 Calories
this.TotalCalories.Text += input1;//New Lines
operation = '+';//Addition operator
if (operation == '+')
{
result = result = input1 + input2 + input3 + input4;//Calculates the total after clicking
TotalCalories.Text = result.ToString();//Display the total Calories at the textbox
}
}
private void reset_Click(object sender, EventArgs e) //This Reset The variable inputs and textbox TotalCalories to Zero interger.
{
this.TotalCalories.Text = "0";
input1 = 0;
input2 = 0;
input3 = 0;
input4 = 0;
}
private void exitbtn_Click(object sender, EventArgs e)//Close the application window
{
this.Close ();
}
}
}
java assignment help, java homework help, programming homework help, python assignment help, programming assignment, computer science assignment help, computer science homework help, python homework help, do my programming homework, computer science assignment, computer science homework, c++ homework help, java programming assignment help, php assignment help,