What's new

Closed Sa mga expert sa programing jan?

Status
Not open for further replies.
Joined
Oct 4, 2016
Posts
53
Reaction
8
Points
87
Age
24
patulong po mga sir?

Mag iinput ng #sa Universal Set
Element of A
Element of B
Element of C

Kahit anong iinput jan then

Select Operations:
Intersection n
Union u
Set difference -

Example
Input Set Operations:ex. u
(Kapag Union ung mag papakita dapat is)

A u B = dito ung mga # na ininput
A u C=example {1235467}
C u B=

Then kapag
Input set Compliment: ex. b

B={.....}

For example jan sa given nung teacher ang compliment ng B is {2,3} lang kasi ang element ng B {1,4,5,6} complimenr means kung ano ung wala dun


kahit anung program language po yan. matulungan nyu po sana ako
 

Attachments

Maiging magpakita ka kung anu natapos o nagawa mo na code, kaysa himingi ng instant na sagot. besides take-home exam naman; should have done researching how to do it. Sa javascript around 20-30 lines of code lang para ma-accomplish yan. "Set theory" will be your keyword in researching.
 
Union and Intersection
https://www.YøùTùbé.com/ watch?v=xZELQc11ACY

Compliments
https://www.YøùTùbé.com/ watch?v=xJheQ_sZhMU

bibigay ko na sana ung sagot pero agree ako kay maskhäçk, try mo muna, you can do it OP
 
Last edited:
Maiging magpakita ka kung anu natapos o nagawa mo na code, kaysa himingi ng instant na sagot. besides take-home exam naman; should have done researching how to do it. Sa javascript around 20-30 lines of code lang para ma-accomplish yan. "Set theory" will be your keyword in researching.
using System;
using System.Linq;

using System.Collections.Generic;



public class Program
{


public static void Main()
{

Console.WriteLine("Start:");

HashSet<int> FirstDistinctSet = new HashSet<int>(){1,2,3,4,5,20,6,8,12,56};
HashSet<int> SecondDistinctSet = new HashSet<int>(){1,2,3,101,103,45,78,98,1001};
HashSet<int> IntersectFirstSecond = new HashSet<int>(FirstDistinctSet.Intersect(SecondDistinctSet));

List<int> ll= FirstDistinctSet.Union(SecondDistinctSet).ToList();


Console.WriteLine("Intersection:");
foreach (var s in IntersectFirstSecond)
{

Console.WriteLine("Element of intersection: {0}",s);

}

Console.WriteLine("");
Console.WriteLine("Union::");


foreach (var s in ll)
{

Console.WriteLine("Element of Union: {0}",s);

}


}
}

hindi po ako magaling sa programming. pero marunong po ako mag basa. natutunan ko po pag may code na ang gusto kasi ng prof namin sya yung mag input ng data sa set. tapos ang kunti ng oras na binigay nya.
 
Status
Not open for further replies.

Similar threads

Back
Top