Create a base class `Person` with members `name` and `age`. Derive a class `Student` with an additional member `percentage`. Accept and display data using constructor and member functions.

Create a base class `Person` with members `name` and `age`. Derive a class `Student` with an additional member `percentage`. Accept and display data using constructor and member functions. SOLUTION…. #include <iostream> using namespace std; // Base class class Person { protected: string name; int age; public: // Constructor Person(string n, int a) { name = […]

Create a class `Rectangle` with data members `length` and `breadth`. Use a constructor to initialize values and include member functions to calculate and display area and perimeter.

Create a class `Rectangle` with data members `length` and `breadth`. Use a constructor to initialize values and include member functions to calculate and display area and perimeter. SOLUTION…. Rectangle Class in C++ — Demo Page #include <iostream> using namespace std; class Rectangle { private: float length, breadth; public: // Constructor to initialize values Rectangle(float l, […]

Create a class `Employee` with data members `emp_id`, `name`, and `salary`. Accept and display employee details. Calculate and display net salary after deducting 10% tax.

Create a class `Employee` with data members `emp_id`, `name`, and `salary`. Accept and display employee details. Calculate and display net salary after deducting 10% tax. SOLUTION Employee Class in C++ — Demo Page #include <iostream> #include <string> using namespace std; class Employee { private: int emp_id; string name; float salary; public: // Function to accept […]

Unit-2 Self-Management Skills-I

Unit-2 Self-Management Skills-I Multiple Choice Question Importance of Self-Management 1. Self-management means:A. Managing others effectivelyB. Controlling and organizing one’s own activities and behaviorC. Avoiding responsibilitiesD. Managing financial accounts 2. Which of the following is a benefit of self-management?A. Increased stressB. Better productivityC. More procrastinationD. Lack of focus 3. A self-managed person is likely to:A. Miss […]

Unit 1: Communication Skills-I

Unit 1: Communication Skills-I Multiple Choice Question Methods of Communication 1. Which of the following is a verbal method of communication?A. Hand gesturesB. Face-to-face conversationC. Body postureD. Eye contact 2. Which method uses words to convey messages?A. Verbal communicationB. Non-verbal communicationC. Visual communicationD. Written communication 3. Which of these is not an example of non-verbal […]

Write a Python program to check whether a number is negative, positive or zero.

Write a Python program to check whether a number is negative, positive or zero. PROGRAM # Input and Output for Basic Data Types in Python # Integerint_input = int(input(“Enter an integer: “))print(“You entered integer:”, int_input) # Floatfloat_input = float(input(“Enter a float number: “))print(“You entered float:”, float_input) # Stringstring_input = input(“Enter a string: “)print(“You entered string:”, […]

Write a Python program to find maximum between two numbers.

Write a Python program to find maximum between two numbers. PROGRAM # Program to find the maximum between two numbers # Take input from the usernum1 = float(input(“Enter the first number: “))num2 = float(input(“Enter the second number: “)) # Compare the numbersif num1 > num2:print(f”The maximum number is: {num1}”)elif num2 > num1:print(f”The maximum number is: […]

Write a Python program to find maximum between three numbers.

Write a Python program to find maximum between three numbers. PROGRAM # Program to find the maximum between three numbers # Take input from the usernum1 = float(input(“Enter the first number: “))num2 = float(input(“Enter the second number: “))num3 = float(input(“Enter the third number: “)) # Compare the numbersif num1 >= num2 and num1 >= num3:print(f”The […]

Unit 3 : Shell Scripting in Linux

Unit 3 : Shell Scripting in Linux Unit 3 : Shell Scripting in Linux 3.1 Creating and Executing Shell Scripts (nano, vi, ./script.sh) 3.2 Shell Metacharacters and Operators 3.2.1 Filename Expansion (wildcards: *, ?, []) 3.2.2 Input/Output Redirection (>, >>, <) 3.2.3 Pipes (|) 3.2.4 Command Substitution ($(…), …) 3.3 Control Flow Structures (if-else, case, […]