Questions: 9 913

Answers by our Experts: 9 913

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 & Filtering

Let n = 2^l − 1 l for some positive integer l. Suppose someone claims to hold an unsorted array A[1 · · · n] of distinct l-bit strings; thus, exactly one l-bit string does not appear in A. Suppose further that the only way we can access A is by calling the function

FETCHBIT(i, j), which returns the jth bit of the string A[i] in O(1) time. Describe an algorithm to find the missing string in A using only O(n) calls to FETCHBIT. Again, give either pseucode or write a generic description.

Demonstrating the algorithm on a specific example will not fetch any marks.


Create a base class called Vehicle. Use this class to store two double type values that could be used to compute

the speed of the vehicle. Derive two specific classes called train and truck from the base Vehicle. Add to base

class, a member function get_speed() to initialize base class data members and another member functions

get_name() to compute and display the area of figures. Mark the display_area() as a abstract function and redefine

this function in the derived class to suit their requirements.


Develop a university payroll application. There are two kinds of internee in the university salaried internee, hourly

internee. The system takes as input an array containing internee objects, calculates no.of days spent in the

university polymorphically, and generates results.


Write a program that declares two classes. The parent class is called Shape that has two data members num1 and num2 to store two numbers. It also has four members functions.

·        The setarea() function set the area and displays the result.

·        The getarea() function get the area and displays the result.

·        The setdraw() function set the coordinates for draw and displays the result.

·        The getdraw() function get the coordinates for draw and displays the result.

The child class is called Circle that overrides all four functions. Each function in the child class checks the value of data members. It calls the corresponding member function in the parent class if the values are greater than 0. Otherwise it displays error message. All the possible exception is handle through exception handling.



Write a program that declares two classes. The parent class is called Shape that has two data members num1 and num2 to store two numbers. It also has four members functions.

·        The setarea() function set the area and displays the result.

·        The getarea() function get the area and displays the result.

·        The setdraw() function set the coordinates for draw and displays the result.

·        The getdraw() function get the coordinates for draw and displays the result.

The child class is called Circle that overrides all four functions. Each function in the child class checks the value of data members. It calls the corresponding member function in the parent class if the values are greater than 0. Otherwise it displays error message. All the possible exception is handle through exception handling.



Develop a university payroll application. There are two kinds of internee in the university salaried internee, hourly internee. The system takes as input an array containing internee objects, calculates no.of days spent in the university polymorphically, and generates results.

 

give me an example of gotoxy for loop program in c++


a program that will determine the area of the following: circle, square, rectangle and triangle.


Sample Program Run

Enter the number of test cases: 1

Enter the size of the array: 5

Enter the number of rotation to perform: 2

Enter the elements of the array: 1 2 3 4 5

Resulting array: 4 5 1 2 3


Sample Program Run:

Enter number of test cases: 3


Enter the size of the array: 5

Enter the elements of the array: 5 1 4 2 3

Number of Inversions: 6


Enter the size of the array: 10

Enter the elements of the array: 2 1 3 4 5 6 7 9 8 10

Number of Inversions: 2


Enter the size of the array: 7

Enter the elements of the array: 4 1 3 5 2 3 8

Number of Inversions: 7


LATEST TUTORIALS
APPROVED BY CLIENTS