Java程序辅导

C C++ Java Python Processing编程在线培训 程序编写 软件开发 视频讲解

客服在线QQ:2653320439 微信:ittutor Email:itutor@qq.com
wx: cjtutor
QQ: 2653320439

Computer Science Courses

Related sites

Introductory Programming In Java

Lab 2

Lab 2

Mastering Java control structures

Objectives

Write a few small Java programs which require to useconditional structures, operators and loops.

Exercise One

Write a program to print out the last digit of an integerseven times the value of an integer which the user enters.

For example, if a user enters the number '53', your programwill compute the number 7*53=371 and print out the last digitwhich is '1'.

(Note that you will need to use the modulo operator (%) in this program.)

Exercise Two

Exercise Three

Further programming ideas

Different functionalities of your programs (like calculating a desirednumber, or determining a grade, or printing a result etc), should be implemented with the help of different methods: this is calledmodularization — one of the basic principles of programming.If you did not use methods in our coding solutions, but lumped everythinginto one main method, then re-implement everything usingmodularization.

Lab 2

 

Updated:  Sun 12 Jun 2016 17:27:37 AEST Responsible Officer:   JavaScript must be enabled to display this email address. Page Contact:  

+61 2 6125 5111
The Australian National University, Canberra
CRICOS Provider : 00120C       ABN : 52 234 063 906