Skip to content

Cs 193p Assignment

Have your calculator report errors. For example, the square root of a negative number or divide by zero. There are a number of ways to go about “detecting” these errors (maybe add an associated value to the unary/binaryOperation cases which is a function that detects an error or perhaps have the function that is associated with a unary/binaryOperation return something that is either an error or a result or ???). How you report any discovered errors back to users of the CalculatorBrain API will require some API design on your part, but don’t force users of the CalculatorBrain API to deal with errors if they don’t want to (i.e. allow Controllers that want to display errors to do so, but let those that don’t just deal with NaN and +∞ appearing in their UI). In other words, don’t break any callers of the API described above (who don’t care about errors) to support this feature (i.e., add methods/ properties as needed instead). You are allowed to violate Required Task 11 to implement this Extra Credit item, but not Required Task 1 (you can enhance that data structure, but not switch to a new one).

Росио подошла к нему еще ближе. - Я не знаю, кто вы такой и чего хотите, но если вы немедленно отсюда не уйдете, я вызову службу безопасности отеля и настоящая полиция арестует вас за попытку выдать себя за полицейского офицера. Беккер знал, что Стратмор в пять минут вызволит его из тюрьмы, но понимал, что это дело надо завершить совершенно .