I have been working on this one assignment for two weeks now and I can't figure it out. I have seen some things on here that mention using classes and methods but in the assignment instructions it says not to use them since we haven't learned it yet.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
namespace Assignment_2
{
class Program
{
static void Main(string[] args)
{
Write("Enter a salesperson's name: ");
string name = ReadLine();
do
{
Write("\n" + "Enter an item number between 1 and 4 or -1 to quit: ");
String item = ReadLine();
int intItem = Convert.ToInt32(item);
Write("\n" + "Enter the quantity sold: ");
String quantity = ReadLine();
int intQuantity = Convert.ToInt32(quantity);
switch (intItem)
{
case 1:
{
Double price = 239.99;
double total = price * intQuantity;
WriteLine("Salesperson " + name + " sold " + intQuantity + " of item #" + intItem + " at $" + total);
double dblTotalSales = +total;
break;
}
case 2:
{
Double price = 129.75;
double total = price * intQuantity;
WriteLine("Salesperson " + name + " sold " + intQuantity + " of item #" + intItem + " at $" + total);
double dblTotalSales = +total;
break;
}
case 3:
{
Double price = 99.95;
double total = price * intQuantity;
WriteLine("Salesperson " + name + " sold " + intQuantity + " of item #" + intItem + " at $" + total);
double dblTotalSales = +total;
break;
}
case 4:
{
Double price = 350.89;
double total = price * intQuantity;
WriteLine("Salesperson " + name + " sold " + intQuantity + " of item #" + intItem + " at $" + total);
double dblTotalSales = +total;
break;
}
case -1:
{
WriteLine("Salesperson " + name + " sold a total of $" + dblTotalSales);
break;
}
}
} while (true);
}
}
}