0% found this document useful (0 votes)
72 views1 page

Assignment 1 Java CIC 212

This document contains an assignment for a Programming in Java course. It includes 5 questions related to Java programming concepts covered in Units 1 and 2 of the syllabus. Question 1 asks about class loaders in JVM and sandbox model implementation. Question 2 asks about garbage collection algorithms and parameters for selection. Question 3 asks to write a program that takes gender and age from command line and prints interest percentage based on conditions. Question 4 asks to write a program that takes an integer between 1-255 and prints its binary representation as a string. Question 5 asks to write a program that combines characters of two strings alternately into a new string.

Uploaded by

Ashish Rao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views1 page

Assignment 1 Java CIC 212

This document contains an assignment for a Programming in Java course. It includes 5 questions related to Java programming concepts covered in Units 1 and 2 of the syllabus. Question 1 asks about class loaders in JVM and sandbox model implementation. Question 2 asks about garbage collection algorithms and parameters for selection. Question 3 asks to write a program that takes gender and age from command line and prints interest percentage based on conditions. Question 4 asks to write a program that takes an integer between 1-255 and prints its binary representation as a string. Question 5 asks to write a program that combines characters of two strings alternately into a new string.

Uploaded by

Ashish Rao
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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