1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
kolbaska11 [484]
3 years ago
7

Create a class ""Student"" that will hold an array of grades and has a method to calculate the average. It would also have a met

hod to return any particular grade number (1-14).
Computers and Technology
1 answer:
morpeh [17]3 years ago
5 0

Answer:

#include <iostream>

#include<time.h>

using namespace std;

class Student

{

   public :

   int grades[20]; //array of grades

   

   double average(int arr[],int n) //method to calculate average of array of grades passed

   {

       int sum=0;

       for(int i=0;i<n;i++)  //loop to calculate sum of all grades

           sum=sum+arr[i];

       return sum/n;   //average is sum of items/number of items

   }

   int get_grade() //method to return grade number(1-14)

   {

       srand(time(NULL));  //method to generate different random number each time

       int num = rand() % 14 + 1;  //method to generate random number b/w 1-14

       return num;

   }

};

int main()

{

   Student s;

   int grade[]={5,3,9,8,10};

   cout<<"Average is : "<<s.average(grade,5);

   return 0;

}

OUTPUT :

Average is : 7

Explanation:

A class Student is created in which a method named average is there to calculate average of the grades passed and a method to generate a grade number b/w 1-14.

You might be interested in
Which pane is used to modify the actual content of the SmartArt graphics as opposed to the layout and design?
Zigmanuir [339]
Text i belive thats the answer
7 0
3 years ago
Universal Containers has a custom picklist filed with three values on their products. The Admin would like to create a Dynamic B
Agata [3.3K]

Answer:

The Admin should Create a rule with three conditions, each that compares the configuration attribute filed with a static value.

8 0
3 years ago
What is computer generation​
MA_775_DIABLO [31]

Answer:

Generation in computer terminology is a change in technology a computer is/was being used which includes hardware and software to make of an entire computer system .

8 0
2 years ago
Darla is going to start writing the HTML code for a web page. What would she
Stels [109]

Answer:

(C) Opening Tag

Explanation:

HTML code is contained in an opening and closing tag. To start writing code you need to first type in the opening tag.

7 0
3 years ago
Read 2 more answers
Question is in photo
Alisiya [41]
Is this java or python pls explain or else i can’t answer
3 0
3 years ago
Other questions:
  • Which syntax error in programming is unlikely to be highlighted by a compiler or an interpreter? a variable name misspelling a m
    6·2 answers
  • Write a program that reads an unspecified number of integers, determines how many positive and negative values have been read, a
    13·2 answers
  • Travis sends Suri what purports to be a link to an e-birthday card, but when she clicks on the link, software is downloaded to h
    11·1 answer
  • Which combination of factors would result in the lowest monthly mortgage payment?
    9·2 answers
  • To create nested lists within each of these topical areas that would contain links to specific pages on the AllStyles website. I
    15·1 answer
  • Which of the following is a feature that allows you to temporarily store text? A wordvault, B Clipboard,C Normal View, D typeove
    5·1 answer
  • You work part time at a computer repair store. You are in the process of building a new computer system. The customer wants a mo
    6·1 answer
  • PLEASE HELP! Please dont answer if your going to guess
    14·2 answers
  • A good look of a web page depends upon?​
    8·1 answer
  • A smart card is?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!