java实验四云南大学_云南大学java实验3

云南大学软件学院

实验报告

姓名:学号:班级:日期:成绩:

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".

三、实验内容:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值