
上QQ阅读APP看本书,新人免费读10天
设备和账号都新为新人
练习(Assignment)
1.(Level 1)Using condition flow control, write a program called IfTest to test whether a number is positive, negative or 0.
(级别1)使用条件流程控制语句,写一个IfTest.java程序来判断一个数字是正数、负数还是零。
2.(Level 2)Using while/do-while/for loop flow control respectively, write a program called LoopTest to multiply 1 to 10 and print out the result.
(级别2)分别使用while/do-while/for循环流程控制语句,写一个LoopTest.java程序来计算10的阶乘(从1乘到10)并打印结果。