class Program
{
public static void GetSchoolInfo()
{
string SchoolName,
EnrollmentStatus,
ColorOne,
ColorTwo;
Console.WriteLine("Please enter your school name: ");
SchoolName = Console.ReadLine();
Console.WriteLine("Please enter your Enrollment Status: ");
EnrollmentStatus = Console.ReadLine();
Console.WriteLine("Pleas enter one of your school's colors: ");
ColorOne = Console.ReadLine();
Console.WriteLine("Please enter the other school color: ");
ColorTwo = Console.ReadLine();
}
static void Main(string[] args)
{
GetSchoolInfo();
Console.ReadLine();
}
ETC
我的目的是创建一个方法来获取这些字符串,然后很好地输出它们。在方法之外,我似乎无法调用 SchoolName 字符串或任何其他字符串。我目前正在为我的 CS 巴赫上学,所以请原谅我,因为这是一个新手问题。