英语翻译
write a program to allow a user to do conversions between two different units of measurement.So the user might type in an amount,and the naems of two units of measurement,for example:5,ounce,gram
In this case the program should then print out the number of grams equal to 5 ounces,thus:5 ounces is 140 grams (1 ounce is 28 grams)
The unit names and conversion factors will be supplied as a file convert.txt,and this should be read in by the program at start-up.The file consists of a series of lines,each consisting of two unit names(both strings) and a conversion factor (a number with a decimal point) seqarated by commas,for example:ounce,gram,28.0
This means that one ounce equals 28.0 grams.A sample file is available on the portal,but your program should be able to cope with any file laid out in this way.There is code in section A of the " LinkedList" project to read from such as file; you need" using System.IO;" at the start of the program.
人气:290 ℃ 时间:2020-05-24 02:48:14
解答
写一个让用户可以对两个度量单位进行转换的程序.用户可以输入数量,两种度量单位的名称,比如盎司,克,用户就可以据以算出5盎司是多少克,1盎司是28克那么5盎司是140克.单位名称及计算方式会在一个TXT格式的转换文件中提供,程序开始时要进行读入.文件中,每一行包括两个单位名称和一个十进位的计算方式,分别用逗号隔开,例如:盎司,克,28.0,即表示,每盎司等于28.0克.门户网站已有一个样本文件,但你设计的程序应兼容所有符合这种方式的文件.在链接单(linkedlist)的section A部分有这样的文件,请在程序开始时设定系统using system .IO.
推荐
猜你喜欢
- 小东看叔叔锯木头,锯一次木头要2分钟,叔叔把木头锯成5段,叔叔请小东算一算需要几分钟?
- 一辆汽车从A地开往B地,前3小时行了180千米,照这样的速度,还要1.5小时才能到达,AB两地相距多远?
- 你让我感到害怕,英语怎么说?
- 某同学做了一次较为精确的测定匀加速直线运动的加速度的实验,实验所得到的纸带如图所示,设0点是计数的起始点,两计数点之间的时间间隔为0.1s,则第一个计数点与0点的距离s1应为__________cm,物体的加速度________
- “我”上学了,还是不断收到姥姥寄来的剪纸,其中表达姥姥对‘我’的期待的一副剪纸是这样的
- 三七五折等于几成
- 小红计算两个数的加法时,把其中一个加数个位上的0漏掉了,结果算出的和是37,已知正确答案是91,那么这
- 如图所示的是闭合电路的一部分导体在两磁极间的运动情形.图中小圆圈代表导体的横截面,a、b、c、d表示运动中四个不同位置.图中箭头表示在那个位置上的运动方向.导体在_位置会产