File Test
File Test
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Assignment1_Programming
{
internal class Program
{
static void Main(string[] args)
{
int sizeOfCustomer = 0;
sizeOfCustomer = int.Parse(Console.ReadLine());
Console.WriteLine("Input name:");
names[i] = Console.ReadLine();
lastMonthMeter[i] = double.Parse(Console.ReadLine());
if(customerType[i] == 1)
{
Console.WriteLine("Enter total of member in familiy:");
peopleNum[i] = int.Parse(Console.ReadLine());
}
Console.WriteLine("====================WaterBill
=======================");
for(int i = 0;i < sizeOfCustomer;i++)
{
Console.WriteLine("Customer:"+ names[i]);
Console.WriteLine("Total water consume:" + consumeWater[i]);
Console.WriteLine("===================Sorting=============================");
for (int i = 0;i < sizeOfCustomer; i++)
{
for (int j = i + 1; i > j ; j ++ )
{
if (cost[i] < cost[j])
{
string namesTemp = names[i];
names[i] = names[j];
names[j] = namesTemp;
}
}
}
}
Console.WriteLine("====================Finding=============================");
double total = 0;
double consumeIndex = thisIndex - lastIndex;
if (typeCustomer == 1)
{
}
else if (consumeAvg > 20)
{
total = 8699 * consumeIndex;
}
else if (consumeAvg > 10)
{
total = 7052 * consumeIndex;
}
else total = 5973 * consumeIndex;
}else if(typeCustomer == 2)
{
total = 9955 * consumeIndex;
}else if(typeCustomer==3)
{
total = 11615 * consumeIndex;
}else if (typeCustomer==4)
{
total = 22068 * consumeIndex;
}
}
}