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

Assignment Help:

#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);
}


Related Discussions:- Program to calculate students marks

Explain the pointer types, Pointer Types Pointer holds the address of a...

Pointer Types Pointer holds the address of an object, permitting for the indirect manipulation of that object. They are used in creating linked data structures like lists, tree

Sentence, Consider text comprised of sentences and sentences comprised of w...

Consider text comprised of sentences and sentences comprised of words. Words in a sentence will be space delimited. Given a text and K strings, task is to find out the number valid

Copy constructor and overloaded assignment operator, please provide me the ...

please provide me the assignment help. What is the difference between a copy constructor and an overloaded assignment operator?

#title., A student apears in exam of math, physics, and chemistry. Write a...

A student apears in exam of math, physics, and chemistry. Write a program to find the total marks aa student has aqueired find the average.

Develop opencv tracking, Help me evaluate suitable OpenCV filters to get an...

Help me evaluate suitable OpenCV filters to get an inital working tracking algorithm. In this case it's objects moving on water (sea) and since I have very limited OpenCV knowledge

Compiler designin liliting instruction, Ravi is a newbie to the programming...

Ravi is a newbie to the programming and while learning the programming language he came to know the following rules:

How do i develop a subscript operator for a matrix class?, Employ operator ...

Employ operator () instead of operator[]. While you have multiple subscripts, the cleanest way to do it is along with operator () instead of with operator[]. The reason is that

Text Editor, Add a function for saving the text stored in an array to a fil...

Add a function for saving the text stored in an array to a file. Your program must check whether or not the output file already exists, and if it does, your program must ask the us

Example of array, In this lab, please complete a given program to perform t...

In this lab, please complete a given program to perform the following tasks: 1. Allocate a 10 by 5 2D byte array dynamically. The way of allocation must be consistent with pag

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd