英語(yǔ)翻譯
英語(yǔ)翻譯
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.
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.
英語(yǔ)人氣:899 ℃時(shí)間:2020-05-24 02:48:14
優(yōu)質(zhì)解答
寫一個(gè)讓用戶可以對(duì)兩個(gè)度量單位進(jìn)行轉(zhuǎn)換的程序.用戶可以輸入數(shù)量,兩種度量單位的名稱,比如盎司,克,用戶就可以據(jù)以算出5盎司是多少克,1盎司是28克那么5盎司是140克.單位名稱及計(jì)算方式會(huì)在一個(gè)TXT格式的轉(zhuǎn)換文件中提供,程序開(kāi)始時(shí)要進(jìn)行讀入.文件中,每一行包括兩個(gè)單位名稱和一個(gè)十進(jìn)位的計(jì)算方式,分別用逗號(hào)隔開(kāi),例如:盎司,克,28.0,即表示,每盎司等于28.0克.門戶網(wǎng)站已有一個(gè)樣本文件,但你設(shè)計(jì)的程序應(yīng)兼容所有符合這種方式的文件.在鏈接單(linkedlist)的section A部分有這樣的文件,請(qǐng)?jiān)诔绦蜷_(kāi)始時(shí)設(shè)定系統(tǒng)using system .IO.
我來(lái)回答
類似推薦
猜你喜歡
- 1寒冷的冬天呼出氣體后,會(huì)看到白霧,出現(xiàn)這種現(xiàn)象的原因是?
- 2空氣對(duì)我們很重要的英語(yǔ)作文
- 3張阿姨用112元去買窗簾布,由于窗簾布每米降價(jià)1元,因此張阿姨所帶的錢可以比原來(lái)多買2米,原來(lái)每米多少元?
- 4什么叫電能 作用
- 5什么時(shí)候用I were 什么時(shí)候用I was
- 6描述人生最經(jīng)典的一句話是什么~
- 7用同樣的2臺(tái)抽水機(jī),3小時(shí)可以澆地1.2公頃,4臺(tái)抽水機(jī)1小時(shí)可以澆地多少公頃?
- 8若x²+2(a+1)x=16是完全平方式,求a²-2a+1的值
- 9已知I={X|-1≤X≤3},M={X|-1
- 10figure sth.out和figure out sth.的區(qū)別?
- 11高粱桿可以吃嗎
- 12誰(shuí)可以給我說(shuō)說(shuō)I 與U I與R 以及伏安法測(cè)電阻中滑動(dòng)變阻器的作用分別是什么,最好把實(shí)驗(yàn)寫下 thx