Java Lab
Java Lab
program and displays your name and last name on separate lines.
Write a program to take the students grade as an input argument and print the comments as follows
100 (Perfect Score), 90-100 (Excellent), 80-90 (Good), 70-80 (Above Average), 60-70 (Average) 50-60
(Below Average), 0-50 (Not Passing). Hint: use switch statement.
Write a program to print all odd numbers between 1 and 20. Note : Use while loop.
Write a program that calculates the total wages based on the number of hours worked. The wages are
calculated at a rate of 8.25 per hour for hours less than 40 and at the rate of 1.5 the standard rate for
any hours greater than 40. Number of hours is a command line argument to the program. Hint: Use
Integer.parseInt(String s) converts a string to an integer (To convert the number of hours from
command line to integer)
Write a Java class Student to meet the following specification. - The class should be able to support a 5
digit student ID, student name, marks for 3 subjects. You should have methods to set and get each of
the attributes, and calculate the average for the student. Write a tester program to test your class. You
should create 2 or 3 students and write code to test the class. Aim - Understand how to define a class
and create objects of the class.
b) The highest marks in each subject and the Roll No. of the student who secured it.
Write a program that accepts a shopping list of five items from the command line and stores them in a
vector.
Write a Java applet program that draws a Pie Chart of Number of Students Registered in various
departments at 2nd year level within the University of Melbourne. Please access input that are passed
through PARAM statements in HTML. Hint: Each pie can be drawn using drawArc() or fillArc() method.