🔒 Closed Sa mga expert sa programing jan?

Status
Not open for further replies.

network phantom

Journeyman
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

  • 5ED0000D-E5A8-4235-BDA7-20AE38ECE522.webp
    5ED0000D-E5A8-4235-BDA7-20AE38ECE522.webp
    85.9 KB · Views: 19
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.
 
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.

About this Thread

  • 3
    Replies
  • 468
    Views
  • 3
    Participants
Last reply from:
network phantom

Trending Topics

Online now

Members online
1,019
Guests online
1,444
Total visitors
2,463

Forum statistics

Threads
2,273,341
Posts
28,948,891
Members
1,235,707
Latest member
trisyanperez
Back
Top