0% found this document useful (0 votes)
22 views7 pages

Grade 9 Journal Assignments

The document outlines Grade 9 journal assignments for the academic year 2024-2025, detailing various programming tasks in Java. Assignments cover topics such as operators, input through parameters, conditional constructs, and mathematical methods, with specific instructions for formatting and structure. Each assignment requires students to demonstrate their understanding of Java programming concepts through practical coding exercises.

Uploaded by

mukesh
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)
22 views7 pages

Grade 9 Journal Assignments

The document outlines Grade 9 journal assignments for the academic year 2024-2025, detailing various programming tasks in Java. Assignments cover topics such as operators, input through parameters, conditional constructs, and mathematical methods, with specific instructions for formatting and structure. Each assignment requires students to demonstrate their understanding of Java programming concepts through practical coding exercises.

Uploaded by

mukesh
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/ 7

Grade 9 Journal Assignments 2024-2025

1. Do not write the dates for the Assignment.


2. Each Assignment must start from a new page.
3. First write Question, then coding then Output and Variable Description table.
(Format of variable description as given in the scope of syllabus).
4. The Variable description table should be drawn using pencil and scale.

Assignment 1
Operators in Java
1. What is the result stored in x, after evaluating the following expression :
int x=5; x=x++*2+3*--x;
2. What is the output of the following program segment?
char x=’A’; int m;
m = (x==’a’) ? ’A’ : ’a’;
System.out.println(“m=”+m);
3. Write an expression in Java for
4. Give the output of the following expression: a+= a++ + ++a + --a + a--; when a=7;
5. Rewrite the following using ternary operator:
if(x%2==0)
System.out.println(“Even”);
else
System.out.println(“Odd”);

Assignment 2
Programs using Assignment statements.
1. To assign the length, breadth and height of a cuboid and find its volume.
2. To assign two unequal numbers. Display the numbers after swapping their values in
the variables without using the third variable.
3. To calculate the Simple Interest on Rs.10000 at annual interest of 18% for 20 years.

Assignment 3
Programs based on Input through parameters.
1. To accept a 5 digit integer, and from it extract the first digit and store it into a
variable f and extract the last digit into a variable e, and display both these digits.
2. To accept the salary of an employee and add 15% increment to it.
3. To input the temperature in degrees Fahrenheit and convert to degree centigrade.
( )
Assignment 4
Programs based on Input through Scanner class.
1. To input name, and basic salary. Calculate and display the following :
HRA @ 15% of basic salary.
DA @ 70% of basic salary.
TA @ 2% of basic salary.
PF @ 10% of basic salary.
Gross_salary = basic + HRA + DA + TA
Net_salary = gross - PF
2. To input item name, rate and quantity sold. Calculate the amount (rate * quantity).
Add 12.5% as VAT and display the net bill.
3. To input values representing time duration in hours, minutes and seconds and then
prints the equivalent total number of seconds. Eg. 1 hour, 28 minutes, 42 seconds is
equivalent to 5322 seconds.

Assignment 5
Programs based on Mathematical methods.
1. To input 3 sides of a triangle and find the area using Heron’s formula.
√ ( )( )( )
2. To input the radius of a sphere and print its volume and surface area.

3. To calculate the side of a cube taking its volume as input. √


4. To input 3 numbers and display the greatest and the smallest of the 3 numbers.

Assignment 6
Questions based on Operators and Expressions in Java.
1. What will be the value of following expressions, if m is 5 initially?
(i) (3 * ++m) % 4 (ii) (3 * m++) % 4
2. What result will be produced by the expressions: A + B > 1750 ? 400 : 200, if:
(i) If A = 2000 and B = 1000 (ii) if A= 1000 and B = 1000
3. What will be the value of m = --p + p * ++n, where p = 10 and n = 7?
4. What will be the value of x = y++ + ++y +y, where y = 4?
5. What will be the value of (4 * ++a) % 5 and (4 * a++) % 5, where a = 4?
6. If x=4, y=7, d=10, w=20, then, state the results of following expression in true or
false:
(i) x>w (ii) x + 3 ==y (iii) x < d (iv) x + y == w
(v) y + d == x * w (vi) d – y != x + 3 (vii) d != y (viii) d + w == x * 4
7. If Y = 8, then what will be the output of the three statements :
System.out.println(++Y);
System.out.println(Y++);
System.out.println(++Y);

Assignment 7
Questions based on Mathematical methods.
1. What will the following function return when executed?
(i) Math.max(-17,-19)
(ii) Math.ceil(7.8)
2. Give the output of the following program segment:
double x = 2.9, y = 2.5;
System.out.println(Math.min(Math.floor(x),y));
System.out.println(Math.max(Math.ceil(x),y));
3. Give the output of the following Math functions:
(i) Math.ceil(4.2)
(ii) Math.abs(-4)
4. What will the following function return when executed?
(i) int p = Math.abs(Math.max(-91,-97));
(ii) double m = Math.cbrt(9.261);
5. What will be the final values stored in the variables when executed?
double a = -99.51;
double b = -56.25;
(i) double p = Math.abs(Math.floor(a));
(ii) double q = Math.sqrt(Math.abs(b));

Assignment 8
Programs based on Conditional constructs (if programs)
1. To find the largest of two numbers.
2. To input a number and check whether it is divisible by 7 or not.

Assignment 9
Programs based on Conditional constructs (if-else programs)
1. To input an integer and check whether it is an even or an odd number.
2. To input an integer and check whether it is a three-digit number or not.
3. To input a character and check whether it is Uppercase or Lowercase.
4. To input a character and check whether it is a Vowel or a Consonant.
5. To input your age and check whether you are eligible to vote or not.
Assignment 10
Programs based on Conditional constructs (if-else-if programs)
1. To input the marks in English, and find the grade obtained, depending upon the
following criteria:
Marks in English Grade
90 and above A
70 to 89 B
50 to 69 C
35 to 49 D
Below 35 E

2. A company announces revised Dearness Allowance (DA) and Special Allowances


(SA) for their employees as per the tariff given below:
Basic Dearness Special Allowance (SA)
Allowance (DA)
Up to Rs.10,000 10% 5%
Rs.10,001 – Rs.20,000 12% 8%
Rs.20,001 – Rs.30,000 15% 10%
Rs.30,001 and above 20% 12%
Write a program to accept name and Basic Salary (BS) of an employee. Calculate
and display gross salary.
Gross Salary = Basic + Dearness Allowance + Special Allowance
Print the information in the given format:
Name Basic DA Special Allowance Gross Salary
xxx xxx xxx xxx xxx

Assignment 11
Programs based on Conditional constructs (if-else-if programs)
Write a program to input the cost price and the selling price of an article. If the selling
price is more than the cost price then calculate and display actual profit and profit per
cent otherwise, calculate and display actual loss and loss per cent. If the cost price and the
selling price are equal, the program displays the message 'Neither profit nor loss'.

Assignment 12
Programs based on Conditional constructs (nested if)
Write a program to input three angles of a triangle and check whether a triangle is
possible or not. If possible then check whether it is an acute-angled triangle, right-angled
or an obtuse-angled triangle otherwise, display 'Triangle not possible'.
Sample Input: Enter three angles: 40, 50, 90
Sample Output: Right=angled Triangle

Assignment 13
Programs based on Conditional constructs (nested if)
Given below is a hypothetical table showing rate of income tax for an India citizen, who
is below or up to 60 years.
Taxable income (TI) in ₹ Income Tax in ₹
Up to ₹ 2,50,000 Nil
More than ₹ 2,50,000 and less than or equal to (TI - 2,50,000) * 10%
₹ 5,00,000
More than ₹ 5,00,000 and less than or equal to (TI - 5,00,000) * 20% + 34,000
₹ 10,00,000
More than ₹ 10,00,000 (TI - 10,00,000) * 30% + 94,000
Write a program to input the name, age and taxable income of a person. If the age is
more than 60 years then display the message "Wrong Category". If the age is less than
or equal to 60 years then compute and display the income tax payable along with the
name of tax payer, as per the table given above.

Assignment 14
Programs on switch case
1. The volume of solids, viz. cuboid, cylinder and cone can be calculated by the
formula :
Volume of cuboid =
Volume of cylinder =
Volume of cone =
Using a switch case statement, write a program to find the volume of different
solids by taking suitable variables and data types.

2. The equivalent resistance o series and parallel connections of two resistances are
given by the formula :
a)
( )
b) ( )
Using a switch case statement, write a program to enter the value of r1 and r2.
Calculate and display the equivalent resistances accordingly.
Assignment 15
Programs based on Looping Statement (for)
1. To display the first ten terms of the following series

2. To find the sum of the series


( ) ( ) ( )

Assignment 16
Programs based on Looping Statement (while)
1. To enter a number and display the sum of its digits. (while)
2. To input a number. Check and display whether it is a Niven number or not. (A
number is said to be Niven which is divisible by the sum of its digits).
Example : 126 Sum of its digits = 1+2+6=9 and 126 is divisible by 9.

Assignment 17
Programs based on Looping Statement (do…while)
1. To display first ten numbers of the Fibonacci series.
2. To accept a number and check whether the number is palindrome or not. (A number is
said to be palindrome if the new number obtained after reversing the digits is same as
the original number.)

Assignment 18
Menu Driven program
'Kumar Electronics' has announced the following seasonal discounts on purchase of
certain items.
Purchase Amount Discount on Discount on
Laptop Desktop PC
Up to ₹ 25000 0.0% 5.0%
₹ 25,001 to ₹ 50,000 5% 7.5%
₹ 50,001 to ₹ 1,00,000 7.5% 10.0%
More than ₹ 1,00,000 10.0% 15.0%
Write a program to input name, amount of purchase and the type of purchase (`L' for
Laptop and 'D' for Desktop) by a customer. Compute and print the net amount to be
paid by a customer along with his name.
(Net amount = Amount of purchase - discount)

Assignment 19
Menu Driven program
Write a menu driven class to accept a number from the user and check whether it is a
Palindrome or a Perfect number.
a) Palindrome number – (A number is Palindrome which when read in reverse order is
same as read in the right order). Example 11, 101, 151 etc.
b) Perfect number – (A number is called Perfect if it is equal to the sum of its factors
other than the number itself). Example 6 = 1 + 2 + 3

Assignment 20
Menu Driven program
Using switch statement, write a menu driven program for the following:
a) To find and display the sum of the series given below:

b) To display the series : 1, 11, 111, 1111, 11111


For an incorrect option, an appropriate error message should be displayed.

-----x-----

You might also like