Program to calculate average of marks, C/C++ Programming

Assignment Help:

Program for calculate average of total marks:

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

float val;

do

{

cout<<"\n 1.Add marks";

cout<<"\n 2.Display marks";

cout<<"\n 3.Find average";

cout<<"\n 4. Search marks ";

cout<<"\n 5.Print";

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<

break;

}

case 4:

{

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 5:

{

print(marks_arr,count);

}

}

cout<<"\nContinue [0-yes / 1-no] :";

cin>>ch;

}while(ch!=1);

}

 

 


Related Discussions:- Program to calculate average of marks

Write a program that predicts users age, Write a program that predicts user...

Write a program that predicts users age: Write a program that predicts users' age (0-128 years old) with at most 7 questions. The game starts with asking the user whether he/s

Probabilistic hough transform, Two kinds of line detection are implemented ...

Two kinds of line detection are implemented in OpenCV, the Hough Transform and the probabilistic Hough transform. Assume that there are n feature points in an image and that it tak

Luminous Jewels - The Polishing Game, 1. Jewels can only be removed for pol...

1. Jewels can only be removed for polishing from either end of the necklace (i.e. head or tail) 2. Once a jewel type is removed from the necklace, all other instances of the same j

Program to creates a linked list of characters , Note: Please refer to the...

Note: Please refer to the Subject Outline for details regarding the assessment of the advanced assignment. The Problem You are to investigate the use of data structures an

Explain binary logical bit-wise operators, Binary logical bit-wise operator...

Binary logical bit-wise operators  There are three logical bit-wise operators :                   &             and                 |              or

Luminous Jewels - The Polishing Game, Byteland county is very famous for lu...

Byteland county is very famous for luminous jewels. Luminous jewels are used in making beautiful necklaces. A necklace consists of various luminous jewels of particular colour. Nec

Program to calculation of mortgage interest rates, This assignment builds o...

This assignment builds on Homework 3. The two major modifications are the instruction of pointers and the calculation of mortgage interest rates. Requirements for Project 2:

Program to sort a range of numbers with insertion, Program to sort a range ...

Program to sort a range of numbers with Insertion: /* define variable */ const int max=29000; int list[max]; FILE *fp; clock_t start,end; char any1[8];

Develop an e commerce site, We need an E Commerce site likefifacointrader. ...

We need an E Commerce site likefifacointrader. you must have experience with that kind of work You have to show a sample of work like that site. Skills required are C Prog

Can you overload a function depend only on whether parameter, Can you overl...

Can you overload a function depend only on whether a parameter is a value or a reference? A: No. Passing by value and reference looks identical to the caller.

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