-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
46 lines (36 loc) · 1.29 KB
/
Program.cs
File metadata and controls
46 lines (36 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
namespace NP_CompleteOrder
{
class Program
{
static void Main(string[] args)
{
SortedList<decimal, string> menu = new SortedList<decimal, string>
{
{2.15m, "Mixed Fruit"},
{2.75m, "French Fries"},
{3.35m, "Side Salad"},
{3.55m, "Hot Wings"},
{4.20m, "Mozzarella Sticks"},
{5.80m, "Sampler Plate"}
};
decimal defaultSpendingTotal = 15.05m;
DisplayInformation.Menu(menu);
decimal spendTotal = UserInput.GetSpendTotal(defaultSpendingTotal);
Console.WriteLine($"Spend exactly ${string.Format("{0:#.00}", spendTotal)}:\n");
//var solutions = NCompleteProblem.Solve(menu, spendTotal);
var solutions = NCompleteProblem.OptimizedSolve(menu, spendTotal);
if (solutions.Count == 0)
{
Console.WriteLine("No valid solutions.\n");
}
else
{
DisplayInformation.Solutions(solutions, menu);
}
Console.Write("\n\nTask Complete\nPress Enter to Close");
Console.ReadLine();
}
}
}