0% found this document useful (0 votes)
4 views2 pages

Programming Classes

The document contains four programs that perform various calculations and UI updates. Program 1 calculates the total and average of three numbers, Program 2 computes the cost and tax based on price and quantity, Program 3 calculates salary components and net pay, and Program 4 populates a second combo box based on the selection of the first combo box. Each program updates relevant UI elements with the computed values.

Uploaded by

Abdullahi Idris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views2 pages

Programming Classes

The document contains four programs that perform various calculations and UI updates. Program 1 calculates the total and average of three numbers, Program 2 computes the cost and tax based on price and quantity, Program 3 calculates salary components and net pay, and Program 4 populates a second combo box based on the selection of the first combo box. Each program updates relevant UI elements with the computed values.

Uploaded by

Abdullahi Idris
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Program 1:

{
int fnum = Convert.ToInt32(txtfnum.Text);
int snum = Convert.ToInt32(txtsnum.Text);
int tnum = Convert.ToInt32(txttnum.Text);
decimal total = fnum + snum + tnum;
label5.Text = total.ToString();
decimal average = total / 3;
label4.Text = average.ToString();

Program 2:
{
int price = Int32.Parse(pricetxt.Text);
decimal quantity = quantitynumeric.Value;
decimal cost = price * quantity;
costtxt.Text = cost.ToString();
decimal tax = price / 100;
taxtxt.Text = tax.ToString();
decimal actualcost = cost + tax ;
actualcosttxt.Text = actualcost.ToString();

Program 3:
{
Decimal salary = Int32.Parse(txtsalary.Text);
Decimal DA = salary / 100 * 30 ;
lblda.Text = DA.ToString();
Decimal HRA = salary / 100 * 12;
lblhra.Text = HRA.ToString();
Decimal PF = salary / 100 * 10;
lblpf.Text = PF.ToString();
Decimal gross = salary + DA + HRA ;
lblgross.Text = gross.ToString();
Decimal netpay = gross - PF ;
lblnetpay.Text = netpay.ToString();

}
{
Application.Exit();
}
{
txtsalary.Text = " ";
lblda.Text = " ";
lblhra.Text = " ";
lblpf.Text = " ";
lblgross.Text = " ";
lblnetpay.Text = " ";

Program 4:
{
combobox2.Items.Clear();
if (combobox1.SelectedItem == "FAMS")
{
combobox2.Items.Add("Accounting");
combobox2.Items.Add("Economics");
combobox2.Items.Add("Arabic");
combobox2.Items.Add("Hausa");
}
else
{
combobox2.Items.Add("computer science");
combobox2.Items.Add("cyber security");
combobox2.Items.Add("information technology");
combobox2.Items.Add("information system");
combobox2.Items.Add("software engineering");

}
}

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy