The Hyderabad Public School
Begumpet, Hyderabad, Telangana, 500016.
Department of Computer Science
Worksheet - 1
Class: 9Sub: Computer Applications
- Write a Class ‘SUM’ that initializes the two integer numbers 10 and 25 to variables and prints the result after:
a)Addition
b)Subtraction
c)Multiplication
d)Division
- Write a java program that prints the computed kinetic energy by the formula:
K.E. = ½ mv2, where m= 4.5 kg, v = 10 m/sec
- Write a Java program that computes the double and half of a, where a stores 10.92.
- Assign the real numbers 3.25 and 10.96 to variables x and y, and write a java program to compute the result of the following expressions:
a)4x + y2 / x-y
b)0.004x2 + 0.052xy – 1/100 xy2
- Taking the units place digit of a number u as 9, tens digit t as 0 and the hundreds place digit h as 4, write a java program that uses the mathematical relation of place values of a number to calculate the number.
- Given the cost price of an article is Rs.60.25 and is sold for Rs.89.75. Write a program that calculates the profit percent of the sale using the formula:
Profit in % = profit/C.P. X 100,
Where profit = SP-CP(SP-Selling priceCP-Cost Price)
- Write a program using in java, to print the real quotient obtained by dividing two integer numbers (5 and 50). Also print the remainder obtained after dividing them.
- Define a java class named Student with the main method to display the following output:
Hi Friends!
**** Welcome to Hyderabad Public School ****
- Define a class named Success with the main method to display the following output:
Failures are the pillars of Success
Once you get Success
--- Make it your habit ---
- Write a program in Java to interchange the values stored in two variables with the help of a third variable using function.
- Write a program in Java to interchange the values stored in two variables without using a temporary variable using function.
- Write a program in Java to find the diagonal of a rectangle. ( diagonal = a2+b2)
- Write a program in Java to find the temperature in Fahrenheit when temperature is given in Celsius. (F = 9*c/5 + 32)
- Write a program in Java to find the amount and compound interest when principle, interest and time are given. (amount = p*(1+r/100)t and CI = Amount – Principle)
- Write a program in Java to find the sum and average of three numbers.
- A computer manufacturing company announces a special offer to their customers on purchasing Laptops and the Printers accordingly:
- On laptop: Discount – 15%
- On printers -10%
Write a program in Java to calculate the discount, if a customer purchases a Lap top and a printer
- Write a program in Java to calculate the number of days, number of months and the remaining number of days where number of days is given.
- Write a program in java to find area, perimeter and diagonal of the rectangle
area = L*b
perimeter = 2*(l+b)
diagonal = √l2 + b2
- Write a program in Java to give values for three sides of a Scalene triangle and calculate the area of a Scalene triangle by using the formula:
Area = √s* (s-a)*(s-b)*(s-c)
Where S = (a+b+c)/2
- Write a program to determine the roots of quadratic equation where values for a, b, c are given. The roots of the equation are determined by the formula
R1 = -b+√b2-4ac/2a
R2 = -b-√b2-4ac/2a
- Write a program in Java to calculate and display the hypotenuse and area of the right angled triangle where perpendicular and base of the triangle is given.
Hypotenuse = √p2 + b2
Area = ½ *p*b
- Write a program to calculate sum of first and last digits of a given 3 digit number.
- Write a program in Java to find the amount and compound interest when Principle, Interest, and time are given.
Amount = p*(1+r/100)t
CI = Amount – P
- Assume that the currency notes available are only Rs.20, Rs.5, Rs.2 and Rs.1. Write a program to input an amount and display the minimum number of notes that amount can be paid in.
- Write a program to calculate the area, volume and Total Surface Area of a Cube.
- Write a program to calculate the area, volume and Total Surface Area of a Cuboid.
- Write a program to calculate the area, volume and Total Surface Area of a Cylinder.
- Write a program to calculate the area, volume and Total Surface Area of a Cone.
**************