Computer Science Courses
COMP2100
Related sites
The objective of this lab is to master the use of practicing revision control with git. The mini-test aims to evaluate your ability to complete some basic tasks along with further sharpening your Java programming skills.
The first 10 minutes of the lab session time may be spent by your tutor to mark pre-lab tasks.
Using the command line on a Linux machine:
Your tutor will select one problem at random from the four options below and ask you to complete it correctly in the duration of the lab time. You may ask your tutor for a problem as soon as your pre-lab excercise is marked off. Start coding as soon as you are handed a problem!
In order to attain full marks, your solution must be correct. Your tutor may also decide to award some marks for a good attempt, in case of an incorrect or unfinished solution.
Remember, this is an individual exercise and must not be attempted collaboratively. However, feel free to discuss solutions to these problems with your colleagues before you attend this lab session.
Print out n using a recursive function. A fibonacci number is calculated by adding the previous two numbers in the series. A fibonacci series starts with 0, 1
. The program must accept as input the value of n. For example, given n=6
, the program must print 0, 1, 1, 2, 3, 5
. The minimum value of n is 2.
TextDraw box = new Box(); TextDraw tri = new Triangle(); box.draw(); System.out.println("-------------------"); tri.draw():This would output:
############------------------##########
# ######## ### #
The program must accept n as input. Assume that n is an odd integer with values ranging between [3,15]
Shape box = new Box(); Shape tri = new Triangle(); box.draw(); System.out.println("------------------"); tri.draw():This would output:
############------------------##########
Updated: 20 May 2016 / Responsible Officer: JavaScript must be enabled to display this email address. / Page Contact: JavaScript must be enabled to display this email address. / Powered by: Snorkel 1.4
+61 2 6125 5111
The Australian National University, Canberra
CRICOS Provider : 00120C
ABN : 52 234 063 906