MADPractical1_20012021062
AIM:
1.1 Store & Display values in different variable of different type (Integer, Double, Float, Long, Short, Byte, Char, Boolean, String)
Output:
1.2 Type conversion: Integer to Double, String to Integer, String to Double.
Output:
1.3 Scan student’s information and display all the data.
Output:
1.4 Find the number is odd or even by using Control Flow inside println() method.
Output:
1.5 Display month name using When
Output:
1.6 By using a user defined function perform all arithmetic operations.
Output:
1.7 Find the factorial of number by recursion. Explain "tailrec" keyword.
Output:
1.8 Create different types of Array as shown in image. Explore Arrays.deepToString(), contentDeepToString() methods, IntArray variable .joinToString() and use in program to print Array. Explore range, downTo, until etc. for loop and use in this program. Sort Array of Integer data type without using inbuilt function & with using inbuilt function
Output:
1.9 Find the max number from ArrayList.
Output:
1.10 Write Different types of Class & Constructor. Create a class Car and set various members like type, model, price, owner, milesDrive. add the function getCarPrice in it. Create an object of Car class and access property of it. (getCarInformation(), getOriginalCarPrice(), getCurrentCarPrice(), displayCarInfo() etc.)
Output:
1.11 Write about Operator Overloading. Perform Matrix Addition, Subtraction & Multiplication using Class Matrix & operator overloading. Overload toString() function in Matrix class.
Output;