Programming & Computer Science Answers

C++ 9913
Python 5288
Java | JSP | JSF 3611
C 1680
C# 1362
Computer Networks 989
Algorithms 652
Databases | SQL | Oracle | MS Access 641
HTML/JavaScript Web Application 588
Other 537
Visual Basic 358
Assembler 209
Software Engineering 202
AJAX | JavaScript | HTML | PHP 166
MatLAB 150
MatLAB | Mathematica | MathCAD | Maple 124
Action Script | Flash | Flex | ColdFusion 112
UNIX/Linux Programming 89
Web Development 73
Excel 36
ASP | ASP.NET 23
Delphi | Pascal 21
Perl 16
Prolog 9
Functional Programming 9
MathCAD 5
Wolfram Mathematica 4
WPF 4
Ruby | Ruby on Rails 3
NodeJS Web Application 2

Questions answered by Experts: 26 876

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

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.

  • The age of an adult should be more than or equal to 18 years.
  • The age of a child should be in the range 0 to 18 (excluding both numbers).

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:

  • The words beginning with any of the lowercase vowels (a, e, i, o, u) are written to a file fileV.txt.
  • The words beginning with a digit (0 – 9) are written to a file fileD.txt.
  • All other words are written to a file fileRest.txt.

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:

  • setArrData(...): The function accepts elements from the keyboard and stores them into the array.
  • printArrData(...): The function prints the array values on the screen.
  • getAverage(...): The function accepts the array, number of rows and number of columns as parameters and returns the average of all values in the array.
  • findMax(...): The function accepts the array, number of rows and number of columns as parameters and prints the greatest element from each column of the array. 

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:

  • default and parameterized constructors
  • an inline member function printData() that prints the details of an object of the class
  • a member function deciData() that returns the decimal part of floatData
  • operator overloading to perform the following operations:
  1. post increment (++) increments floatData by 1.
  2. less than (<) on a pair of objects of the class. The function returns 1 if the data member of the object on the LHS of the operator is less than the data member of the object on the RHS of the operator and 0 otherwise.
  3. int cast to convert the float data member of an object into an integer.

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:

  1. You are given a main() function that asks the user for two integer inputs and passes these two values to a function call of the swap() function.
  2. The swap function doesn't exist yet so your task is to make its function declaration and implement its function definition.
  3. Its details are the following:
  4. It accepts two integer addresses as its parameters
  5. It will swap the values found in the two integer addresses. For example, if we have two integer values, a = 5 and b = 10, and we pass their addresses to the function call, by the end of the function, the two integer values will be swapped. Meaning, a would now be equal to 10 and b would now be equal to 5.
  6. Do not edit anything in the main() function.

A car model class under package:package 3 with the following attributes

LATEST TUTORIALS
APPROVED BY CLIENTS