Define an abstract class Human comprising the following members- name and age (with appropriate data types, a parameterized constructor and a pure virtual function printDetails().
The program also defines two concrete classes- Adult and Child inheriting publicly from the class Human.
Class Adult has a data member- voterID (with appropriate data type).
Class Child has a data member- schoolName (with appropriate data type).
Define parameterized constructors for both the classes Adult and Child. The constructors should also have following validation check for the age input.
Override printDetails() function for both the derived classes.
Define main() function to declare one object each for classes Adult and Child respectively and print the details of the objects.
Write a program in C++ that reads some text entered through the keyboard till the end of file (eof) character is entered. The words in the text are written to different text files as per the following conditions:
Sample input: Buy 1 Kg apples And 17 oranges immediately ^Z
Sample output:
fileV.txt: apples oranges immediately
fileD.txt: 1 17
fileRest.txt: Buy Kg And
Write a program in C++ that defines an m x n two dimensional array containing integer elements, where m and n represent the numbers of rows and columns respectively. The numbers of rows and columns should be defined as constants. The program should provide the following user-defined functions with appropriate parameters:
Write a program in C++ that provides a user-defined class NewFloat with a data member
floatData of type float. The class also comprises the following members:
There are N intermediate stations between two places A and B. Find the number of ways in which a train can be made to stop at S number of these intermediate stations so that no two stopping stations are consecutive. Write a python module Station.py for above and import the module in main program .In main program define a function Get-Station(N,S)
which takes value of N & S and return integer result as shown in example by calling the appropriate function implemented in Station.py module. Also handle the possible exceptions and display the exception message in form of string. Do not use input function provide input in fixed form.
For Example : 1) Input : N= 12 , S= 4
Output: 126
2) Input : N= 2 , S = 4
Output : 0
Gwalior Fort is a popular tourist place in Gwalior, Madhya Pradesh. Everyday peoples registered to visit Fort as token provided based on first come basis. Everyday limited numbers of peoples are allowed to visit. The management selects a number A1 randomly every day and generates another number A2 as count of the total number of set bits (i.e., total no. of 1s) in binary representation of all numbers from 1 to A1. For example, A1=3 then A2=4 [1(01) +2(10) +3(11)]. So, write a python module CountBit.py to find A2 using A1. You need to import this module in main program. In main program define a function
G-T(n) which takes a number and return value as shown in example by calling the appropriate function implemented in CountBit.py module.
Example-1 : Input : 3 , Output : 4
Example-2 : Input : 7 , Output : 12
Your given a string of numbers A, the task is to find the max value from the string A ; you can add a '+' or '*' sign between two numbers. For Ex S=452 as 4*5*2 = 40 and 4*5+2=22 So 40 is maximum.
Write a python module Maxvalue.py for solving the above task. You need to import this module in main program. In main program define a function F-M(n) which takes a string and returns maximum value or error message as shown in example by calling the appropriate function implemented in Maxvalue,py module. Also handle the exceptions and display the exception message in the form of string. F-M(n) function must be generalized one.
You work in XYZ Company as a Python. The company officials want you to write code for reducing the dimensions of a dataset
Tasks to be performed: -
- Using load_digits function from sklearn import wines data
- Take a look at the shape of image data
- Import PCA, LDA and FactorAnalysis from Sklearn
- Project data in 2 D space using the PCA, LDA and FactorAnalysis algorithm form sklearn
- Take a look at the new data
I'm planning to swap the kid's place to another older guy's place so the bully won't be close to the kid. Please help me swap them both.
Instructions:
A car model class under package:package 3 with the following attributes