Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that computes the amount of money the computer club will recieve

ID: 3646223 • Letter: W

Question

Write a program that computes the amount of money the computer club will recieve from proceeds of their granola bar sales project. Allow the user to enter the number of cases sold and the sale price per bar. Each case contains 12 bars; each case is purchased at $5.00 per case from a local vender. The club is required to give the student government association 10% of their earnings. Display their proceeds formatted with currency. USE AT LEAST 3 METHODS.

What I have come up with so far:

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

namespace ConsoleApplication34
{
public class computerClub
{
int cases, price, studentGovEarnings, netIncome;

public static void Main()
{
GetInput();
Calculations();

}
public void GetInput()
{
string inputValue, inputValue2;


Console.Write("Enter # of cases sold: ");
inputValue = Console.ReadLine();
Console.WriteLine(inputValue + " cases");
cases = int.Parse(inputValue);


Console.Write("Enter price of each bar: ");
inputValue2 = Console.ReadLine();
Console.WriteLine(inputValue2);
price = int.Parse(inputValue2);


}
}
public void Calculations()
{
netIncome = (cases * 5.0) - (cases * (12.0* price));
studentGovEarnings = netIncome * .10;


}
}

Explanation / Answer

using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace @case { class Program { static void Main(string[] args) { const double COST_PER_CASE = 5.00; const double CASE_OF_BARS = 0; const double NUMBER_OF_BARS = 12; const double PRICE_OF_BARS = 0; const double EARNINGS = 0.10; string employeeName; int num1; double num2; double takeHomePay; Console.WriteLine("Enter employee name : "); employeeName = Console.ReadLine(); Console.WriteLine("Input Number One: "); num1 = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Enter number 2 "); num2 = Convert.ToDouble(Console.ReadLine()); double bars = num1 * NUMBER_OF_BARS; double caseCost = num1 * COST_PER_CASE; double cost = bars * num2; takeHomePay = cost - caseCost; takeHomePay = takeHomePay * .90; Console.WriteLine("output : " + takeHomePay); } } }

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote