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

1 (Title) : DSA Practice Report

The document is a student's programming practice report. It includes the student's name, ID, and practice number. The report outlines the steps taken to solve the problem, presents the results, and includes the full source code. The student explained their process of determining student types, inputting data, calculating totals and ranks. They provided the C code for defining student structures, input/output functions, and the main program. The student summarized that it was a good learning experience and they are working hard to fully understand programming.

Uploaded by

hashir mahboob
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

1 (Title) : DSA Practice Report

The document is a student's programming practice report. It includes the student's name, ID, and practice number. The report outlines the steps taken to solve the problem, presents the results, and includes the full source code. The student explained their process of determining student types, inputting data, calculating totals and ranks. They provided the C code for defining student structures, input/output functions, and the main program. The student summarized that it was a good learning experience and they are working hard to fully understand programming.

Uploaded by

hashir mahboob
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

DSA Practice Report

StudentID 16511510010

Student Name DENNIS SAHR YAMBA

Practice No. 1

Practice Title

Date

Place

Mark

Checked by Wingo WU

1 [Title]

1.1 Procedure

Explain your steps to solve the problem. It maybe very simple or maybe very detail

First I have to determine the student type

typedef struct student


second I have to know how many student is them and the subjects
char name[50];
int ID;
int chinese;
int maths;
int physics;
int ranck;
int total
1.2 Results

Explain your results of the program with screen shot

1.3 Source code

Copy your full source code, do not miss anything. don’t do any change.Your program
should begin with the following information

#include "stdafx.h"
#include <stdio.h>
typedef struct student
{
char name[50];
int ID;
int chinese;
int maths;
int physics;
int ranck;
int total;

} STUD;

void Output_stud(STUD std[20],int n)


{
int i;
for (i=0;i<n;i++)
{

printf("%-10d\t%-10s\t %d \t %d \t %d\t%d\t
%d\n",std[i].ID,std[i].name,std[i].chinese,std[i].maths,std[i].physics,std[i].t
otal,std[i].ranck);
}
}
void Input_stud(STUD std[20],int n)
{
int i;
for(i=0;i<n;i++)
for(i=0;i<n;i++) {

printf("ID:");
scanf("%d",&std[i].ID);

printf("Name:");
scanf("%s",std[i].name);

printf("Chinese:");

scanf("%d",&std[i].chinese);

printf("Maths:");

scanf("%d",&std[i].maths);

printf("Physics:");

scanf("%d",&std[i].physics);

}
void Total_stud(STUD std[20],int n)
{
int i;

for (i=0;i<n;i++)
{
std[i].total= std[i].chinese+std[i].maths+std[i].physics;
}

void Rank_stud(STUD std[20],int n)


{
int j,k,i;

for(j=0;j<n;j++)
{
k = 1;
for(i=0;i<n;i++){
if (std[j].total < std[i].total)
k++;
}
std[j].ranck = k;

int main()
{

STUD std[20];
int i,n;

printf("******************************************************************\n");

printf("Practice 1 YAMBA Communication Engineering\n");

printf("******************************************************************\n");

printf("Enter how many students: ");

scanf("%d",&n);

Input_stud(std,n);

Total_stud(std,n);
Rank_stud(std,n);

printf("*********************************************************************\n
");

printf("StudentID\tName\t\tChinese\tMaths\tPhysics\tTotal\tRank\n");

Output_stud(std,n);

getchar();
getchar();

return 0;
}

int _tmain(int argc, _TCHAR* argv[])


{
return 0;
}

/*

Program for Practice 1. Refresh on C Programming

By Your name , your Student ID, major

*/

1.4 Summary

explain your experience. talk about what you have learnt.


It’s a great experience but it actually not easy to learn programming but am working
hard to be the best,I might be slow to submit my assignment because I want to learn it
more and make sure I understand very well.

You might also like