GOA BOARD 2024 PAPER SOLUTION
GOA BOARD 2024 PAPER SOLUTION
GOA BOARD 2024 PAPER SOLUTION
1. 25
3. Insertion sort
4. ios::out
5. A’BC
6. 0.196.45.0
7. Modem
10. QUEUE
11. IFSTREAM
SECTION-B
15. Function 1 is called destructor, and it gets called when the object gets
destroyed/deleted.
Function 2 is called parameterized constructor, and it gets invoked when an
object is created.
Statement to invoke function 2: JOB(8,’a’);
16. 3:5
3:2
● Singly Linked List: Each node has a single link that points to the next
node in the sequence.
● Doubly Linked List: Each node has two links, one that points to the next
node and another that points to the previous node, allowing bidirectional
traversal.
Traversal:
● Singly Linked List: Can only be traversed in one direction (from the
head to the end).
● Doubly Linked List: Can be traversed in both directions (from head to
end and from end to head), which makes it more versatile but also
requires more memory per node.
int COUNT() {
ifstream file("data.txt");
char ch;
int count = 0;
file.close();
return count;
}
int main() {
int capitalCount = COUNT();
if (capitalCount != -1) {
cout << "Number of capital letters in the file: " << capitalCount <<
endl;
}
return 0;
}
21. b(a+c)
class Tourist {
// Private Data Members
int Cno; // Cab number
char Ctype; // City type ('A', 'B', or 'C')
float Perkm; // Per kilometer charge
float Distance; // Distance traveled in kilometers
float Amount; // Total amount (Perkm * Distance)
public:
// Public Member Function to read data
void readdata() {
cout << "Enter Cab Number: ";
cin >> Cno;
cout << "Enter City Type (A, B, or C): ";
cin >> Ctype;
cout << "Enter Distance traveled (in km): ";
cin >> Distance;
int main() {
Tourist t;
t.readdata(); // Input cab details
t.displaydata(); // Display cab details and amount
return 0;
}
int main() {
int number;
cout << "Enter a number: ";
cin >> number;
if (isNeon(number)) {
cout << number << " is a Neon number." << endl;
} else {
cout << number << " is not a Neon number." << endl;
}
return 0;
}
OR
// convert binary to decimal
#include <iostream>
#include <cmath>
// function prototype
int convert(long long);
int main() {
long long n;
cout << "Enter a binary number: ";
cin >> n;
cout << n << " in binary = " << convert(n) << " in decimal";
return 0;
}
// function definition
int convert(long long n) {
int dec = 0, i = 0, rem;
while (n!=0) {
rem = n % 10;
n /= 10;
dec += rem * pow(2, i);
++i;
}
return dec;
}
int main() {
int A[] = {1, 1, 1, 2, 3, 3, 3, 4, 4}; // Example input array
int n = sizeof(A) / sizeof(A[0]);
removeDuplicates(A, n);
return 0;
}
OR
#include <iostream>
using namespace std;
// Display elements of C (A - B)
cout << "Array C (A - B): ";
for (int i = 0; i < k; i++) {
cout << C[i] << " ";
}
cout << endl;
}
int main() {
int A[] = {4, 8, 3, 9, 1, 7};
int B[] = {8, 2, 5, 6, 9};
int m = sizeof(A) / sizeof(A[0]);
int n = sizeof(B) / sizeof(B[0]);
setdifference(A, m, B, n);
return 0;
}
protected:
// Protected show function to display rollno
void show() {
cout << "Roll No: " << rollno << endl;
}
public:
// Parameterized constructor to initialize rollno
STUDENT(int r) : rollno(r) {}
// Making STUDENT an abstract class by defining a virtual function
virtual void dummy() = 0;
};
protected:
// Protected show function to display tcode
void show() {
cout << "Teacher Code: " << tcode << endl;
}
public:
// Parameterized constructor to initialize tcode
TEACHER(int t) : tcode(t) {}
// Making TEACHER an abstract class by defining a virtual function
virtual void dummy1() = 0;
};
public:
// Parameterized constructor to initialize ccode
COURSE(int r, int t, int c) : STUDENT(r), TEACHER(t), ccode(c) {}
// Overriding show() function to display ccode and also call base class show
functions
void show() {
STUDENT::show();
TEACHER::show();
cout << "Course Code: " << ccode << endl;
}
};
int main() {
// Creating an object of COURSE and displaying data members
COURSE obj(101, 202, 303);
obj.show();
return 0;
}