subject

C# Debugging help// Street is an abstract class// OneWayStreet and TwoWayStreet derive from Street// On a OneWayStreet, it is illegal to make a U turn// On a TwoWayStreet, a U Turn reverses the travelling direction// Main program creates two Street child objects - one OneWay and one TwoWay// and demonstrates what happens when you make a U Turn// on a OneWayStreet and a TwoWayStreetusing static System. Console;class DebugTen02{static void Main(){OneWayStreet oak = new OneWayStreet("Oak Avenue", "east");TwoWayStreet elm = new TwoWayStreet("Elm Street", "south");WriteLine("On " + oak. Name + " " + oak. MakeUTurn());WriteLine("On " + oak. Name + " " + oak. MakeUTurn());WriteLine("On " + elm. Name + " " + elm. MakeUTurn());WriteLine("On " + elm. Name + " " + elm. MakeUTurn());}}abstract class Street{protected string name;private string direction;public Street(string name string travelDirection){name = name;direction = direction;}public string Name{get{return Name;}}public abstract string MakeUTurn();}class OneWayStreet : Street{public OneWayStreet(string name, string direction){}public override string MakeUTurn(){string temp = "U Turn is illegal! Was going and still going " + direction;return temp;}}class TwoWayStreet : Street{public TwoWayStreet(string name, string direction) : base(name, direction){}public override string MakeUTurn{string wasGoing = direction;string[] directions = {"north", "south", "east", "west"};string[] oppDirections = {"south", "north", "west", "east"};for(int x = 0; x < directions. Length; ++x){if(direction. Equals(directions[x])){direction = oppDirections[x];x = directions. Length;}}string temp = "U Turn successful. Was going " + wasGoing +". Now going " + direction;return;}}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 09:00
Create a cell reference in a formula by typing in the cell name or         a. right-clicking the cell. b. clicking the cell. c. clicking the column where the cell is located. d. clicking the row where the cell is located.
Answers: 1
question
Computers and Technology, 22.06.2019 19:30
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
question
Computers and Technology, 23.06.2019 13:10
What is domain name system (dns)? allows dynamic ip address allocation so users do not have to have a preconfigured ip address to use the network converts ip addresses into domains, or identifying labels that use a variety of recognizable naming conventions the efficient coexistence of telephone, video, and data communication within a single network, offering convenience and flexibility not possible with separate infrastructures the integration of communication channels into a single service
Answers: 2
question
Computers and Technology, 23.06.2019 21:30
Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest value. you may assume there is at least one value. (cascading/streaming logic, basic string processing)
Answers: 3
You know the right answer?
C# Debugging help// Street is an abstract class// OneWayStreet and TwoWayStreet derive from Street//...
Questions
question
Mathematics, 15.04.2021 18:00
question
Mathematics, 15.04.2021 18:00
question
Mathematics, 15.04.2021 18:00
Questions on the website: 13722363