I need help analyzing Netflix data, using global variables. I need to store the number of ratings and the sum of ratings in arrays. I need to write a function that that will give the average ratings for the movies.
1
Expert's answer
2012-12-07T04:12:30-0500
#include <conio.h> #include <iostream>
using namespace std;
int numberofratings[100]; int number=0; double averageratings (){ double sum=0;
for(int i=0;i<number;i++){ sum+=numberofratings[i]; } return sum/number; } int main() {
cout<<"Enter number of ratings: "; cin>>number;
for(int i=0;i<number;i++){ cout<<"Enter value of rating "<<(i+1)<<": "; cin>>numberofratings[i]; }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment