Ejemplo n.º 1
0
void Pdb::WatchesMenu(Bar& bar)
{
	String exp = watches.GetKey();
	if(!IsNull(exp))
		exp = "(" + exp + ")";
	DataMenu(watches, bar, exp);
	bar.Separator();
	bar.Add(AK_ADDWATCH, THISBACK(AddWatch));
	bool b = watches.IsCursor();
	bar.Add(b, "Edit watch..", THISBACK(EditWatch));
	bar.Add(b, "Remove watch..", THISBACK(RemoveWatch));
	bar.Separator();
	watches.StdBar(bar);
}
Ejemplo n.º 2
0
void Pdb::AutosMenu(Bar& bar)
{
	DataMenu(autos, bar, autos.GetKey());
}
Ejemplo n.º 3
0
void Pdb::LocalsMenu(Bar& bar)
{
	DataMenu(locals, bar, locals.GetKey());
}
Ejemplo n.º 4
0
Archivo: main.c Proyecto: Qianfinland/C
void StudentRecord()
{
    int choice, i, j,studentID,finalScores[4], IDs[4], result;
    int data[4][5] = { 
        {1232, 10, 23, 45, 56},
        {2367, 45, 43, 24, 78},
        {3650, 34, 45, 40, 60},
        {4002, 67, 38, 65, 56}
    };
    for(i=0; i<4; i++)
    {
        finalScores[i]=data[i][4];
        IDs[i] = data[i][0];
    }
    //printf("Sort final score of all students\n");
    NumbersInAscending(finalScores,4);
    //printf("max final score %d\n", NumbersInAscending(finalScores,4));
    
    MenuForStudentRecord();
    printf("\nPlease enter your choice: ");
    scanf("%d", &choice);
    //printf("Your choice is :%d\n", choice);
    
    if(choice == 1)
    {
        DataMenu();
        for(i = 0; i < 4; i++)
        {
            for(j=0; j < 5; j++)
            {
                printf("|%d      ", data[i][j]);
            }
            printf("\n");
        }
        
    }
    else if(choice == 2)
    {
        printf("Please enter the student ID: ");
        scanf("%d", &studentID);
        //printf("studentId: %d\n", studentID);
        result = find_index(IDs, 4, studentID);
        if (result == -1)
        {
            printf("You entered value %d is not found in the studentIDs\n", studentID);
        }
        else
        {
            printf("The record of student whose studentID %d is: \n", studentID);
            DataMenu();
            for(i=0; i<4; i++)
            {
                if(data[i][0] == studentID)
                {
                    for(j=0; j<5;j++)
                    {
                        printf("|%d      ", data[i][j]);
                    }
                }
            }
        }
    }
    else if(choice == 3)
    {
        printf("The lowest final score is %d \n", finalScores[0]);
        printf("The lowest final score is %d \n", finalScores[3]);
    }
}