• Welcome to ForumKorner!
    Join today and become a part of the community.

MY FIRST EVER PROJECTS MADE IN C#

Junior

Active Member
Reputation
0
Made these in Visual Studio 2012 Professional edition. Just contributing to this dead section I guess.

byrILxf.png



8B1edE8.png
 

Junior

Active Member
Reputation
0
Nokia said:
Or you can just wait for your grades and pay... 

I don't even get what you're trying to say, these are things I coded in C# for a class I'm doing.


Hassam said:
that's pretty cool. How long did you spend on this?

I'm a beginner so it took me about 3 hours just to make these, the calculations for the buttons are a bitch.
 

Chill

Well-Known Member
Reputation
0
Junior said:
I don't even get what you're trying to say, these are things I coded in C# for a class I'm doing.




I'm a beginner so it took me about 3 hours just to make these, the calculations for the buttons are a bitch.


Junior, you should try and build a database.

You could make more money off that alone than gamertags.
 

Odus

User is banned.
Reputation
0
Ooookay I see a UI here, drag 'n drop - not very hard. How about some code?
 

Riku

Member
Reputation
0
Does this stuff actually work? You should compile it into an *.exe and upload it here for us to use :D
 

Junior

Active Member
Reputation
0
Odus said:
Ooookay I see a UI here, drag 'n drop - not very hard. How about some code?

Obviously there's code, I had to input the features of what the buttons do and the calculations.

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;


namespace Student_Grade_Processor
{
    public partial class GradeProcessor : Form
    {
        public GradeProcessor()
        {
            InitializeComponent();
        }
        
        // calculates the average grade, letter grade, and quiz dropped
        private void btnCalculate_Click(object sender, EventArgs e)




        {
            double quiz1;           // quiz number one grade
            double quiz2;           // quiz number two grade
            double quiz3;           // quiz number three grade
            double midTerms;        // midterm exam grade
            double finals;          // final exam score grade
            double courseGrades;    // quiz number one grade




            quiz1 = Convert.ToDouble(textBox1.Text);
            quiz2 = Convert.ToDouble(textBox2.Text);
            quiz3 = Convert.ToDouble(textBox3.Text);
            midTerms = Convert.ToDouble(textBox4.Text);
            finals = Convert.ToDouble(textBox5.Text);




            double[] quizScores = { quiz1, quiz2, quiz3 };




            // determines lowest score out of the quizzes
            double lowestScore = quizScores.Min();
            string quizDropped = "";




            if (lowestScore == quiz1)
            {
                quizDropped = "#1";
            }
            else if (lowestScore == quiz2)
            {
                quizDropped = "#2";
            }
            else
            {
                quizDropped = "#3";
            }




            double quizGrades = (((quiz1 + quiz2 + quiz3) - lowestScore) / 2);       // calculates average quiz grade
            courseGrades = ((quizGrades * 0.3) + (midTerms * 0.3) + (finals * 0.4)); // calculates the total grade of all quizzes and exams




            // assigns a letter grade depending on the grade
            char letterGrade = 'X';




            if (courseGrades > 89)
            {
                letterGrade = 'A';
            }
            else if (courseGrades > 79)
            {
                letterGrade = 'B';
            }
            else if (courseGrades > 69)
            {
                letterGrade = 'C';
            }
            else if (courseGrades > 59)
            {
                letterGrade = 'D';
            }
            else if (courseGrades < 59)
            {
                letterGrade = 'F';
            }




            // the following displays the results from the calculations
            lblAverage.Text = Convert.ToString(courseGrades);    // displays the course average
            lblLetter.Text = Convert.ToString(letterGrade);      // displays a letter grade depending on the course average
            lblDroppedQuiz.Text = Convert.ToString(quizDropped); // displays which quiz was dropped out of the 3
        }
    }
}

This is the code for the Student Grade Processor I made.
 

Odus

User is banned.
Reputation
0
If the grades aren't floating point (1.2345...) i.e whole then don't use double, use int (shortened from: 'integer').
There's no need to call from the System.Convert namespace when you have .ToString() method at your disposal within .NET which if I'm not mistaken, calls it once more.
Initialize your variables to avoid null reference exceptions.
Speaking of initializing, don't initialize string types with "", use String.Empty. Empty quotes creates an object in memory, the latter doesn't.
Swap out your cascading elseif on the courseGrades operand to a switch statement. Cleaner and (depending on var density, sometimes faster albeit miniscule)

Novice mistakes so no worries. Since you're on HF anyway (I'm sure), I suggest you post it there in future if you want feedback, few can offer it here plus like you said: this section is dead. I'm there too if you need help and want to PM me.
 

Held

User is banned.
Reputation
0
This is actually a very good start for you. The interface looks fairly decent and I'm guessing it works? ;)

Anyway, you should proceed on expanding! Make more applications like a web browser, database, or program that stores business client information.
 

1UP

Power member.
Reputation
0
All I see is photos of a form, show us the code.
 

NoTez

Onyx user!
Reputation
0
Static said:
All I see is photos of a form, show us the code.

If you read the thread, you would see that there is a code provided in the last post of the page one.
 

1UP

Power member.
Reputation
0
Naughty said:
If you read the thread, you would see that there is a code provided in the last post of the page one.
I read the OP, not the comments..
 

NoTez

Onyx user!
Reputation
0
Static said:
I read the OP, not the comments..

Don't complain about not getting the code if it was provided, all it takes is to quickly read through comments. (Unless there is a dozen replies.)
 

1UP

Power member.
Reputation
0
Naughty said:
Don't complain about not getting the code if it was provided, all it takes is to quickly read through comments. (Unless there is a dozen replies.)
well first of all, if this is his first program ever, he should most definitely post the source so people can give tips and what not.
And I'm not complaining just stating buddy, and I hardly read comments why would I.
 
Top