官术网_书友最值得收藏!

Questions

  1. We have written an application that allows users to convert from Fahrenheit into Celsius and from Celsius into Fahrenheit. The calculations are performed in the following classes:
class FahrenheitToCelsius {
Convert(temperature : number) : number {
return (temperature - 32) * 5 / 9;
}
}

class CelsiusToFahrenheit {
Convert(temperature : number) : number {
return (temperature * 9/5) + 32;
}
}

We want to write a method that accepts a temperature and an instance of either of these types, which will then perform the relevant calculation. What technique would we use to write this method?

  1. We have written the following class:
class Command {
public constructor(public Name : string = "", public Action : Function = new Function()){}
}

We want to use this in another class where we will add a number of commands. Name of the command is going to be the key that we can use to look up Command later on in our code. What would we use to provide this key-value functionality and how would we add records to it?

  1. How would we automatically log that we were adding entries to the command we added in Question 2 without adding any code inside our Add methods?
  2. We have created a Bootstrap web page where we want to display a row with six medium columns of equal size. How would we do this?
主站蜘蛛池模板: 郯城县| 康定县| 汪清县| 贺州市| 漳平市| 江都市| 保定市| 商河县| 曲麻莱县| 长白| 乐至县| 扶沟县| 民和| 澳门| 玉山县| 凌海市| 增城市| 阳曲县| 高唐县| 红河县| 工布江达县| 福海县| 尤溪县| 思茅市| 城固县| 和政县| 朝阳区| 宁安市| 安庆市| 九江市| 三门县| 阿城市| 闽侯县| 梅河口市| 宣城市| 常山县| 普定县| 禹州市| 濉溪县| 河津市| 黔东|