You are on page 1of 1

MAHARAJA AGRASEN INSTITUTE OF TECHNOLOGY

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING


Subject Name: Programming in Java Subject Code:- CIC-212
ASSIGNMENT-1 M.M. = 10 Marks
SYLLABUS UNIT 1 & UNIT 2
Q1. How many class loaders are present in JVM, explain sandbox model implementation in
Java.(CO1)
Q2. How various garbage collection algorithms are chosen in context of specific environment. What
are the parameters while selecting a particular GC algorithm? (CO1)
Q3. Write a program to accept gender ("Male" or "Female") and age from command line arguments
and print the percentage of interest-based on the given conditions: - (CO2)
If the gender is 'Female' and age is between 1 and 58, the percentage of interest is 8.2%.
If the gender is 'Female' and the age is between 59 and 100, the percentage of interest is 9.2%.
If the gender is 'Male' and age is between 1 and 58, the percentage of interest is 8.4%.
If the gender is 'Male' and age is between 59 and 100, the percentage of interest is 10.5%.
Q4. Write a Java program that reads an integer number (between 1 and 255) from the user and prints
the binary representation of the number. The answer should be printed as a String. (CO2)
Q5. Given two strings, a and b, print a new string which is made of the following combination-first
character of a, the first character of b, second character of a, second character of b and so on. (CO2)
Any characters left, will go to the end of the result.
Example:-
i/p:Hello,World
o/p:HWeolrllod

You might also like