Skip to main content

Posts

Showing posts from July, 2015

GPA Calculator using C++

SOURCE CODE: private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) { String^ pgrd1=(textBox1->Text); String^ pgrd2=(textBox2->Text); String^ pgrd3=(textBox3->Text); String^ pgrd4=(textBox4->Text); String^ pgrd5=(textBox5->Text); float GPA1,GPA2,GPA3,GPA4,GPA5; float GPA=0; if (pgrd1==""||pgrd2==""||pgrd3==""||pgrd4==""||pgrd5=="") { MessageBox::Show("Fields cannot be empty!"); } else { //***************************************1st subject***************************************************// if (pgrd1=="A+"||pgrd1=="A") { GPA1=4.0; } else if (pgrd1=="A-") { GPA1=3.7; } else if (pgrd1=="B+") { GPA1=3.3; } else if (pgrd1=="B") { GPA1=3.0; } else if (pgrd1==&quo