Wie kann ich variable Daten in verschiedenen Klassen/Hohlräumen transportieren? Ich bin irgendwie neu in C# und kann SupC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Wie kann ich variable Daten in verschiedenen Klassen/Hohlräumen transportieren? Ich bin irgendwie neu in C# und kann Sup

Post by Anonymous »

Ich versuche herauszufinden, wie man das letzte Segment meines Codes in eine andere Leere transportiert (untere Void bis oberste Leere). Ich werde versuchen, die Antworten so schnell wie möglich zu beantworten. < /p>

Code: Select all

if (key == 'B')
{
BuyX (bstr, bstrCost, sp, 10);
}

public static void BuyX(double bstr, double bstrCost, double sp, double z)
{
double currentCost = 0;
double totalCost = 0;
double repeat = 0;
currentCost = bstrCost;

while (repeat < z - 1)
{
totalCost = totalCost + currentCost;
currentCost = (currentCost * (1.25 + (0.005 * (bstr - 1 + repeat))));
repeat = repeat + 1;
}

totalCost = totalCost + currentCost;
Console.WriteLine(totalCost);

if (sp >= totalCost)
{
//sp = sp - totalCost;
//bstr = bstr + z;
//bstrCost = currentCost;

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post