Answer the question
In order to leave comments, you need to log in
c# error The name 'Console.ReadLine' does not exist in the current context?
It seems that I wrote the code, made a class, I write there Console.ReadLine(); , error The name 'Console.ReadLine' does not exist in the current context.
using System;
namespace ConsoleApp2
{
class Program
{
static void Main(string[] args)
{
string name = "";
string civilizationName = "";
int people = 0;
int army = 0;
double economy = 1.00;
double money = 5.00;
Console.WriteLine("Hello , write your name.");
name = Console.ReadLine();
Console.WriteLine("Name: ", name);
Console.WriteLine("Write name of your civilization");
civilizationName = Console.ReadLine();
Console.WriteLine("Civilization name", civilizationName);
Console.WriteLine("Hello , you can start your civilization . Write '1' to INFO , write '2' to Start. (read info before start)");
var choose = Int32.Parse(Console.ReadLine());
if (choose == 1)
{
Console.WriteLine($"Info = Name = {name}, Civilization Name = {civilizationName},People in Kingdom = {people} , Army in Kingdom = {army},Economy = {economy}, Money = {money}");
}
if (choose == 2)
{
Console.WriteLine("Okay... Starting the game.");
}
}
class SkipDay
{
Console.ReadLine();
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question