Solve the following Linear Programming (LP) problem:
Maximize Z = 3X1 + 2X2
Subject to: X1 + X2 ≤ 6
2X1 + X2 ≤ 8
-X1 + X2 ≤ 1
X2 ≤ 2
a) Identify the feasible extreme points (maximum attractive corner) for the problem.
b) Solve the problem graphically.
struct Module {string moduleName; string moduleCode; string lecturer; int nrStudents} Turn the Module struct into a class. The class should have member variables for all the values in the corresponding struct. Make all the member variables private. Include public member functions for each of the following: a default constructor that sets the string member variables to blank strings, and the int member variable to 0; an overloaded constructor that sets the member variables to specified values; member functions to set each of the member variables to a value given as an argument to the function; member functions to retrieve the data from each of the member variables; Test the class in a program that instantiates an object of class Module. The program should then input values for the object, and use the mutators to assign values to the member variables. Use the accessors to obtain the values of the object's member variables and display those values on the screen.
1.
Derive the best and worst-case time complexity for the following algorithm and express it in O notation. (Here max and min functions assume their usual meaning.)
1.
myFunction(A[ ]) {
2.
n = A.length
3.
v = n
4.
for i = 1 to n {
5.
v = min(A[i], v)
}
6.
v = max(1, n)
7.
for j = 1 to 100 {
8.
sum = 0
9.
k = 1
10.
while k <= v {
11.
sum = sum + A[k]
12.
k = k*2
}
}
}
Hints: Find out the greatest and smallest possible value for v, and use it in your analysis.
struct student
{
char IDNumber[10];
char Name[20];
int Age;
char Department[25];
float CGPA;
} ;
Choose your structure name. Include five member variables for your structure. Then do the following questions based on your structure declaration.
a) Define a function that declares array of student and registers 10 students.
b) Define a function that displays full information about those 10 students.
c) Define a function that can be used to update information about the first student.
1.Write C++ program to accept N number from the user and print the elements of the array in reverse order using a pointer.
2.Write C++ program that accepts N elements from the user and display the sum of array elements using pointers.Write a program to print a rectangle pattern of M rows and N columns using the characters as shown below.
In the given example,
3 rows and 10 columns.Therefore, the output should be
+----------+
| |
| |
| |
+----------+
QI: write a full python program to process the orders of a Fashion
shop, the order contains the following information:
1- Name of the person who request an order.
2-Phone number of the person who requested the order.
3- Name of the order
4- Is the order delivery or collect from the fashion shop?
Note: the orders are served according to arrival of the order.