Complete Task List - Java
Complete Task List - Java
Basic Operations
1. Input a natural number within 100. Print numbers 1 to 100 except the given input
number.
2. Sum of first n natural numbers with and without loop.
3. Find the third angle of a triangle if the other two angles are provided
4. Check whether the given string is a palindrome or not.
5. Input a character and print its ASCII value using typecasting.
6. Construct the triangle pattern
1
12
123
1234
Math functions
1. Calculate the square root of a number using Math.sqrt().
2. Raise a number to a power using Math.pow().
3. Compute sine, cosine, and tangent values for an angle in radians using
Math.sin(), Math.cos(), and Math.tan()
4. Find the absolute value of a number using Math.abs().
Encapsulation
Task1:Create a Student class with private fields: name, rollNumber, and
grade. Implement getters and setters for each field. Write a main program
to create a Student object and manipulate its data using the provided
methods.
Task2:Create a Car class with private fields: model, year, and price. Add
methods to update the price based on depreciation and display the car
details. Write a program to demonstrate the functionality.