学年

質問の種類

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

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
英語 中学生

3枚目の写真のような問題って どうやって解くんですか? 私はいつも段落の最初と最後を見てるんですが 一問間違えてしまいました。ぼぼ勘だったりもするので教えて欲しいです🙇‍♀️

いる。 各問いに答えよ。なお, [1] Have you ever seen the 2D codes which have a special mark on the corners? For example, you can find the 2D codes in your textbooks. When you scan them with a tablet computer, you can see pictures or watch videos. Today, a A lot of people around the world use them in many different ways. This type of (2 2D code was invented by engineers at a car parts maker in Japan. [2] When cars are produced, many kinds of parts are needed. Car parts makers have to manage all of the car parts. About 30 years ago, car companies needed to produce more kinds of cars, and car parts makers had to manage many different kinds of car parts for each car. At that time, they used barcodes to manage the car parts, but they could not put a lot of information in one barcode. So, they used many barcodes. Workers had to scan many barcodes. A worker at a car parts maker had to scan barcodes about 1,000 times a day. It took a lot of time to scan them. The 0 000742 221101 barcode (バーコード) workers needed some help to improve their situation. [3] The engineers at a car parts maker in Japan knew the situation of the workers. They started to learn about 2D codes because 2D codes can contain more information than barcodes. There were already some types of 2D codes in the U.S. One type could contain a lot of information, but it took a lot of time to scan that type. Another type was scanned very quickly, but it contained less information than other types. The engineers at the car parts maker did not use these types. They decided to create a new type of 2D code which had both of those good points. The engineers needed a long time to create this new type which could be scanned quickly. Finally, they thought of an idea. They thought, "If a 2D code has a special mark on the three corners, it can be scanned very quickly from every angle." In this way, the new type of 2D code with special marks was invented by the engineers at a car parts maker in Japan. 2D code

未解決 回答数: 1