System.out.format(”Pi is approximately %d.”, Math.PI);  What

题目
单选题
System.out.format(”Pi is approximately %d.”, Math.PI);  What is the result?()
A

 Compilation fails.

B

 Pi is approximately 3.

C

 Pi is approximately 3.141593.

D

 An exception is thrown at runtime.

如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

importjava.io.PrintWriter;classDoFormat{publicstaticvoidmain(String[]args){intx=42;inty=12345;floatz=7;System.out.format("-%4d-",x);System.out.format("-%4d-",y);System.out.format("-%4.1d-",z);}}结果为:()

A.编译失败

B.-42--1234--7.0-

C.-42--1234--7.0-

D.运行时异常被抛出


参考答案:D

第2题:

System.out.format(”Piisapproximately%d.”,Math.PI);Whatistheresult?()

A.Compilationfails.

B.Piisapproximately3.

C.Piisapproximately3.141593.

D.Anexceptionisthrownatruntime.


参考答案:D

第3题:

According to Figure 3, clasts and matrix particles having diameters greater than or equal to 0.5 mm made up approximately what percent of the total mass of the combined samples?

A.13%

B.33%

C.63%

D.83%


正确答案:C

第4题:

A(73)is a value that never changes, for example: the value of Pi(approximately 3.14).

A.variable

B.string

C.Boolean

D.constant


正确答案:D
解析:译文:常量是不会改变的量,例如:Pi的值(近似于3.14)。

第5题:

Given:12.System.out.format("Piisapproximately%d.",Math.PI);Whatistheresult?()

A.Anexceptionisthrownatruntime.

B.Piisapproximately3.

C.Piisapproximately3.141593.

D.Compilationfails.


参考答案:A

第6题:

现有importjava.io.PrintWriter;classDoFormat{publicstaticvoidmain(String[]args){intx=42;inty=12345;floatZ-7;System.out.format("一%4d-",X);System.out.format("-%4d-",y);System.out.format("-%4.ld-",z);}}结果为:()

A.编译失败

B.-42--1234--7.0-

C.-42--1234--7.0-

D.-42--12345--7.0-

E.运行时异常被抛出


参考答案:E

第7题:

[说明] 下面是一段java代码,运行结果如图11-8所示。

程序代码如下:

(1)Java.awt.Graphics;

(2)Java.applet.Applet;

// ////////////////////////////////////////////

// Display y=sin(x)

public class J_DrawSin (2) Applet

{

public void paint(Graphics g)

{

double d, tx;

int x, y, x0, y0;

d=Math.PI/100; // Set step(Set the unit in x direction)

x0=y0=0;

(3)(tx=0, x=20; tx<2*Math.PI; tx+=d,x++)

{

y=120-(int)(Math.sin(tx)*50+60);

if(x>20)

g.drawLine(x0, y0, x, y);

x0=x;

y0=y;

}

g.drawstring("y=sin(x)", 10, 70);

} //End of method: paint

} //End of class: J_HelloApplet

<!-----------------------AppletExample.html------------------->

<HTML>

<HEAD>

<TITLE>

An applet Example ---- Hello Applet!

</TITLE>

</HEAD>

<BODY>

<(4)CODE="J_DrawSin.class" WIDTH=300 HEIGHT=120>

</APPLET>

</BODY>

</HTML>

把所缺代码补充完整。


正确答案:(1)import (2)extends (3)for (4)APPLET。
(1)import (2)extends (3)for (4)APPLET。

第8题:

If Trial 4 had been extended, at approximately what time would 0.45 mL of 0 2 have reacted?

A.70 sec

B.140 sec

C.240 sec

D.270 sec


正确答案:C

第9题:

在JavaScript中,下面哪一条语句在页面上显示圆周率π。()

A.document.write(Math.Pi)

B.document.write(Math.pi)

C.document.write(Math.PI)x


答案:C

第10题:

Travelling by train to Tokyo takes approximately one hour less _____ travelling by car.

A. for
B. with
C. as
D. than

答案:D
解析:

更多相关问题