Here's the Error:
Error 1 No overload for method 'DisplayCollectedInfo' takes '0' arguments
Here's the code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CIS247_Week_1_Lab_Flaherty
{
class Program
{
public static void Main()
{
string name;
int age;
double mileage;
DisplayApplicationInformation();
GetName();
GetAge();
GetMileage();
DisplayCollectedInfo();
TerminateApplication();
}
public static void DisplayApplicationInformation()
{
string outputTitle = ("Start Program");
DisplayDivider(ref outputTitle);
Console.WriteLine("Welcome to the Basic User Interface Program");
Console.WriteLine("CIS247, Week 1 Lab");
Console.WriteLine("Name: Amanda Flaherty");
Console.WriteLine("This program accepts user input as a string, then makes the appropriate data conversion.");
}
public static void DisplayDivider(ref string outputTitle)
{
Console.WriteLine();
Console.WriteLine("******************** " + outputTitle + " ********************");
Console.WriteLine();
}
public static string GetName()
{
string outputTitle = ("Get Name");
string name, getInput;
DisplayDivider(ref outputTitle);
Console.WriteLine();
Console.Write("Enter your name: ");
getInput = Console.ReadLine();
Console.WriteLine();
name = getInput;
return name;
}
public static int GetAge()
{
string outputTitle = ("Get Age");
string getInput;
int age;
DisplayDivider(ref outputTitle);
Console.WriteLine();
Console.Write("Enter your age: ");
getInput = Console.ReadLine();
Console.WriteLine();
age = Convert.ToInt32(getInput);
return age;
}
public static double GetMileage()
{
string outputTitle = ("Get Mileage");
double mileage;
DisplayDivider(ref outputTitle);
Console.WriteLine();
Console.Write("Enter the MPG of your car: ");
mileage = Convert.ToDouble(Console.ReadLine());
Console.WriteLine();
return mileage;
}
public static void DisplayCollectedInfo(ref string name, ref string age, ref string mileage)
{
string outputTitle = ("Information Display");
DisplayDivider(ref outputTitle);
Console.WriteLine("Your name is " + name + ".");
Console.WriteLine();
Console.WriteLine("Your age is " + age + ".");
Console.WriteLine();
Console.WriteLine("Your car's MPG is: " + mileage + ".");
Console.WriteLine();
}
public static void TerminateApplication()
{
string outputTitle = ("End Application");
DisplayDivider(ref outputTitle);
Console.WriteLine("Thank you for using the Basic Uster Interface Program.");
Console.ReadLine();
}
}
}
I just can't get the main method to call the DisplayCollectedInfo method properly. If someone could tell me where I'm going wrong and why, I'd be very grateful.

New Topic/Question
Reply



MultiQuote








|