C#.net

Student Marks Calculation WPF in C#.NET

This tutorial will teach how to make a  Student Grade Calculation in WPF C#.net application step by step. Input the studentname and avg marks to calcuate the grade.

if the average is > 50 – Pass otherwise fail

First you have design the Calculator.

MainWindow.xaml

<Window x:Class="StudentMarksApp.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:StudentMarksApp"
        mc:Ignorable="d"
        Title="Student Marks Calculation App" Height="350" Width="380">
    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="5"/>
        </Grid.RowDefinitions>

        <StackPanel Grid.Column="1"
                    Grid.Row="1">

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="250"/>

                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>

                    <RowDefinition Height="25"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="5"/>
                    <RowDefinition Height="25"/>
                    <RowDefinition Height="10"/>
                </Grid.RowDefinitions>

                <Label Content="Marks 1 :" 
                       Grid.Row="0"
                       Grid.Column="0"
                       
                       />

                <TextBox
                    x:Name="TextBoxMarks1"
                    Grid.Row="0"
                    Grid.Column="1"
                    />

                <Label Content="Marks 2 :"
                         Grid.Row="2"
                         Grid.Column="0"
                       />

                <TextBox
                    x:Name="TextBoxMarks2"
                    Grid.Row="2"
                    Grid.Column="1"
                    />

                <Label Content="Marks 3 :"
                         Grid.Row="4"
                         Grid.Column="0"
                       />

                <TextBox
                    x:Name="TextBoxMarks3"
                    Grid.Row="4"
                    Grid.Column="1"
                    />


                <Label Content="Total :"
                         Grid.Row="6"
                         Grid.Column="0"
                       />

                <TextBox
                    x:Name="TextBoxTotal"
                    Grid.Row="6"
                    Grid.Column="1"
                    />

                <Label Content="Avg :"
                         Grid.Row="8"
                         Grid.Column="0"
                       />

                <TextBox
                    x:Name="TextBoxAvg"
                    Grid.Row="8"
                    Grid.Column="1"
                    />
                <Label Content="Grade :"
                         Grid.Row="10"
                         Grid.Column="0"
                       />

                <TextBox
                    x:Name="TextBoxGrade"
                    Grid.Row="10"
                    Grid.Column="1"
                    />
            </Grid>

            <StackPanel
                     Grid.Row="16"
                     Grid.ColumnSpan="2"
                     Orientation="Horizontal">

                <Button
                        Width="50"
                       
                        Content="Cal"
                        x:Name="ButtonCal"
                        Margin="10 0 10 0"
                        Click="ButtonCal_Click" Background="#FF04097E" Foreground="White"/>

                <Button
                        Width="50"
                        Content="Clear"
                        x:Name="ButtonClear"
                        Margin="10 0 10 0"
                        Click="ButtonClear_Click" Background="#FF04097E" Foreground="White"
                    />


            </StackPanel>

        </StackPanel>

    </Grid>
</Window>

MainWindow.xaml.cs

 

 

 

 

 

admin

Recent Posts

Employee Working Hours Calculation System using C#.net

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

1 week ago

Java Payroll System Calculate Employee Overtime

Act as a Java developer to create a program that calculates the gross wage for…

2 weeks ago

Employee Working Hours Calculation System using Java

Initialize the employee number, Hourswork,and Hoursrate to calculate a grosswage use the following condition. if…

2 weeks ago

Laravel 11 School Management System

In this tutorial, we will teach you how to create a simple school management system…

3 weeks ago

How to Make Admin Panel Using React MUI

I have design the Admin Basic templete using React MUI Design Admin Dashboard and Login.Here…

1 month ago

Install Laravel Breeze for Authentication Using Laravel 11

In this tutorial ,i am to going teach the Laravel Breeze.Laravel Breeze provides a simple…

1 month ago