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

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?
主站蜘蛛池模板: 五大连池市| 呼和浩特市| 和硕县| 台江县| 平潭县| 青海省| 黄骅市| 阳江市| 宽城| 福鼎市| 太谷县| 石楼县| 大埔区| 丰城市| 晋州市| 浙江省| 安乡县| 农安县| 许昌县| 阳西县| 额济纳旗| 南昌县| 石首市| 信宜市| 康平县| 阿拉善左旗| 佳木斯市| 海伦市| 游戏| 皋兰县| 浦东新区| 安国市| 利川市| 大同县| 平顺县| 梁平县| 澎湖县| 文水县| 博白县| 台北县| 安化县|