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 10:30
You have a large, late-model pick-up truck with a rear seat. the pick-up truck weighs 6,500 pounds. the florida seat belt law
Answers: 1
question
Computers and Technology, 22.06.2019 20:10
Assume that minutes is an int variable whose value is 0 or positive. write an expression whose value is "undercooked" or "soft-boiled" or "medium-boiled" or "hard-boiled" or "overcooked" based on the value of minutes. in particular: if the value of minutes is less than 2 the expression's value is "undercooked"; 2-4 would be a "soft-boiled", 5-7 would be "medium-boiled", 8-11 would be "hard-boiled" and 12 or more would be a "overcooked".
Answers: 1
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
You know the right answer?
C# Debugging help// Street is an abstract class// OneWayStreet and TwoWayStreet derive from Street//...
Questions
question
Mathematics, 09.07.2021 07:20
question
Mathematics, 09.07.2021 07:20
question
Mathematics, 09.07.2021 07:20
question
Mathematics, 09.07.2021 07:20
question
Health, 09.07.2021 07:20
question
Mathematics, 09.07.2021 07:20
question
Social Studies, 09.07.2021 07:20
question
Physics, 09.07.2021 07:20
Questions on the website: 13722362