(Using Encapsulation)
Create a class named 'Student' with 2 instance variables (both set as private)
The 2 variables are: String variable 'name' and integer variable 'roll_no'.
Create a get and set Method for each variable.
Also create a class with Main Method, where you will:
Create an object of the class Student
Allow the user to enter a value for the name and roll_no and accept the values by using
the set Method of each variable
Display the content of the object by using the get Method of each variable
WAP to create two different files name like roll and name of at least 5 students and print all on screen.
WAP using class template with multiple parameters.
WAP using function template to add two numbers and display result.
(Using Inheritance)
Create a parent class named “Parent”, with a method that displays “I am a Parent Class”.
Also create a subclass that named “Child” that has a method that prints “I am a Child Class”.
Now create a class with Main Method, where you will:
Create an object for each class (1 for “Parent” and 1 for “Child”)
Call the method of “Child” class by using the Child object
Call the method of “Parent” class by object of the “Parent” class
Find latitude and longitude of first 20 countries with a population greater than or equal to the population limit given below. Use the country details from this dataset.
Your task is to find the sum of the length of all lines (in kms) that can be drawn between co-ordinates of these countries.
Population limit: 300
Write a C program using 2D array which stores the marks of five students in five courses. Write a program to (i) Display the highest marks in each courses .(ii) To display the total marks of all 5 courses
Write a program in C/C++ to calculate the value of “ ” by using the series expansion given below:
cosx=1-x2/2! + x^4/4! - x6/6!+.........
Note:
Evaluate only upto first three terms.
Also find the value of by using the inbuilt function.
Compare the results i.e., the result produced by your program and that produced by inbuilt function. Based on comparison, determine error.
create the following form
customer name
address
month
units
bill
Consider a square matrix , a size n*n and a integer , x . Calculate the row number , r and column , c or x in a. If the sum of R and C is an even number, find the sum s of all even numbers in the matrix and if the sum of r and c is odd , then find the sum s of all odd numbers in the matrix.