- Advanced TypeScript Programming Projects
- Peter O'Hanlon
- 230字
- 2021-06-24 13:27:08
Questions
- 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?
- 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?
- 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?
- 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?
推薦閱讀
- Linux設備驅動開發詳解:基于最新的Linux4.0內核
- Mastering ElasticSearch
- 蘋果電腦玩全攻略 OS X 10.8 Mountain Lion
- FreeRTOS實時內核應用指南
- WindowsServer2012Hyper-V虛擬化部署與管理指南
- Haskell Financial Data Modeling and Predictive Analytics
- Learn Helm
- 構建可擴展分布式系統:方法與實踐
- Alfresco 4 Enterprise Content Management Implementation
- Dreamweaver CS5.5 Mobile and Web Development with HTML5,CSS3,and jQuery
- Social Data Visualization with HTML5 and JavaScript
- 寫給架構師的Linux實踐:設計并實現基于Linux的IT解決方案
- 電腦辦公(Windows 10 + Office 2016)入門與提高(超值版)
- Linux集群之美
- Linux深度攻略