学年

教科

質問の種類

情報 大学生・専門学校生・社会人

vsコードを使ってJava言語の勉強をしてたんですけど初心者すぎて何が原因で上手くコードの実行ができてないのかわかりません… 勉強の資料として使ってるのは京都大学のJavaによるプログラミング入門 です。

17:43 7月27日 (木) 1.7 使用するサンプルプログラム (TankCalculator.java) 1: public class Tank Calculator { 2: public static void main (String args[]){ final double FLOW_RATE = 1.0; final double TANK_AREA = 20.0; final double INITIAL_LEVEL = 10.0; double time; //s double tankLevel; //m ... ocw.kyoto-u.ac.jp 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: time = 30; 14: tankLevel = INITIAL_LEVEL + FLOW_RATE*time/TANK_AREA; 15: System.out.println("Tank Level at time "+ time + "s = " + tankLevel + "m"); 16: 17: 18: 19: } 20:} 11 System.out.println("Flow Rate = + FLOW_RATE + "m** 3/s"); System.out.println("Tank Area=" + TANK_AREA + "m**2"); System.out.println("Initial Level = " + INITIAL_LEVEL + "m"); time = 60; tankLevel = INITIAL_LEVEL + FLOW_RATE*time/TANK_AREA; System.out.println("Tank Level at time "+ time + "s=" + tankLevel + "m"); 【補足】 // の後ろは,プログラムを後で読解しやすくするための注釈です. Flow Rate = 1.0m**3/s Tank Area = 20.0mm**2 Initial Level = 10.0m 8 Tank Level time 30.0s = 11.5m Tank Level at time 60.0s = 13.0m 1.7.1 サンプルプログラムの入力と実行 先ほどと同じように, 秀丸エディタを開き, 20行のプログラムを書き込んで, Tank Calculator.java と名付け, 保存して, コンパイル, 実行してください. 成功すれば,以下の実行結果が示されます。(失敗してもめげないで, 2.5.1 節を参 考に、原因を考え,再トライしてください) ちなみに, 実行結果をファイルに書き出すにはコマンドプロンプトの「リダイレク ト」 という機能を使います 11. java TankCalculator > result.txt これにより result.txt というファイルが出来ているはずです。 中身は数値や文字列 だけのテキストファイルですのでエディタなどで内容を確認できます。 @91% 11javaプログラムの中で明示的にフ ァイルに出力することもできるので すがここでは安直な方法を取ります

未解決 回答数: 1
TOEIC・英語 大学生・専門学校生・社会人

【至急】この穴埋め問題の答えを教えて欲しいです。

Progress test (Part 1) Drag the words into the correct spaces. some of few 1/2 some a few enough neither lots of both little every each no information about attractions in the city. There are Coming to London for a weekend? Here's interesting places to visit - you won't have time to see them all. Firstly, visit to London would be complete without seeing Big Ben. The clock at the Houses of Parliament has become a symbol of London, but few✔ tourists know that Big Ben is actually the name of the bell, not day, so arrive early. the clock or the clock tower. On the opposite side of the river is the London Eye, the world's biggest observation wheel. holding 25 people, but there are still queues nearly There are 32 sections, If you'd like somewhere scientific, you could go to the Natural History Museum or the Science Museum. Entry to of these appeal to you, you may prefer Madame Tussaud's, the museum where is free. Or, if you can meet the world's most famous people made of wax. You could meet the Queen of England there, or you could hope to see her at Buckingham Palace, her London home, just the most valuable jewels in the world. stops away on the London Underground 'Tube' train. If you want to see more royal palaces, try the Tower of London, where you can see the Crown Jewels, If that isn't for one trip, why not go to Shakespeare's Globe Theatre, a reconstruction of the 1599 theatre extra money, you can even see a play there. where his plays were performed. If you have a

回答募集中 回答数: 0