Software Sales A software company sells three software packages. Package A costs
ID: 672127 • Letter: S
Question
Software Sales
A software company sells three software packages. Package A costs $150 each, package B costs $120 each, and package C costs $90 each. Create a C# application that allows the user to enter the number of packages sold for each package. The application should be able to display the amount of income generated form each package sales and the total revenue generated. Use appropriate exception handling. The application’s form should resemble the one shown in the following figure.
Use the following sets of test data to determine if the application is calculating properly:
Package Sales Revenue
Package A: 120 Package A: $18,000.00
Package B: 150 Package B: $18,000.00
Package C: 250 Package C: $22,500.00
Total Revenue: $58,500.00
Package A: 100 Package A: $15,000.00
Package B: 120 Package B: $14,400.00
Package C: 200 Package C: $18,000.00
Total Revenue: $47,400.00
Package A: 200 Package A: $30,000.00
Package B: 320 Package B: $38,400.00
Package C: 300 Package C: $27,000.00
Total Revenue: $95,400.00
Explanation / Answer
using System.IO;
using System;
class Program
{
static void Main()
{
int packA,packB,packC;
Console.WriteLine("Package Sales");
Console.Write("Package A:");
packA = int.Parse(Console.ReadLine());
Console.Write("Package B:");
packB = int.Parse(Console.ReadLine());
Console.Write("Package C:");
packC = int.Parse(Console.ReadLine());
Console.WriteLine("Revenue");
packA=packA*150;
packB=packB*120;
packC=packC*90;
int total=packA+packB+packC;
Console.WriteLine("Package A:{0}",packA);
Console.WriteLine("Package B:{0}",packB);
Console.WriteLine("Package C:{0}",packC);
Console.WriteLine(" Total Revenue:{0}",total);
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.