Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions sandbox/Sandbox/Program.cs

This file was deleted.

102 changes: 102 additions & 0 deletions sandbox/Sandbox/Program.cs by JUMA
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
using System;

// First exercice

class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World! This is the Sandbox Project.");

Console.WriteLine(" what is your first name ?");
String first = console.ReadLine();

Console.WriteLine(" what is your last name ?");
String last = console.ReadLine();

Console.WriteLine($"Your name is {last}, {first}.");
}
}

// Second exercice


class Program
{
static void Main(string[] args)
{
Console.WriteLine(" what is your grade ?");
String grade = console.ReadLine();

if letter (grade >= 90 )
{
Console.WriteLine(" A ");
String letter = console.ReadLine();
Console.WriteLine($" Congratulation you have succed, you have got a : {letter} ");
}
else if (grade >= 80)
{
Console.WriteLine(" B ");
String letter = console.ReadLine();
Console.WriteLine($" Congratulation you have succed, you have got a : {letter} ");
}
else if (grade >= 70)
{
Console.WriteLine(" C ");
String letter = console.ReadLine();
Console.WriteLine($" Congratulation you have succed, you have got a : {letter} ");
}
else if (grade >= 60)
{
Console.WriteLine(" C ");
String letter = console.ReadLine();
Console.WriteLine($" sorry your grade can not allow you to pass, you have got a : {letter} , please try again later");
}
else
{
Console.WriteLine(" C ");
String letter = console.ReadLine();
Console.WriteLine($" sorry your grade can not allow you to pass, you have got a : {letter} , please try again later");

}
}
}

// Exercice 3

class Program
{
static void Main(string[] args)
{
Console.WriteLine(" Welcome to the magic name game ");


int magicname = console.ReadLine();
Random randomGenerator = new Random();

int magicNumber = randomGenerator.Next(1, 101);
int found = -1;

While (found != magicNumber)
{
Console.WriteLine(" Please what is the magic name ? ");
found = int.Parse(Console.ReadLine());

if (found > magicNumber)
{
Console.WriteLine(" your guess is lower ");
}

else if (found < magicNumber)
{
Console.WriteLine(" your guess is higher ");
}

else
{
Console.WriteLine(" congratulation you have found the real number ");
}
}

}
}