I am having an issue with this project. Step 3.
Back in
Main()
, call theDirectAll()
method using the array as the argument. Make sure that the right text is printed to the screen!
The issue is that after I did this step and press Save, nothing is showing in the console?
Am I misreading this?
Is it working like it should and nothing is wrong?
I’m just confused here.
Program.cs
using System;
namespace RoverControlCenter
{
class Program
{
static void Main(string[] args)
{
MoonRover lunokhod = new MoonRover("Lunokhod 1", 1970);
MoonRover apollo = new MoonRover("Apollo 15", 1971);
MarsRover sojourner = new MarsRover("Sojourner", 1997);
Satellite sputnik = new Satellite("Sputnik", 1957);
//Store the three rovers in an array of type Rover[], their shared base class.
Rover[] rover = { lunokhod, apollo, sojourner };
//Call the DirectAll() method using the array as the argument.
DirectAll(rover);
}
//Write a static method that takes one argument. Method should call three methods for each element and print out the returned strings.
static void DirectAll(Rover[] r)
{
foreach (Rover e in r)
{
e.GetInfo();
e.Explore();
e.Collect();
}
}
}
}