Program to calculate students marks, C/C++ Programming

#include
using namespace std;
void print(int marks_arr[],int cnt)
{
int ind[cnt];
int i=0;
int j=0;
int k=0;
int s=0;
for(k=0;k {
ind[k]=0;
}
int cnt1=0;
for(i=0;i {
ind[cnt1]=1;
for(j=i+1;j {
//cout< if((marks_arr[i]==marks_arr[j])&&(marks_arr[i]!=-1))
{
ind[cnt1]=ind[cnt1]+1;
marks_arr[j]=-1;
//if(marks_arr[j]==-1)
//{
//break;
//}

}
}
cnt1++;
}
for(s=0;s {
if(marks_arr[s]!=-1)
{
cout<<"\n"< }

}

}
int add()
{
int mark;
cout<<"Enter the mark:";
cin>> mark;
return mark;
}
float avg(int mark[],int c)
{
int i,sum=0;
float average;
for(i=0;i {
sum= sum+mark[i];
}
average=sum/c;
return average;
}

int marks_arr[100];
int main()
{
static int count=0;
//int marks_arr[100],
int choice,i,ch,searchelement,totalcount,total;
float val;

do
{
cout<<"\n 1. Add student marks";
cout<<"\n 2. Display student marks";
cout<<"\n 3. Find average of all marks";
cout<<"\n 4. Calculate the standard deviation";
cout<<"\n 5. Delete a student mark";
cout<<"\n 6. Search all marks ";
cout<<"\n 7. Print all marks";
cout<<"\nEnter choice : ";
cin>>choice;
switch(choice)
{
case 1:
{
marks_arr[count]=add();
count++;
break;
}
case 2:
{
for(i=0;i {
cout< }
break;
}

case 3:
{
val= avg(marks_arr,count);
cout<< "The avg of total marks is: "< break;
}
case 4:

case 5:


case 6:
{
cout<<"\n Enter the mark to search:";
cin>>searchelement;
totalcount=0;
for(i=0;i {
if(marks_arr[i]==searchelement)
{
totalcount=totalcount+1;
}
}
cout<<"No of times the element is present : "< break;
}
case 7:
{
print(marks_arr,count);
}
}
cout<<"\nContinue [0-yes / 1-no] :";
cin>>ch;
}while(ch!=1);
}

Posted Date: 3/16/2013 1:31:39 AM | Location : United States







Related Discussions:- Program to calculate students marks, Assignment Help, Ask Question on Program to calculate students marks, Get Answer, Expert's Help, Program to calculate students marks Discussions

Write discussion on Program to calculate students marks
Your posts are moderated
Related Questions
Step 1 Define the program headers and the variables      #include   #include   #include   #include void main()   {       char prompt;     float a,b,c,d,e;     floa

algorithm to prepare mark sheet of a student by inputing name,branchcode,semester,register no,5 marks of students and total mark of student

i need to do my home work

Explain the Bit Wise Operations? C language in particular was created to make it easier to write operating systems. The objective was to have a language that provided excellent

A string S is said to be "Super ASCII", if it contains the character frequency equal to their ascii values. String will contain only lower case alphabets (''a''-''z'') and the asci

Scrape a site and save as csv Project Description: I want a programmer to create scraping software. I'll want every page scraped of name, job title, company, and url. There a

Asks the user for an integer. if the number is less than 21, ask them for a number again; repeat this until you get a number bigger than 20. 20 is not an acceptable number. Once yo

Problem: (a) Distinguish between a class and an object. (b) Define instantiation. (c) What is the importance of the "this" variable in java. (d) What is encapsulation?

Program is to find the maximum from two numbers: Program is to find the maximum from two numbers entered by the user having pointer variable as parameter void main()   {

Destructor: The purpose of destructor is to free the memory when the compiler memory is reduced or not enough to execute certain program. Sometimes there may several objects op