0% found this document useful (0 votes)
3 views

c Program Assignmnt 1

The document is an assignment from the Dar es Salaam Institute of Technology for a Computer Programming and Data Structure course. It includes a C program that collects and calculates student grades based on various assessments and outputs the results. The assignment lists group members and their registration numbers.

Uploaded by

silasfredrick23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

c Program Assignmnt 1

The document is an assignment from the Dar es Salaam Institute of Technology for a Computer Programming and Data Structure course. It includes a C program that collects and calculates student grades based on various assessments and outputs the results. The assignment lists group members and their registration numbers.

Uploaded by

silasfredrick23
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

DAR ES SALAAM INSTITUTE OF TECHNOLOGY

(DIT)

NAME; COMPUTER PROGRAMMING AND DATA STRUCTURE

CODE; CSET 06201

ASSIGNMENT; 1

CLASS: OD22 MNE.

GROUP MEMBERS

NAMES REGISTRATION NUMBER

SILAS FREDRICK MGOMBELE 2101206215893

CYNTHIA WAYUA AMANI 220126435964

LEONARD MANG’ERA KERARYO 220126353595

LULU EBAN MWAKIPESILE 220126323598

SAUMU ADINANI 210110621278

LINA AUGUSTO 200120617622

1
#include <stdio.h>

main()

int i, sno[30];

char reg[30][15], grade[30][5];

float grp1[30],test1[30],grp2[30],test2[30],fe[30],total[30];

for (int i = 0; i < 1; i++)

printf("\nEnter details for student %d:\n", i + 1);

printf("Reg. Number: ");

scanf("%s", reg[i]);

printf("Grp Assnt 1 (5): ");

scanf("%f", &grp1[i]);

printf("Test 1 (15): ");

scanf("%f", &test1[i]);

printf("Grp Assnt 2 (5): ");

scanf("%f", &grp2[i]);

printf("Test 2 (15): ");

scanf("%f", &test2[i]);

printf("FE (60): ");

scanf("%f", &fe[i]);

total[i] = grp1[i] + test1[i] + grp2[i] + test2[i] + fe[i];

if (total[i] >= 75 && total[i]<= 100)

strcpy(grade[i], "A");

2
else if (total[i] >= 65 && total[i]<= 74)

strcpy(grade[i], "B+");

else if (total[i] >= 55 && total[i]<= 64)

strcpy(grade[i], "B");

else if (total[i] >= 45 && total[i]<= 54)

strcpy(grade[i], "C");

else if (total[i] >= 35 && total[i]<= 44)

strcpy(grade[i], "D");

else

strcpy(grade[i], "F");

printf("\n\ns/no|reg|grp1|test1|grp2 |test2 |fe |total |grade\n");

for (i = 0; i < 1; i++)

printf("%d %s %1.1f %1.1f %1.1f %1.1f %1.1f %1.1f %s\n", i + 1, reg[i], grp1[i], test1[i], grp2[i],
test2[i], fe[i], total[i], grade[i]);

return 0;

You might also like