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, 21.06.2019 20:50
What does operator overloading allow you to do?
Answers: 2
question
Computers and Technology, 22.06.2019 14:40
For this assignment you have to write a c program that will take an infix expression as input and display the postfix expression of the input. after converting to the postfix expression, the program should evaluate the expression from the postfix and display the result. what should you submit? write all the code in a single file and upload the .c file. compliance with rules: ucf golden rules apply towards this assignment and submission. assignment rules mentioned in syllabus, are also applied in this submission. the ta and instructor can call any students for explaining any part of the code in order to better assess your authorship and for further clarification if needed. problem: we as humans write math expression in infix notation, e.g. 5 + 2 (the operators are written in-between the operands). in computer's language, however, it is preferred to have the operators on the right side of the operands, ie. 5 2 +. for more complex expressions that include parenthesis and multiple operators, a compiler has to convert the expression into postfix first and then evaluate the resulting postfix write a program that takes an "infix" expression as input, uses stacks to convert it into postfix expression, and finally evaluates it. it must support the following operations: + - / * ^ % ( example infix expression: (7-3)/(2+2) postfix expression: 7 3 2 2 result: rubric: 1) if code does not compile in eustis server: 0. 2) checking the balance of the parenthesis: 2 points 3) incorrect postfix expression per test case: -2 points 4) correct postfix but incorrect evaluation per test case: -i points 5) handling single digit inputs: maximum 11 points 6) handling two-digit inputs: 100 percent (if pass all test cases)
Answers: 3
question
Computers and Technology, 22.06.2019 17:30
1. before plugging in a new device to a computer you should unplug all other devices turn off the computer turn on the computer 2. many of the maintenance tools for a computer can be found in the control panel under administrative tools display personalization
Answers: 1
question
Computers and Technology, 22.06.2019 23:30
In my email i got a message it says a quick message and in message details on who its from its says nicole and under nicole is [email protected] -
Answers: 1
You know the right answer?
C# Debugging help// Street is an abstract class// OneWayStreet and TwoWayStreet derive from Street//...
Questions
question
History, 11.01.2022 16:10
question
Chemistry, 11.01.2022 16:20
Questions on the website: 13722361