+ 1

C# Course - Drawing Application Issue

Im working on the Drawing application where Im working with interfaces and my answer is the code contained below: using System; using System.Collections.Generic; namespace Code_Coach_Challenge { class Program { static void Main(string[] args) { Draw pencil = new Draw(); Draw brush = new Brush(); Draw spray = new Spray(); pencil.StartDraw(); brush.StartDraw(); spray.StartDraw(); } } /* Draw => "Using pencil" Brush => "Using brush" Spray => "Using spray" */ public interface IDraw { void StartDraw(); } class Draw : IDraw { public virtual void StartDraw() { Console.WriteLine("Using pencil"); } } //inherit this class from the class Draw class Brush : Draw { //implement the StartDraw() method public override void StartDraw(){ Console.WriteLine("Using brush"); } } //inherit this class from the class Draw class Spray : Draw { //implement the StartDraw() method public override void StartDraw() { Console.WriteLine("Using Spray"); } } } When I run the code It says the my output is: Using pencil Using brush Using Spray But that is wrong because the expected output is: Using pencil Using brush Using spray I cant seem to find what the issue is but I imagine that it has something to do with how my code was structured and not the actual results. Can anyone point out exactly what I'm doing wrong? Thanks in advance!

12th Aug 2022, 4:28 PM
John D4
2 odpowiedzi
+ 2
Difference found only in "Using Spray" Vs "Using spray" expected small case s in spray.
12th Aug 2022, 4:38 PM
Jayakrishna 🇮🇳
+ 1
Jayakrishna🇮🇳 Definitely did not see that even after looking a thousand times. Time to get away from the screen for a bit haha. Thanks!
12th Aug 2022, 4:39 PM
John D4