摘要
循环语句是面向对象程序设计的基础,Java程序设计语言提供了三种基本的循环语句:while循环语句、for循环语句和do…while循环语句[1],通常情况下,这三种循环语句可互换[2],但又略有不同,for循环语句与另外两种循环语句相比,结构更紧凑,编写更方便,使用更频繁。本文针对高职学生学习循环语句难度较大的问题,提出了一种引导式教学方法,通过分析一个典型案例——"求前10个自然数的和"的执行过程,提炼出循环体、循环执行条件等,引导学生自己拼凑出循环语句,同时也分析了Java语言中三种循环语句的结构,并对三种循环语句的相同点和不同点进行了详细探讨。
Loop statements are the basis of object oriented programming,and the Java programming language provides three basic loop statements:while loop statement,for loop statement,and do...While loop statement,usually,these three loop statements are interchangeable,but are slightly different,for loop statement is more compact in structure,more convenient to write,and more frequently used than the other two loop statements.In order to solve the problem of Higher Vocational Students'difficulty in learning loop sentences,a guiding teaching method is put forward.By analyzing a typical case,the execution process of"the sum of the 10 natural numbers in the first place",the body of the loop and the execution condition of the loop are extracted to guide the students to piece together the loop sentences.The structure of three loop statements in Java language is discussed,and the similarities and differences between the three loop statements are discussed in detail.
作者
曾新洲
Zeng Xinzhou(Changsha Commerce&tourism College,Changsha,Hunan 410116,China)
出处
《计算机时代》
2018年第9期51-54,共4页
Computer Era
基金
2016年度湖南省情决策咨询课题(16JCD041)
2017年度(下半年)长沙市哲学社会科学规划课题(2017csskkt61)