云南大学软件学院
实验报告
姓名:王增伟学号:20111120083 班级:软件工程日期:2014.10.2成绩:
JAVA实验三
一、实验目的:
熟悉JAVA的控制流程,循环控制,数组结构,以及Big Numbers.
二、实验要求:
1. Write a Java program called AverageNumbers
2.java that calculates the average
of numbers 1 to 50 using the for loop. Do it again using the while loop.
2.Write a Java program called InputParms.java that accepts 3 arguments in the
main method using an array. Iterate through the array looking for your name using a for loop. Display the message "The name was found" if your name is found.
3.Write a Java program called BreakLoop.java that uses a for loop with the variable
"count" and count 1 to 10.. Display "count=" each time you loop through. Break out of the loop at 5. At the end of the program display "Broke out of the loop at count = 5".
4.Write a Java program called ContinueLoop.java that uses a for loop with the
variable "count" and count 1 to 10.. Display "count=" each time you loop through. Skip the display statement using the continue statement if count = 5. At the end of the program display "Used continue to skip printing 5".