Write a C# program that inputs the prices of a box of cereal and a quart of milk at store A and the prices of the same items at store B. the program should output the total cost of three boxes of cereal and two quarts of milk at which ever store has the lower cost. Either store is acceptable if the cost is the same at both.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
int ce1, qmi1;
int ce2, qmil2;

Console.Write("Enter The price of cereal at store 1=");
ce1 = Int32.Parse(Console.ReadLine());
Console.Write("Enter The price of quart of milk at store 1=");
qmi1 = Int32.Parse(Console.ReadLine());

Console.Write("Enter The price of cereal at store 2=");
ce2 = Int32.Parse(Console.ReadLine());
Console.Write("Enter The price of quart of milk at store 2=");
qmil2 = Int32.Parse(Console.ReadLine());

int totalcoststore1 = (3 * ce1) + (2 * qmi1);
int totalcoststore2 = (3 * ce2) + (2 * qmil2);

if (totalcoststore1 > totalcoststore2)
Console.WriteLine("Total cost=" + totalcoststore2);
else
Console.WriteLine("Total cost=" + totalcoststore1);

if (totalcoststore1 == totalcoststore2)
Console.WriteLine("Total cost=" + totalcoststore1);


Console.ReadKey();

}
}

}

www.ittaleem.com