Define a class License that has a driving license number, name and address. Define
constructors that take on parameter that is just the number and another where all
parameters are present.
Input two integers in one line.
Print the two integers in one line, separate them with a space.
Print a string message on a new line, "Equal" if both integers are equal.
a. Write a function is_subset_sum that takes an integer N and an integer
array A as parameter and returns True if N is a sum of any subset of A and
returns False otherwise. You must use dynamic programming tabulation
method for calculation
b. Write a main function that takes the array A of size s as input from the
console. Then it takes N as input in a loop and prints whether there is a subset
in A that sums to N or not. Following is a sample code for that.
while(true){
cout << “Enter N: “;
cin >> N;
cout << is_subset_sum(A, N, s) << endl;
Sample input:
5
2 4 5 6 8
Enter N: 15
Enter N: 0
Enter N: 3
Sample output:
15 is a subset sum of the given array
0 is a subset sum of the given array
3 is not a subset sum of the given array
Write a function int wrong(char key[].char results[]) The function will be used to grade multiple-choice exam.
The exan has 5 questions, each answered with a letter in the range 'a', to f. All the answers for a student are stored in the character array results.
The key-answer is also stored in array key. Both arrays (results) and (key) are passed to the function wrong as parameters.
The function wrong returns the numbers of false answers given by by the student. For example if the key is-{'a','b','a','d",'e'} and the results is {'a','c','a','d','f'}. the function return 2 (since there are 2 wrong answers).
Instructions:
Input two integers in one line.
Print the two integers in one line, separate them with a space.
Print a string message on a new line, "Equal" if both integers are equal.
Output
5 5
Equal
Define a class Deposit that has a principal, a rate of interest, which is fixed for all
deposits and a period in terms of years. Write member functions to
(i) alter(float) which can change the rate of interest.
(ii) interest() which computes the interest and returns it.
(iii) print() which prints data as shown below. Note that the width of each column is 20.
�
1. Using the looping statement. Create a program that will display the following:
A. *
***
****
****
***
*
B. @@@@@@@
@
@
@
@@@@@@@
5.2 The program should be menu driven, with the options: Capture Student Marks, Sort the Class List, Display the Class List, Exit.
print the minimum number in the n given integer.
1 <_ N <_ 10
Create a class Shape and two additional classes (each derived from Shape) named Rectangle and Triangle. The member attributes and functions for each class are given below:
Shape:
private:
int width;
int height;
public:
virtual int getArea();
Rectangle:
public:
virtual int getArea();
Triangle:
public:
virtual int getArea();
Driver Program:
Rectangle r1(3,2);
Triangle t1(3,2);
Shape *s1 = &r1;
s1->getArea();
Shape *s2 = &t1;
s2->getArea();