Using app Visual Studio C# 2008
Create a simple Application Manny Management Consulting charges P1,500 for training fee
and P120 per person for registration fee. Create an application
to help the accountant make a billing statement showing the
customer's name, address, number of participants, training fee,
registration fee and total amount due.
C sharp
using System;
using System.Collections.Generic;
namespace App
{
class Program
{
static void Main(string[] args)
{
string[] participantNames = new string[10];
string[] participantAddresses = new string[10];
double[] participantAmountDues = new double[10];
double totalAmountDue = 0;
Console.Write("Enter the number of participants: ");
int np = int.Parse(Console.ReadLine());
for (int i = 0; i < np; i++)
{
Console.Write("Enter customer's name: ");
participantNames[i] = Console.ReadLine();
Console.Write("Enter customer's address: ");
participantAddresses[i] = Console.ReadLine();
participantAmountDues[i] = 1500 + 120;
Console.WriteLine();
}
Console.WriteLine();
for (int i = 0; i < np; i++)
{
Console.WriteLine("Customer's name: " + participantNames[i]);
Console.WriteLine("Customer's address: " + participantAddresses[i]);
Console.WriteLine("Customer's training fee: P1500");
Console.WriteLine("Customer's registration fee: P120");
Console.WriteLine("Customer's total amount due: P" + participantAmountDues[i].ToString("N2"));
totalAmountDue += participantAmountDues[i];
Console.WriteLine();
}
Console.WriteLine("The total number of participants: " + np.ToString());
Console.WriteLine("The total amount due: P" + totalAmountDue.ToString("N2"));
Console.ReadLine();
}
}
}
Comments
Leave a comment