I dont know what to do ADDING ELEMENT.first selection in the main menu....pls help me...

A cluster is defined as a collection of different elements. A and B, including two sets of integer elements that are required for a program to perform certain procedures on the sets. To do this, first run the program in a main menu displayed on the screen as follows:
MAIN MENU
1. Adding Element
2. Delete Element
3. Job Search
4. Staff Listing
5. Cluster Operations
6. Released
Please enter your selection:
User, [1-6] enters a value outside the range of selection should be asked again. The user enters the value 6, the program should be asked whether you sure you want to go, back to the main menu dönülmeli not sure, treat the orks grounds to believe the program. [1-5] enters a value from the user's request and instead be brought back to the main menu dönülmelidir.
Adding Elements: Adding user to the desired integer, and the cluster name (s) should be carried out and the insertion process.
Element Deletion: The user must be an integer, and set the desired deletion (s) performed deletion.
Job Search: The user is required there must be an integer, and clusters by performing the search process in which cluster (s) including found, or must be specified.
Staff Listing: Sets the number of elements and element should be listed in order from small to large.
Batch Processing: A and B for the implementation of operations on sets of some of the cluster before a sub-menu displayed on the screen as follows:
SUB-MENU SET OPERATIONS
1. Combination
2. Intersection
3. Difference
4. Symmetric Difference
5. Subset
6. Cartesian Product
7. Main Menu
Please enter your selection:
User, [1-7] enters a value outside the range of selection should be asked again. 7 the value of the user enters the main menu dönülmelidir. [1-6] enters a value in the range, instead of the user's request to be brought back to the sub-menu dönülmelidir and cluster operations.
Junction: the junction of two of the cluster by creating a set of elements and the number of elements should be listed in order from small to large.
Intersection: the intersection of two of the cluster by creating a set of elements and the number of elements should be listed in order from small to large.
Difference: The user name must be the difference and the difference in finding the desired cluster by creating a set of elements and the number of elements should be listed in order from small to large.
Symmetric difference: The two elements of the cluster by creating a set of symmetric difference and the number of elements should be listed in order from small to large.
Sub-Cluster: cluster between the two sub-cluster or co-cluster (a subset of the clusters is identical to each other) relationship should be investigated and the result.
Cartesian Product: cartesian product of two clusters by a set of ordered pairs (ordered pairs) should be listed.
Notes:
1. Transactions of the cluster during the full / empty of the existing element addition, deletion of non-element, etc. Messages must be given where appropriate.
2. Capacities of A and B sets can easily be set within the program code.
3. Cluster vectors elements are always kept in order (also applying to a sorting process), the element will getirilebilmesini search and replace operations to be faster cluster.
4. The main purpose of this assignment, one-dimensional array (vector) and vectors on the use of the data structure to strengthen the use of sorting and searching algorithms. As in the previous homework, and by fragmentation of the logical problem and the appropriate code in order to reuse parts, the creation of the necessary functions and is expected to be used.

Recommended Answers

All 2 Replies

Have'nt you done anything on your own..??
Post your Code here...

Have'nt you done anything on your own..??
Post your Code here...

I am just trying to do the 1st part in the main menu...
I must enter one element into a set that i've just chosen.then i must ask for another element. if i(user) say no('n'||'N'), i must go back to the main menu...

#include <stdio.h>
#include <stdlib.h>
#define SIZE_A 40
#define SIZE_B 40
void mainmenu();
int addElemet(int [],int []);
int main()
{
    int A[SIZE_A],B[SIZE_B];
    int choice1;
    mainmenu();
    scanf("%d",&choice1);
    switch(choice1)
    {
    case 1:
        addElement(A,B);
    }
    return 0;
}
void mainmenu()
{
    printf("MAIN MENU\n");
    printf("1.Add Element\n");
    printf("2.Delete Element\n");
    printf("3.Search Element\n");
    printf("4.List the Elements\n");
    printf("5.Set Processes\n");
    printf("Make a Choice :");
    printf("\n");
}
int addElement(int A[],int B[])
{
    static int i,static int n;
    int j,m;
    int newElemant;
    char addDecision,set;

    while((addDecision!='N')||(addDecision!='n'))
    {
        printf("Which set would you want to add element ? ");
        fflush(stdin);
        scanf("%c",&set);
        switch(set)
        {
        case 'A':
        case 'a':
            printf("Enter the value of the element you want to add :");
            scanf("%d",&newElemant);
            printf("\nA:\n");
            for(j=0; j<i; j++)
            {
                printf("%d ",A[j]);
            }
            printf("Do you want to add more elements ? ");
            fflush(stdin);
            scanf("%c",&addDecision);
            return A;

        case 'B':
        case 'b':
            printf("Enter the value of the element you want to add :");
            scanf("%d",&newElemant);
            printf("\nB:\n");
            for(m=0;m<n;m++)
            {
                printf("%d ",B[m]);
            }
            printf("Do you want to add more elements ? ");
            fflush(stdin);
            scanf("%c",&addDecision);
            return B;
        }
    }

}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.