🥚FooYoungDevelopment
🥚FooYoungDevelopment
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
Thanks for your support, You can mark this case as closed, and I hope to see more of you in the future!
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
Best Rabbit Ever!
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
No description
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
On it!
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
catshycatshycatshy
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
No description
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
In my previous 20 assignments it wasn't required. installing it right now. Thanks for the quick response.
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
I guess not, no
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
No description
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
litterally 1:1 the same code.
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
No description
29 replies
CC#
Created by 🥚FooYoungDevelopment on 11/1/2023 in #help
✅ Rocket Launch Console game
I managed to write the following code
static void Main(string[] args)
{
// Initial values
double h = 50, v = 8, mF = 35;

// Preparation
bool malfunction = false;

// Repeating individual landing steps
while (h >= 0)
{
// Displaying current values
string height = "Height: " + h.ToString("N1");
string velocity = "Velocity: " + v.ToString("N1");
string fuel = "Fuel: " + mF.ToString("N1");
Console.WriteLine(height + " " + velocity + " " + fuel);

// Input
Console.Write("Enter percentage of breaking (0-100): ");
string input = Console.ReadLine();
double percents = 0;
try
{
percents = Convert.ToDouble(input);
if (percents < 0 || percents > 100)
{
malfunction = true;
}
}
catch (Exception)
{
malfunction = true;
}

if (malfunction)
{
percents = 0;
Console.WriteLine("CONTROL MALFUNCTION!");
}

// Fuel check
if (mF <= 0)
{
percents = 0;
Console.WriteLine("NO FUEL!");
}
// Calculating new values
double F = 360 * percents;
double a = 1.62 - F / 8000;
h -= v + a / 2;
v += a;
mF -= F / 3000;
if (mF <= 0)
{
mF = 0; }
// Output of an empty line
Console.WriteLine();
}

// End of a single landing step
// Output
Console.WriteLine("Landing velocity: " + v.ToString("N1"));

string evaluation = v < 4 ?
"Soft landing, congratulations!" :
(v <= 8 ? "Hard landing." : "Houston, crew is lost...");

Console.WriteLine(evaluation);
// Waiting for Enter
Console.ReadLine();
}
static void Main(string[] args)
{
// Initial values
double h = 50, v = 8, mF = 35;

// Preparation
bool malfunction = false;

// Repeating individual landing steps
while (h >= 0)
{
// Displaying current values
string height = "Height: " + h.ToString("N1");
string velocity = "Velocity: " + v.ToString("N1");
string fuel = "Fuel: " + mF.ToString("N1");
Console.WriteLine(height + " " + velocity + " " + fuel);

// Input
Console.Write("Enter percentage of breaking (0-100): ");
string input = Console.ReadLine();
double percents = 0;
try
{
percents = Convert.ToDouble(input);
if (percents < 0 || percents > 100)
{
malfunction = true;
}
}
catch (Exception)
{
malfunction = true;
}

if (malfunction)
{
percents = 0;
Console.WriteLine("CONTROL MALFUNCTION!");
}

// Fuel check
if (mF <= 0)
{
percents = 0;
Console.WriteLine("NO FUEL!");
}
// Calculating new values
double F = 360 * percents;
double a = 1.62 - F / 8000;
h -= v + a / 2;
v += a;
mF -= F / 3000;
if (mF <= 0)
{
mF = 0; }
// Output of an empty line
Console.WriteLine();
}

// End of a single landing step
// Output
Console.WriteLine("Landing velocity: " + v.ToString("N1"));

string evaluation = v < 4 ?
"Soft landing, congratulations!" :
(v <= 8 ? "Hard landing." : "Houston, crew is lost...");

Console.WriteLine(evaluation);
// Waiting for Enter
Console.ReadLine();
}
29 replies