クエスチョン8,9完了しました。
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
*/
|
||||
public class PTra01_08 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
float fl = 3.14f;
|
||||
// TODO float型の変数 fl を 3.14 で初期化してください。
|
||||
|
||||
System.out.println(fl);
|
||||
// TODO fl の値を出力してください
|
||||
|
||||
}
|
||||
|
||||
@@ -6,11 +6,32 @@
|
||||
*/
|
||||
public class PTra01_09 {
|
||||
public static void main(String[] args) {
|
||||
|
||||
byte smal ;
|
||||
short mediam;
|
||||
int count;
|
||||
long big;
|
||||
float lot;
|
||||
double price;
|
||||
char S;
|
||||
boolean a;
|
||||
// TODO 基本型8種類の変数を宣言します(変数名は自分できめてOKです)
|
||||
|
||||
smal = 127;
|
||||
mediam = 32000;
|
||||
count =2000000;
|
||||
big =9000000000L;
|
||||
lot = 3;
|
||||
price =1980.5;
|
||||
S='咲';
|
||||
a = true;
|
||||
// TODO 宣言した変数に、値を代入してください(代入する値はなんでもOKです)
|
||||
|
||||
System.out.println(smal);
|
||||
System.out.println(mediam);
|
||||
System.out.println(count);
|
||||
System.out.println(big);
|
||||
System.out.println(lot);
|
||||
System.out.println(price);
|
||||
System.out.println(S);
|
||||
System.out.println(a);
|
||||
// TODO それぞれの変数の中身を出力してください
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user