Use if statement and Write a program that computes and assesses the tuition fee of the
students in one trimester, based on the given mode of payment below:
Plan (key) Discount (-) or Interest (+)
Cash (1). 10% discount
Two-Installment (2) 5% discount
Three-Installment(3) 10% interest
The target-user must use the key in selecting or choosing the mode of payment. The first input
data is the tuition fee, and the second input data is the mode of payment.
using System;
using System.Collections.Generic;
namespace App{
class Program{
static void Main(string[] args)
{
Console.Write("Enter tuition fee: ");
double tuition = double.Parse(Console.ReadLine());
Console.Write("Press 1 for Cash\n 2 for Two-Installment \n 3 for Three-Installment");
Console.Write("\nEnter mode of payment: ");
int mode = int.Parse(Console.ReadLine());
if (mode == 1)
{
double discount = tuition * .10;
double total = tuition - discount;
Console.WriteLine("Your tuition fee is: " + total);
}
else if (mode == 2)
{
double discount = tuition * .05;
double total = tuition - discount;
Console.WriteLine("Your tuition fee is: " + total);
}
else
{
double interest = tuition * .10;
double total = tuition + interest;
Console.Write("Your tuition fee is: " + total);
}
Console.ReadLine();
}
}
}
Comments
Leave a comment