Write a C# Windows application to calculate student tuition. Create a Windows Fo
ID: 664903 • Letter: W
Question
Write a C# Windows application to calculate student tuition. Create a Windows Form Application with name StudentForm. When the program starts, it should display the following form:
Student ID
Student Name
Residency
Credits
Tuition
The user may type in the student ID, student name, number of credits, and select the residency. The proram will calculate the tuition when the user clicks the Calculate button. Tuition rate is $300.00 per credit for resident students and $800.00 per credit for non resident students.
The program should use Label, TextBox, RadioButton, and Button controls.
Explanation / Answer
using System;
using System.Collections.Generic;
using System.Text;
namespace StudentTuition
{
class StudentForm
{
static void Main(string[] args)
{
Console.Write("This is a program of calculating the student tuition.");
double HoursAndCredits = Hours_And_Credits();
double FeePaid = Fee_paid();
double LateFee = Late_fee();
Console.Write(" The fee you paid: {0:C}", FeePaid);
Console.Write(" The late fee you might have to pay: {0:C}", LateFee);
Console.WriteLine(" Total you paid is: {0:C}", HoursAndCredits + FeePaid + LateFee);
Console.WriteLine(" ");
Console.ReadLine();
}
static double Hours_And_Credits()
{
Console.Write(" Please enter the credit hour(hours) you are taking: ");
double Result_Of_CreditHours = int.Parse(Console.ReadLine());
Console.Write(" Please enter the cost of per credit hour: ");
double Result_Of_PerCreditHour = int.Parse(Console.ReadLine());
Console.Write(" The credit hours you entered: {0}", Result_Of_CreditHours);
Console.WriteLine(" The cost of per credit hour you entered: {0:C2}", Result_Of_PerCreditHour);
double Total = Result_Of_CreditHours * Result_Of_PerCreditHour;
Console.WriteLine("The Total is: {0:C}", Total);
return Total;
}
static double Fee_paid()
{
Console.Write(" Please enter the fees you paid: ");
double Fee_paid_request = int.Parse(Console.ReadLine());
return Fee_paid_request; // return the result to the caller
}
static double Late_fee()
{
Console.Write(" Please enter late fee if any: ");
double Late_fee_request = int.Parse(Console.ReadLine());
return Late_fee_request;
}
}
}
protected void btnCalculate_Click(object sender, EventArgs e)
{
int SID;
String Sname;
String Residency;
int Credits;
String tution;
SID= int.parse(textbox1.Text);
Sname= String.parse(textbox2.Text);
Residency= String.parse(textbox3.Text);
Credits= int.parse(textbox4.Text);
Tution= String.parse(textbox5.Text);
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.