Computer Science 1 (Help and explain it)
Goal: Calculate the class average for each class and also determine which class has the highest class average.
Create a 2 dimension array 6x30 that represents 6 classes of 30 students each. In the exercise, each of our classes is full and has 30 students.
Fill the array with random numbers in the range of 55- 100
Use embedded for loops so you can determine the class with the highest class average of all the 6 classes
Display each class’s average and then also remind us what the highest average is.
//C++ program
#include<iostream>
#include<stdlib.h>
#include<time.h>
using namespace std;
int randomNumber(int min , int max){
return min + rand()%(max - min + 1);
}
int main(){
int numberOfClasses = 6;
int numberOfStudents = 30;
int score[numberOfClasses][numberOfStudents];
double sum,highest=0,average;
srand(time(NULL));
for(int i=0;i<numberOfClasses;i++){
for(int
j=0;j<numberOfStudents;j++){
score[i][j] =
randomNumber(55 , 100);
}
}
for(int i=0;i<numberOfClasses;i++){
sum = 0;
for(int
j=0;j<numberOfStudents;j++){
sum = sum +
score[i][j] ;
}
average =
sum/numberOfStudents;
cout<<"Average of
class-"<<(i+1)<<" : "<<average<<endl;
if(average>highest)highest =
average;
}
cout<<"\nHighest Average is :
"<<highest<<endl;
return 0;
}
//sample output

Computer Science 1 (Help and explain it) Goal: Calculate the class average for each class and...
I was looking for help with a computer science c programming class. not c++ This program will have menu system. The menu will at least have the following options: *********************************************************** ** MAIN MENU ** *********************************************************** Enter Votes from a state for Donald Trump Choose State Enter Number of Votes Enter Votes from a state for Joe Biden Choose State Enter Number of Votes Display total votes for each candidate List the state name(s) where candidate tied For...
Hi I really need help with the methods for this lab for a computer science class. Thanks Main (WordTester - the application) is complete and only requires uncommenting to test the Word and Words classes as they are completed. The needed imports, class headings, method headings, and block comments are provided for the remaining classes. Javadocs are also provided for the Word and Words classes. Word The Word class represents a single word. It is immutable. You have been provided...
Hello! I desperately need help with this project for my computer science class c++. Please let me know if any clarification or additional information is needed. Compliance with the outlined project requirements is crucial. Thank you!!! and I'll rate you up too thank you! 1) Program must implement a minimum of 3 classes (which we will learn about in Ch.13). 2) You should make use of plenty of the concepts that we have learned or are learning in class (for...
COSC 1437 C++2 Project Assignment 3 Description: Computer Science Department is evaluating its professors to see which professor has the highest rating according to student input. You will create a ProfessorRating class consisting of professor Name and three ratings. The three ratings are used to evaluate easiness, helpfulness, and clarity. The value for each rating is in the range of 1 to 5, with 1 being the lowest and 5 being the highest. Your program should contain the following functionalities:...
Question First, you need to design, code in Java, test and document a base class, Student. The Student class will have the following information, and all of these should be defined as Private: A. Title of the student (eg Mr, Miss, Ms, Mrs etc) B. A first name (given name) C. A last name (family name/surname) D. Student number (ID) – an integer number (of type long) E. A date of birth (in day/month/year format – three ints) - (Do NOT use the Date class from...
In Exercises 1 and 2, use the data set, which represents the overall average class sizes for 20 national universities. (Adapted from Public University Honors) 37 34 42 44 39 40 41 51 49 31 55 26 31 40 30 27 36 43 49 35 1. Construct a frequency distribution for the data set using five classes. Include class limits, midpoints, boundaries, frequencies, relative frequencies, and cumulative frequencies. 2. Construct a relative frequency histogram using the frequency distribution in Exercise...
Computer Science - Java
Explain the code step by step (in detailed order). Also explain
what the program required. Thanks
7 import java.io.File; 8 import java.util.Scanner; 9 import java.util.Arrays; 10 import java.io.FileNotFoundException; 12 public class insertionSort 13 14 public static void insertionSort (double array]) 15 int n -array.length; for (int j-1; j < n; j++) 17 18 19 20 21 double key - array[j]; int i-_1 while ( (i > -1) && ( array [i] > key array [i+1] -...
CIS 22A C++ Project Exam Statistics Here is what your program will do: first it welcomes the user and displays the purpose of the program. It then prompts the user to enter the name of an input file (such as scores.txt). Assume the file contains the scores of the final exams; each score is preceded by a 5 characters student id. Create the input file: copy and paste the following data into a new text file named scores.txt DH232 89...
Consider the following program that reads students’ test scores into an array and prints the contents of the array. You will add more functions to the program. The instructions are given below.For each of the following exercises, write a function and make the appropriate function call in main.Comments are to be added in the program. 1. Write a void function to find the average test score for each student and store in an array studentAvgs. void AverageScores( const int scores[][MAX_TESTS], int...
Consider the following program that reads students’ test scores into an array and prints the contents of the array. You will add more functions to the program. The instructions are given below. For each of the following exercises, write a function and make the appropriate function call in main.Comments are to be added in the program. 1. Write a void function to find the average test score for each student and store in an array studentAvgs. void AverageScores( const int scores[][MAX_TESTS], int...