The below code will help you to solve the given problem and you can execute and cross verify with sample input and output.
#include<stdio.h>
#include<string.h>
int* uniqueValue(int input1,int input2[])
{
int left, current;
static int arr[4] = {0};
int i = 0;
for(i=0;i<input1;i++)
{
current = input2[i];
left = 0;
if(current > 0)
left = arr[(current-1)];
if(left == 0 && arr[current] == 0)
{
arr[current] = input1-current;
}
else
{
for(int j=(i+1);j<input1;j++)
{
if(arr[j] == 0)
{
left = arr[(j-1)];
arr[j] = left - 1;
}
}
}
}
return arr;
}
Answer:
#include <iostream>
using namespace std;
int main () {
// for loop execution
int semester_fees=8000;
int b=1;
cout<<"there are 5 years or 10 semester fees breakdown is given below"<<endl;
for( int a = 1; a <=5; a++ ) {
semester_fees = semester_fees*1.03;
cout<<"Semester fees for each of semester"<<b++<<"and"<<b++<<"is:$"<<semester_fees<<endl;
}
return 0;
}
Explanation:
code is in c++ language
Fees is incremented yearly and i have considered only two semester per year
Answer:
Pseudocode is as follows:
// below is a function that takes two parameters:1. An array of items 2. An integer for weight W
// it returns an array of selected items which satisfy the given condition of sum <= max sum.
function findSubset( array items[], integer W)
{
initialize:
maxSum = 0;
ansArray = [];
// take each "item" from array to create all possible combinations of arrays by comparing with "W" and // "maxSum"
start the loop:
// include item in the ansArray[]
ansArray.push(item);
// remove the item from the items[]
items.pop(item);
ansArray.push(item1);
start the while loop(sum(ansArray[]) <= W):
// exclude the element already included and start including till
if (sum(ansArray[]) > maxSum)
// if true then include item in ansArray[]
ansArray.push(item);
// update the maxSum
maxSum = sum(ansArray[items]);
else
// move to next element
continue;
end the loop;
// again make the item[] same by pushing the popped element
items.push(item);
end the loop;
return the ansArray[]
}
Explanation:
You can find example to implement the algorithm.
Answer:
C: Security
Explanation:
Communications and information systems principles need to be, among other things, secure. They need to be able to protect sensitive information from those who intentionally not need to know. Some incident information like voice, networks, and data, are very sensitive and thus, should be secure to the right levels and should comply with privacy laws and data protection.