🔒 Closed Çℎḙḡḡ Questions

Status
Not open for further replies.
pa unlock boss please https://www.Çℎḙḡḡ.com/homework-help...essing-given-class-applications-fol-q82145143
 
Simplification of the conceptual schema contain only 4 classes

  • 1. Project class
  • 2. Employee class
  • 3. Contract class
  • 4. AssignProject class
Relationship between Classes

  • 1. There are 1:M relatonship between Project class and AssignProject Class
  • 2. There are M:1 relatonship between AssignProject class and Employee class
  • 3. There are 1:1 relatonship between Contract class and Employee class.
1627205705884_eliminateconceptual-png.1500537
 

Attachments

  • 1627205705884_eliminateConceptual.webp
    1627205705884_eliminateConceptual.webp
    15.7 KB · Views: 8
https://www.Çℎḙḡḡ.com/homework-help...put-first-make-menu-list-find-suita-q72982211

https://www.Çℎḙḡḡ.com/homework-help...put-make-menu-list-find-suitable-tw-q61132930

boss pwedi pa unlock naman neto please ?

DCCS
 
First question answer
Answer :

NOTE: As per the Çℎḙḡḡ guidelines we are allowed to answer only one question at a time . Violating Çℎḙḡḡ guidelines might lead to termination of expert's account . Please post the other question seperately to be answered by other experts . Thank you for understanding .

C++ code:

#include<bits/stdc++.h>
using namespace std;

// Complement of set A
string complementA(string a,string b){
int n = a.size(), m = b.size();
string s = "";
if(n<m){
for(int i=0;i<m;i++){
if(a=='0' && b=='1') s+="1";
else s+="0";
}
}
else{
for(int i=0;i<n;i++){
if(a=='0' && b=='1') s+="1";
else s+="0";
}
}
return s;
}

// Intersection of set A and B
string AandB(string a,string b){
int n = a.size(), m = b.size();
string s = "";
if(n<m){
for(int i=0;i<m;i++){
if(a==b && a=='1') s+="1";
else s+="0";
}
}
else{
for(int i=0;i<n;i++){
if(a==b && a=='1') s+="1";
else s+="0";
}
}
return s;
}

// Union of set A and B
string AUB(string a,string b){
int n = a.size(), m = b.size();
string s = "";
if(n<m){
for(int i=0;i<m;i++){
if(b=='1' || a=='1') s+="1";
else s+="0";
}
}
else{
for(int i=0;i<n;i++){
if(a=='1' || b=='1') s+="1";
else s+="0";
}
}
return s;
}

string A_B(string a,string b){
int n = a.size(), m = b.size();
string s = "";
if(n<m){
for(int i=0;i<m;i++){
if(a=='1' && b=='0') s+="1";
else s+="0";
}
}
else{
for(int i=0;i<n;i++){
if(a=='1' && b=='0') s+="1";
else s+="0";
}
}
return s;
}

// Xor of set A and B
string AxorB(string a, string b){
int n = a.size(), m = b.size();
string s = "";
if(n<m){
for(int i=0;i<m;i++){
if(a != b) s+="1";
else s+="0";
}
}
else{
for(int i=0;i<n;i++){
if(a != b) s+="1";
else s+="0";
}
}
return s;
}

int main(){

// For taking input from file
// Include these line of code if you want to read data from text file rest will remain same

/*
string line;
vector<string> vec;
ifstream myfile ("example.txt");
if (myfile.is_open()){
while ( getline (myfile,line) )
{
vec.push_back(line);
}
myfile.close();
}

vector<int> arr1,arr2;
for(int i=0;i<vec[0].size();i++)
arr1.push_back(stoi(vec[0]));

for(int i=0;i<vec[1].size();i++)
arr2.push_back(stoi(vec[1]));
*/

int arr1[] = {1,2,3,4,5,7};
int arr2[] = {2,4,6,7,9};
string a="",b;
for(int i=0;i<100;i++) a+="0";
b=a;
cout<<"Set A and B are as follows:\n";
for(int i=0;i<sizeof(arr1)/sizeof(arr1[0]);i++){
a[arr1]='1'; // Converting array to bitwise string
cout<<arr1;
}
cout<<endl;
for(int i=0;i<sizeof(arr2)/sizeof(arr2[0]);i++){
b[arr2]='1'; // Converting array to bitwise string
cout<<arr2;
}
cout<<endl;
string ans = AUB(a,b);
cout<<"Union of two sets is: ";
for(int i=0;i<100;i++)
if(ans=='1') cout<<i;
cout<<endl;

cout<<"Xor of two sets is: ";
ans = AxorB(a,b);

for(int i=0;i<100;i++)
if(ans=='1') cout<<i;
cout<<endl;

cout<<"Intersection of two sets is: ";
ans = AandB(a,b);

for(int i=0;i<100;i++)
if(ans=='1') cout<<i;
cout<<endl;

cout<<"Difference of two sets is: ";
ans = A_B(a,b);

for(int i=0;i<100;i++)
if(ans=='1') cout<<i;
cout<<endl;

cout<<"Complement of sets A is: ";
ans = complementA(a,b);

for(int i=0;i<100;i++)
if(ans=='1') cout<<i;
cout<<endl;
return 0;
}
Output:
1617650809873_IMG-20210406-WA0004.webp
 
2nd question answer
Answer:

Source Code: In C++

#include <algorithm>
#include <iostream>
using namespace std;

int binarySearch(int arr[], int l, int r, int x);

void printUnion(int arr1[], int arr2[], int m, int n)
{

if (m > n) {
int* tempp = arr1;
arr1 = arr2;
arr2 = tempp;

int temp = m;
m = n;
n = temp;
}


sort(arr1, arr1 + m);
for (int i = 0; i < m; i++)
cout << arr1 << " ";


for (int i = 0; i < n; i++)
if (binarySearch(arr1, 0, m - 1, arr2) == -1)
cout << arr2 << " ";
}

// Prints intersection of arr1[0..m-1] and arr2[0..n-1]
void printIntersection(int arr1[], int arr2[], int m, int n)
{
// Before finding intersection, make sure arr1[0..m-1]
// is smaller
if (m > n) {
int* tempp = arr1;
arr1 = arr2;
arr2 = tempp;

int temp = m;
m = n;
n = temp;
}

// Now arr1[] is smaller

// Sort smaller array arr1[0..m-1]
sort(arr1, arr1 + m);

// Search every element of bigger array in smaller
// array and print the element if found
for (int i = 0; i < n; i++)
if (binarySearch(arr1, 0, m - 1, arr2) != -1)
cout << arr2 << " ";
}

// A recursive binary search function. It returns
// location of x in given array arr[l..r] is present,
// otherwise -1
int binarySearch(int arr[], int l, int r, int x)
{
if (r >= l) {
int mid = l + (r - l) / 2;

// If the element is present at the middle itself
if (arr[mid] == x)
return mid;

// If element is smaller than mid, then it can only
// be presen in left subarray
if (arr[mid] > x)
return binarySearch(arr, l, mid - 1, x);

return binarySearch(arr, mid + 1, r, x);
}

// We reach here when element is not present in array
return -1;
}

int main()
{
int arr1[] = { 7, 1, 5, 2, 3, 6 };
int arr2[] = { 3, 8, 6, 20, 7 };
int m = sizeof(arr1) / sizeof(arr1[0]);
int n = sizeof(arr2) / sizeof(arr2[0]);

// Function call
cout << "Union of two arrays is n";
printUnion(arr1, arr2, m, n);
cout << "nIntersection of two arrays is n";
printIntersection(arr1, arr2, m, n);
return 0;
}
 
paps baka pwde din po paunlock nito
badly needed lang para matpos module
haha

https://www.Çℎḙḡḡ.com/homework-help...-design-loads-shown--assume-column--q82286968
 
Pa unlock din mga bossing, Salamat ng malaki


First: https://www.Çℎḙḡḡ.com/homework-help...ne-hardware-undertook-ambitious-pro-q83113746

Second: https://www.Çℎḙḡḡ.com/homework-help...rvices-organization-initiated-proje-q83106891

Third: https://www.Çℎḙḡḡ.com/homework-help...nization-approximately-5-000-employ-q83106980
 
Status
Not open for further replies.

About this Thread

  • 98
    Replies
  • 570
    Views
  • 22
    Participants
Last reply from:
Tateyek021

Trending Topics

Online now

Members online
1,116
Guests online
1,983
Total visitors
3,099

Forum statistics

Threads
2,316,380
Posts
29,186,380
Members
1,181,933
Latest member
Zephyr2029
Back
Top