Hi:
I have 3 class/Methods:
the first one:just beeps
the second one:ask the user to Enter the number of beep
The last one:Activate and runs.
I get the following Error:"instance reference; qualify it with a type name instead "
Can you please re-write the code and fix it for me,Thanks.
First One:
[code=c#]
using System;
public class AmbulanceSiren
{
public void Siren(int pattern)
{
for (int i=0;i< pattern; i++)
{
Console.Beep();
Console.Write(" ");
}
}
}
[/code]
Second One:
[code=c#]
using System;
public class User
{
public static void Enter()
{
Console.WriteLi ne("Enter The Pattern:");
AmbulanceSiren Test = new AmbulanceSiren( );
int repeat = Convert.ToInt32 (Console.ReadLi ne());
Test.Siren(repe at);
}
}
[/code]
Last One:
[code=c#]
using System;
public class Driver
{
public static void Main(string[] args)
{
User Active = new User();
Active.Enter();
}
}
[/code]
I have 3 class/Methods:
the first one:just beeps
the second one:ask the user to Enter the number of beep
The last one:Activate and runs.
I get the following Error:"instance reference; qualify it with a type name instead "
Can you please re-write the code and fix it for me,Thanks.
First One:
[code=c#]
using System;
public class AmbulanceSiren
{
public void Siren(int pattern)
{
for (int i=0;i< pattern; i++)
{
Console.Beep();
Console.Write(" ");
}
}
}
[/code]
Second One:
[code=c#]
using System;
public class User
{
public static void Enter()
{
Console.WriteLi ne("Enter The Pattern:");
AmbulanceSiren Test = new AmbulanceSiren( );
int repeat = Convert.ToInt32 (Console.ReadLi ne());
Test.Siren(repe at);
}
}
[/code]
Last One:
[code=c#]
using System;
public class Driver
{
public static void Main(string[] args)
{
User Active = new User();
Active.Enter();
}
}
[/code]
Comment