I'm developing an application in ASP.NET with C# and I'm trying to figure out the best way to implement a logic statement that will stop the system from allowing another reservation to be taken if the trailer for canoes and kayaks is full. The issue is the trailer will hold canoes and kayaks, but there's a lot of different combinations.
There are 5 "rows" on the trailer that count upwards vertically, and 2 "columns" that dissect the 5 rows in the middle. I will draw you a diagram to show you what it looks like, and what boats can go where. "C" will stand for Canoe and "K" will stand for Kayak. The trailer looks like this:
C only|C only }
______|______ } BOAT TRAILER
1C\2K|1C\2K }
______|______ }
1C\2K|1C\2K }
______|______ }
1C\2K|1C\2K }
______|______ }
C only| C only }
______|______ }
So my question is, what's the best option as far as coding and logic is concerned to not take any more "reservations" when the trailer is full? This application will be a .aspx form that will do an insert command to SQL server taking customer information.
public enum BoatType : int
{
Kayak = 1,
Canoe = 2
}
public class BoatReservation
{
public int ReservationID { get; set; }
public BoatType ReservationBoatType { get; set; }
}
public class BoatTrailer
{
public List<BoatReservation> CanoeSlots = new List<BoatReservation>();
public List<BoatReservation> RegularSlots = new List<BoatReservation>();
public BoatTrailer()
{
}
public bool AddBoat(BoatReservation b)
{
bool boatAdded = false;
switch (b.ReservationBoatType)
{
case BoatType.Canoe:
if (CanoeSlots.Count() < 4)
{
CanoeSlots.Add(b);
boatAdded = true;
}
else
{
var reg = RegularSlots.Sum(x => Convert.ToInt16(x.ReservationBoatType));
if (reg <= 10)
{
RegularSlots.Add(b);
boatAdded = true;
}
}
break;
case BoatType.Kayak:
{
var reg = RegularSlots.Sum(x => Convert.ToInt16(x.ReservationBoatType));
if (reg <= 11)
{
RegularSlots.Add(b);
boatAdded = true;
}
}
break;
}
return boatAdded;
}
public void RemoveBoat(BoatReservation b)
{
switch (b.ReservationBoatType)
{
case BoatType.Kayak:
if (RegularSlots.Contains(b))
{
RegularSlots.Remove(b);
}
break;
case BoatType.Canoe:
if (RegularSlots.Contains(b))
{
RegularSlots.Remove(b);
}
else
{
if (CanoeSlots.Contains(b))
{
CanoeSlots.Remove(b);
if (RegularSlots.Where(fb => fb.ReservationBoatType == BoatType.Canoe).Count() > 0)
{
//Move Reservation From Regular to Canoe Only With Opening
BoatReservation mv = RegularSlots.FindLast(fb => fb.ReservationBoatType == BoatType.Canoe);
RegularSlots.Remove(mv);
CanoeSlots.Add(mv);
}
}
}
break;
}
}
public string AvailableSlots()
{
string Output = string.Empty;
int AvailableCanoeCnt = (4 - CanoeSlots.Count()) + ((12 - RegularSlots.Count()) / 2);
int AvailableKayakCnt = (12 - RegularSlots.Count());
Output = string.Format("Canoe Slots Left: {0} Kayak Slots Left {1} ", AvailableCanoeCnt, AvailableKayakCnt);
return Output;
}
}
Quick class that handles reservations (both adding and deleting) of canoes/kayaks to fit a trailer.
Not the best question for this site but I will provide a pseudo structure for this.
Trailer Object
JustCanoes int
CanoeKayakBlend int
When reserving...
If the reservation is for a canoe, and the JustCanoes value is < 4, then increase JustCanoes by 1
If JustCanoes is >= 4
If CanoeKayakBlend <= 10
increase CanoeKayakBlend by 2
else
Sorry no reservation available
If the reservation is for a kayak
If CanoeKayakBlend <= 11
increase CanoeKayakBlend by 1
else
Sorry no reservation available
A very quick and simplistic implementation: Here's the Compartment class
class Compartment
{
private readonly int _maxCanoe;
private readonly int _maxKayak;
private int _currentCanoe;
private int _currentKayak;
private readonly int _id;
private bool _fullCanoe;
private bool _fullKayak;
public Compartment(int id, int maxC, int maxK)
{
_id = id;
_maxCanoe = maxC;
_maxKayak = maxK;
_currentCanoe = _currentKayak = 0;
UpdateCapacityStatus();
}
private void UpdateCapacityStatus()
{
_fullCanoe = _maxCanoe == _currentCanoe;
_fullKayak = _maxKayak == _currentKayak;
}
private string Status
{
get { return IsFull() ? "FULL" : "Space available"; }
}
public bool IsFull()
{
return _fullKayak && _fullCanoe;
}
public void AddCanoe()
{
_fullKayak = true; // disable adding kayak
_currentCanoe = _currentCanoe + 1;
_fullCanoe = _maxCanoe == _currentCanoe; //update canoe status
}
public void AddKayak()
{
_fullCanoe = true; //disable adding canoe
_currentKayak = _currentKayak + 1;
_fullKayak = _maxKayak == _currentKayak; //update kayak status
}
public override string ToString()
{
return string.Format("Id: {5}, Status: {0}, with {1} of {2} canoes or {3} of {4} kayaks", Status, _currentCanoe, _maxCanoe, _currentKayak, _maxKayak, _id);
}
public bool CanAddCanoe()
{
return !_fullCanoe;
}
public bool CanAddKayak()
{
return !_fullKayak;
}
}
And here's the driver console app to test, to use it you should refactor it of course.
`class Program
{
static void Main(string[] args)
{
var trailer = new List
{
new Compartment(1, 1, 0),
new Compartment(2, 1, 0),
new Compartment(3, 1, 2),
new Compartment(4, 1, 2),
new Compartment(5, 1, 2),
new Compartment(6, 1, 2),
new Compartment(7, 1, 2),
new Compartment(8, 1, 2),
};
foreach (var compartment in trailer)
{
Console.WriteLine(compartment.ToString());
}
Console.WriteLine("Press c for canoe or k for kayak");
var keepGoing = true;
while (keepGoing)
{
var input = Console.Read();
if (input == 99 || input == 107) //99 c, 107 k
{
if (trailer.All(c => c.IsFull()))
{
keepGoing = false;
}
else
{
if (input == 99)
{
if(!trailer.Any(t=>t.CanAddCanoe()))
{
Console.WriteLine("Cannot add a canoe!!!!");
}
else
{
var firstAvailable = trailer.First(c => c.CanAddCanoe());
firstAvailable.AddCanoe();
}
}
else if (input == 107)
{
if (!trailer.Any(t => t.CanAddKayak()))
{
Console.WriteLine("Cannot add a kayak!!!!");
}
else
{
var firstAvailable = trailer.First(c => c.CanAddKayak());
firstAvailable.AddKayak();
}
}
else
{
Console.WriteLine("Press c for canoe or k for kayak");
}
}
foreach (var compartment in trailer)
{
Console.WriteLine(compartment.ToString());
}
}
}
Console.ReadKey();
}
}`
Related
using System;
namespace ConsoleApp12
{
class Cake
{
private string cakeType;
private int weight;
private bool baked;
public Cake(string cakeType, int weight)
{
this.cakeType = cakeType;
this.weight = weight;
this.baked = true;
}
public Cake(string cakeType, int weight, bool baked)
{
this.cakeType = cakeType;
this.weight = weight;
this.baked = baked;
}
public Cake(int weight)
{
this.cakeType = "chocolate";
this.weight = weight;
this.baked = true;
}
public string IsBaked()
{
int count = 0;
Cake[] CakeArr = new Cake[3];
for (int i = 0; i < CakeArr.Length; i++)
{
if (/* if cake is baked */)
{
return "The Cake is indeed baked...";
}
else
{
count++;
}
}
return "There are: " + count + " not baked cakes...";
}
public string GetCakeType() { return this.cakeType; }
public int GetWeight() { return this.weight; }
public bool GetBaked() { return this.baked; }
public void SetBaked(bool baked) { this.baked = baked; }
public void Sold(int weight) { this.weight -= weight; }
}
class Program
{
static void Main(string[] args)
{
Cake c1 = new Cake(1800);
Cake c2 = new Cake("cheese", 1200, false);
Cake c3 = new Cake("chocolate", 2100, true);
c1.Sold(400);
if (c1 == c3)
Console.WriteLine("aaa");
else
Console.WriteLine("bbb");
c3.Sold(700);
if (c1 == c2 || c2 == c3)
Console.WriteLine("ccc");
else
if (c1 == c3)
Console.WriteLine("ddd");
c1.Sold(1400);
c2.SetBaked(c1.GetBaked());
if (c2.GetBaked())
Console.WriteLine("eee");
Console.WriteLine(c2.IsBaked());
}
}
}
I did everything I need but I do not know how to make the system check if the cake is baked in an if statement...
It doesnt matter what everything else do like the other methods because they all supposed to work anyways I just need to find a solution to the method IsBaked in the class Cake.
Please help, thank you.
Assuming you want to check how many of c1, c2, c3 are baked, you might want to create an extension method:
public static class MyCakeExtensionMethods{
public static string HowManyAreNotBaked(this Cake[] cakeArr ){
int count = 0;
for (int i = 0; i < cakeArr.Length; i++)
{
if (!cakeArr[i].GetBaked())
{
count++;
}
}
if( count == 0){
return "all cakes are baked";
return "There are: " + count + " not baked cakes...";
}
}
Note that the body could be mostly simplified to CakeArr.Count(c => c.GetBaked());
But there are other issues with your code:
You should probably be using properties instead of get/set methods
You should probably not allow the cake type to be changed after creation. Unless you found some way to transform a cheese-cake into a chocolatecake in the real world.
You should probably change SetBaked(bool baked) into Bake(), since you cannot un-bake a cake.
You should probably add a check to Sold to ensure you cannot sell more cake than there is.
I am trying to make each player display "Each Players Wins and loose at every count, so they can see the ones they won and lost
some thing like:
Player A
Games: Status of Game
1 : Win
2 : Win
3 : Win
4 : Lost
5 : Lost
6 : Win
Player B
Games: Status
1 : Lost
2 : Lost
3 : Lost
4 : Win
5 : Win
6 : Lost
Please help me out with this
class Guess
{
public int GuessedNumber { get; set; }
List<int> PlayerA = new List<int>();
List<int> PlayerB = new List<int>();
int countA = 0;
int countB = 0;
int count = 0;
public void Guu()
{
Random rand = new Random();
GuessedNumber = rand.Next(1,7);
}
public int input { get; set; }
public void FirstDisplay(string Active_Player)
{
Console.WriteLine($"{Active_Player}: Guess the number that i am thinking about");
input = Convert.ToInt32(Console.ReadLine());
count++;
}
public void CompareNumbers(List<int> PlayerA, List<int> PlayerB, ref string Active_Player)
{
if (Active_Player == "A")
{
if (input == GuessedNumber)
{
Console.WriteLine($"Correct, i was thinking of {GuessedNumber} my turn");
PlayerA.Add(1);
PlayerB.Add(0);
countA++;
}
else
{
Console.WriteLine($"Wrong, i was thinking of {GuessedNumber} try again");
PlayerB.Add(1);
PlayerA.Add(0);
countB++;
}
}
else if (Active_Player == "B")
{
if (input == GuessedNumber)
{
Console.WriteLine($"Correct, i was thinking of {GuessedNumber} try again");
PlayerA.Add(0);
PlayerB.Add(1);
countB++;
}
else
{
Console.WriteLine($"Wrong, i was thinking of {GuessedNumber} try again");
PlayerB.Add(0);
PlayerA.Add(1);
countA++;
}
}
}
public void Display()
{
Console.WriteLine("This is the result of the game");
Console.WriteLine($"Number of Game Played is: {count++}");
if (countA > countB)
{
Console.WriteLine("Winner: A");
}
else if (countA < countB)
{
Console.WriteLine("Winner: B");
}
else
{
Console.WriteLine("Draw");
}
Console.WriteLine($"Player A has {countA++} point");
Console.WriteLine($"Player B has {countB++} point ");
}
}
class Program
{
static void Main(string[] args)
{
List<int> PlayerA = new List<int>();
List<int> PlayerB = new List<int>();
string Active_Player = "A";
int count = 0;
Guess guess = new Guess();
string choice;
do
{
guess.Guu();
guess.FirstDisplay(Active_Player);
guess.CompareNumbers( PlayerA, PlayerB, ref Active_Player);
count++;
Console.WriteLine("Do you want to continue, Yes or No?");
choice = Console.ReadLine().ToLower();
}
while(choice == "yes");
guess.Display();
}
}
}
Can't you use List<int> PlayerA and List<int> PlayerB ?
Console.WriteLine("PlayerA Games Status");
for ( int i = 0; i < PlayerA.Count; ++i )
{
Console.Write( $"{i}: " );
if ( PlayerA[i] == 0) Console.WriteLine( "Loss" );
else Console.WriteLine( "Win" );
}
Do the same for PlayerB.
The main idea is to each member on team1 attack a random enemy on team2. The damage dealt is based on a spell casted at random from a Grimoire book.
My Code:
using System;
namespace simple_test
{
class Program
{
public class IceLance : Hechizo //hechizo == spell
{
public IceLance(uint d) : base(20)
{
danio = d; // danio == damage
return;
}
public override void Castear() // castear == cast
{
Console.WriteLine("Ice Lance");
}
protected uint danio = 5; // danio == damage
}
public abstract class Hechizo
{
protected Hechizo(uint c)
{
costo = c; // costo == cost
}
public abstract void Castear();
protected uint costo = 1;
public uint Costo
{
get { return costo; }
}
}
public class Personaje // personaje == character
{
public Personaje()
{ }
public Personaje(uint s)
{
salud = s;
}
public void RecibirDanio(uint d) // RecibirDanio == RecieveDamage
{
salud -= d; // salud = salud - d // salud == Health
}
public virtual void Ataque() // Ataque == Attack
{
Console.WriteLine("Ataque melee");
return;
}
public bool IsVivo() // IsVivo == IsAlive
{
return salud > 0;
}
protected uint salud = 100;
}
public class Humano : Personaje // Humano == Human
{
public Humano() : base()
{ }
public Humano(uint s, uint m) : base(s)
{
mana = m;
}
public void CastearGrimorio(int idx)
{
if ((grimorio == null) ||
(idx >= grimorio.Length) || (grimorio[idx] == null))
return;
uint c = grimorio[idx].Costo;
if (mana >= c)
{
mana -= c;
grimorio[idx].Castear();
}
}
public void AprenderHechizo(Hechizo h) // AprenderHechizo == LearnSpell
{
if (grimorio == null)
{
grimorio = new Hechizo[1];
}
else
{
Hechizo[] nuevoGrimorio = new Hechizo[grimorio.Length + 1];
for (uint i = 0; i < grimorio.Length; ++i)
{
nuevoGrimorio[i] = grimorio[i];
}
grimorio = nuevoGrimorio;
}
grimorio[grimorio.Length - 1] = h;
}
public override void Ataque()
{
if (grimorio == null)
Console.WriteLine("Sin mana :(");
else
CastearGrimorio(rnd.Next(0, grimorio.Length));//con esto lanza hechizos al azar
return;
}
private uint mana = 10;
private Hechizo[] grimorio;
private Random rnd = new Random();
}
static public bool TodosMuertos(Personaje[] team) // TodosMuertos == AllDead
{
for (int i = 0; i < team.Length; ++i)
{
if (team[i].IsVivo())
{
return false;
}
}
return true;
}
static void Main(string[] args)
{
Personaje[] team1 = new Personaje[41];
for (int i = 0; i < 3; ++i)
{
Humano mage = new Humano(80, 100);
mage.AprenderHechizo(new IceLance(20));
mage.AprenderHechizo(new IceLance(10));
mage.AprenderHechizo(new IceLance(0));
team1[i] = mage;
}
Personaje[] team2 = new Personaje[41];
for (int i = 0; i < 3; ++i)
{
Humano mage = new Humano(80, 100);
mage.AprenderHechizo(new IceLance(20));
mage.AprenderHechizo(new IceLance(10));
mage.AprenderHechizo(new IceLance(0));
team2[i] = mage;
}
while (!TodosMuertos(team1) && !TodosMuertos(team2)) // turnos
{
Console.WriteLine("team1");
for (int i = 0; i < team1.Length; ++i)
{
if (team1[i].IsVivo())
{
team1[i].Ataque();
// Here should go the RecieveDamage funtion
}
Console.ReadKey();
}
}
}
}
}
This one is a simplified version of the code, i.e. it only has one class and one spell.
I'm not sure how to write the part of how to select a member of the opposite team and in base of the spell casted receiveDamage according to its damage.
PS: I added some references to the spanish language used in the code
You can use the Random class to get a random number between 0 and the number of alive mages on the other team, and use that number to attack. Modify your attack function to take a target mage as a parameter and get them to take damage from there.
using System.Linq; // Add to top of page to use linq functions - .Where()
....
public class Humano : Personaje // Humano == Human
{
...
public override void Ataque(Personaje personaje)
{
if (grimorio == null)
Console.WriteLine("Sin mana :(");
else
{
// Modify CastearGrimoiro to return spell damage. Use person parameter to inflict damage on that person
uint damage = CastearGrimorio(rnd.Next(0, grimorio.Length));//con esto lanza hechizos al azar
personaje.RecibirDanio(damage);
}
}
...
static Random _random = new Random();
static void TakeTeamTurn(Personaje[] team, Personaje[] enemyTeam)
{
var aliveMages = team.Where(m => m.IsVivo()).ToList();
foreach(var mage in aliveMages)
{
// Get team to attack
var attackableMages = enemyTeam.Where(m => m.IsVivo()).ToList(); // Get a list of alive mages on the other team
var mageAttackIndex = _random.Next(attackableMages.Count); // Get a random number between 0 and the number of attackable mages
// (Not written here) Modify your Ataque method to take a mage parameter.
// In the Ataque method or some other method you can use this parameter to do damage to the target mage
var mageToAttack = attackableMages[mageAttackIndex];
mage.Ataque(mageToAttack);
}
}
static void Main(string[] args)
{
...
while (!TodosMuertos(team1) && !TodosMuertos(team2)) // turnos
{
Console.WriteLine("team1");
TakeTeamTurn(team1, team2);
Console.WriteLine("team2");
TakeTeamTurn(team2, team1);
Console.ReadKey();
}
....
Working example here - https://pastebin.com/kSregt24
I try to write a simple console application with Hanoi towers. But I am stuck at one point.
In my program I ask a person to write from to which tower wants to put the disk, but: I have 3 lists as towers, I'll ask for a number from gamer and now how I can build a "compare method"? Because I don't want to copy the same piece of code 6 times...
class Towers : Disks
{
//public Towers(int Value, int WhereItIs) : base(Value, WhereItIs) { }
public List<Disks> Tower1 = new List<Disks>();
public List<Disks> Tower2 = new List<Disks>();
public List<Disks> Tower3 = new List<Disks>();
public void Compare(int dyskFrom, int dyskWhere) {
}
public void Display() {
foreach(var i in Tower1){
Console.WriteLine("Where: {0} | Value: {1}", i.WhereItIs, i.Value);
}
}
public void Build(int TowerHigh) {
for (int i = TowerHigh; i > 0; i--) {
Tower1.Add(new Disks {Value = i, WhereItIs = 1 });
}
}
}
class Disks
{
public int Value; //wartosc krazka
public int WhereItIs; //na ktorej wiezy sie on znajduje
}
class Program
{
static void Main(string[] args)
{
Towers Tower = new Towers();
int TowerHigh;
Console.Write("Podaj wysokość wieży: ");
TowerHigh = int.Parse(Console.ReadLine());
Tower.Build(TowerHigh);
Tower.Display();
Tower.Compare(1, 2);
}
}
It's easier to create an array of Stack<Disk>(). This way you can select a tower by index.
I would use a Stack, because thats typically the functionality you need.
Something like: PSEUDO (typed in browser, no syntax checked)
class Disk
{
public int Size {get; set;}
}
static void Main(string[] args)
{
// create the Stack<Disk> array
Stack<Disk>[] towers = new Stack<Disk>[3];
// create each tower
for(int i=0;i<towers.Length;i++)
{
towers[i] = new Stack<Disk>();
// fill the towers.
for(int j=3;j>0;j--)
towers[i].Enqueue(new Disk { Size = j });
}
bool isHoldingDisk = false;
while(true)
{
DisplayTowers(towers);
if(isHoldingDisk)
Console.WriteLine("On what tower do you want to place it?");
else
Console.WriteLine("Choose a tower to pick a disk");
var key = Console.ReadKey(true);
var chosenTowerIndex = 0;
switch(key)
{
case(Key.Escape):
break;
case(Key.D1):
chosenTowerIndex = 0;
break;
case(Key.D1):
chosenTowerIndex = 1;
break;
case(Key.D1):
chosenTowerIndex = 2;
break;
// etc...
}
if((chosenTowerIndex < 1) || (chosenTowerIndex >= towers.Length))
continue;
// check here if you are holding a disk
if(isHoldingDisk)
{
// logic for testing if you can place the disk here...
// using towers[chosenTowerIndex]
// check if it is completed...
if(completed)
break;
isHoldingDisk = false;
}
else
{
// check if you can pickup a disk....(if there is any)
isHoldingDisk = true;
}
}
// final display...
DisplayTowers(towers);
Console.WriteLine("Thanks for playing");
}
static void DisplayTowers(Stack<Disk>[] towers)
{
// draw some fancy asc-ii art...
}
The code below represents what I am trying to write. The requirement is that the tax profile should match the correct currency. I have written the if conditions in my code below. However there are more than 100 tax profiles that are read via a database. Should I write if conditions for all 100 of them or is there a better way to code?
using System;
namespace MatchCondition
{
class MatchCondition
{
private const int TaxAmerica1 = 100;
private const int TaxAmerica2 = 200;
private const int TaxIndia1 = 300;
private const int TaxIndia2 = 400;
private const int Rupee =100;
private const int Dollar =200;
static void Main(string[] args)
{
try
{
int currencyId = int.Parse(args[0]);
int taxProfileId = int.Parse(args[1]);
if (currencyId == Rupee && (taxProfileId == TaxIndia1 || taxProfileId == TaxIndia2))
{
Console.WriteLine("All is well!");
}
else if(currencyId == Dollar && (taxProfileId == TaxAmerica1 || taxProfileId == TaxAmerica2))
{
Console.WriteLine("All is well!");
}
else if (taxProfileId == 0)
{
Console.WriteLine("All is well!");
}
else
{
Console.WriteLine("Mismatch Detected!");
}
}
catch (Exception exception)
{
Console.WriteLine(exception.Message);
}
}
}
}
You can put all your valid combinations in a hashtable, i.e. IDictionary and go from there.
For example:
var validCombinations = new Dictionary<int, List<int>>();
validCombinations.Add(Rupee, new List<int> { TaxIndia1, TaxIndia2 });
validCombinations.Add(Dollar, new List<int> { TaxAmerica1, TaxAmerica2 });
int currencyId = int.Parse(args[0]);
int taxProfileId = int.Parse(args[1]);
List<int> validTaxes;
if (taxProfileId == 0 ||
(validCombinations.TryGetValue(currencyId, out validTaxes) &&
validTaxes.Contains(taxProfileId)))
{
Console.WriteLine("All is well!");
}
else
{
Console.WriteLine("Mismatch Detected!");
}
You could also populate the dictionary with combinations read from a database table, so you don't have to hardcode them. YMMV.
You can use a mapping dictionary of lists as an alternative
You could restructure your code like this:
So you just need to add to the validCurrencies Dictionary for each set of valid currency/tax profiles. Note that this is just to give you an alternative to writing 100 conditions, you will need to test and make the code robust yourself.
using System;
using System.Collections.Generic;
namespace MatchCondition
{
class MatchCondition
{
private enum TaxProfileEnum
{
Default = 0,
America1 = 100,
America2 = 200,
India1 = 300,
India2 = 400,
}
private enum CurrencyEnum
{
Rupee = 100,
Dollar = 200,
}
static void Main(string[] args)
{
try
{
Dictionary<CurrencyEnum, List<TaxProfileEnum>> validCurrencies = new Dictionary<CurrencyEnum, List<TaxProfileEnum>>()
{
{ CurrencyEnum.Rupee, new List<TaxProfileEnum>() { TaxProfileEnum.India1, TaxProfileEnum.India2 } },
{ CurrencyEnum.Dollar, new List<TaxProfileEnum>() { TaxProfileEnum.America1, TaxProfileEnum.America2 } },
};
CurrencyEnum currency = (CurrencyEnum)int.Parse(args[0]);
TaxProfileEnum taxProfile = (TaxProfileEnum)int.Parse(args[1]);
if (taxProfile == TaxProfileEnum.Default)
{
Console.WriteLine("All is well!");
return;
}
List<TaxProfileEnum> validTaxes;
if (validCurrencies.TryGetValue(currency, out validTaxes) && validTaxes.Contains(taxProfile))
{
Console.WriteLine("All is well!");
return;
}
Console.WriteLine("Mismatch Detected!");
}
catch (Exception exception)
{
Console.WriteLine(exception.Message);
}
}
}
}