The Hyderabad Public School

Begumpet, Hyderabad, Telangana, 500016.

Department of Computer Science

Worksheet - 1

Class: 9Sub: Computer Applications

  1. 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

  1. 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

  1. Write a Java program that computes the double and half of a, where a stores 10.92.
  1. 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

  1. 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.
  1. 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)

  1. 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.
  1. Define a java class named Student with the main method to display the following output:

Hi Friends!

**** Welcome to Hyderabad Public School ****

  1. 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 ---

  1. Write a program in Java to interchange the values stored in two variables with the help of a third variable using function.
  1. Write a program in Java to interchange the values stored in two variables without using a temporary variable using function.
  1. Write a program in Java to find the diagonal of a rectangle. ( diagonal = a2+b2)
  1. Write a program in Java to find the temperature in Fahrenheit when temperature is given in Celsius. (F = 9*c/5 + 32)
  1. 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)
  1. Write a program in Java to find the sum and average of three numbers.
  1. A computer manufacturing company announces a special offer to their customers on purchasing Laptops and the Printers accordingly:
  2. On laptop: Discount – 15%
  3. On printers -10%

Write a program in Java to calculate the discount, if a customer purchases a Lap top and a printer

  1. 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.
  1. Write a program in java to find area, perimeter and diagonal of the rectangle

area = L*b

perimeter = 2*(l+b)

diagonal = √l2 + b2

  1. 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

  1. 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

  1. 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

  1. Write a program to calculate sum of first and last digits of a given 3 digit number.
  1. 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

  1. 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.
  2. Write a program to calculate the area, volume and Total Surface Area of a Cube.
  3. Write a program to calculate the area, volume and Total Surface Area of a Cuboid.
  4. Write a program to calculate the area, volume and Total Surface Area of a Cylinder.
  5. Write a program to calculate the area, volume and Total Surface Area of a Cone.

**************