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
yarga [219]
3 years ago
5

Modify your "Star Search" program to read 100 scores from a text file, then execute the "Star Search" algorithm (drop the lowest

and highest scores, then average the rest) and display the result, with three digits after the decimal point. As per the Star Search specifications, only scores from 0 - 10 will be accepted. Any score that is outside that range is to be rejected, and is not included in the average. That means that invalid scores can't be the high or low scores either. For example (using 10 scores): if the list is 6.1 -5.1 2.0 3.5 5.8 2.0 12.9 5.0 9.9 10.0 The -5.1 and 12.9 are rejected as invalid (not in the range 0-10). 2.0 and 10.0 are the low and high scores to be dropped. The remaining SIX scores are averaged. If you wish to use this data for testing, the answer is 5.383
Computers and Technology
1 answer:
NemiM [27]3 years ago
3 0

Answer:

See explaination

Explanation:

#include <fstream>

#include <iostream>

#include <iomanip>

#include <cstring>

#include <cstdlib>

#include <ctime>

#include <vector>

using namespace std;

void getJudgeData(double &score);

double calcScore(double scores[]);

int findLowest(double scores[]);

int findHighest(double scores[]);

int main() {

const int COL=5;

int row;

double score;

cout<<"How many students data you want to enter ? ";

cin>>row;

// Creating 2-D array Dynamically

double** scores = new double*[row];

for (int i = 0; i < row; ++i)

scores[i] = new double[COL];

for(int i=0;i<row;i++)

{

cout<<"\nPerformer#"<<(i+1)<<":"<<endl;

for(int j=0;j<COL;j++)

{

cout<<"Enter Score given by judge#"<<(j+1)<<":";

getJudgeData(scores[i][j]);

}

}

for(int i=0;i<row;i++)

{

cout<<"Performer#"<<(i+1)<<" score :"<<calcScore(scores[i])<<endl;

}

return 0;

}

void getJudgeData(double &score)

{

while(true)

{

cin>>score;

if(score<0 || score>10)

{

cout<<"Invalid.Must be between 0-10"<<endl;

cout<<"re-enter :";

}

else

{

break;

}

}

}

double calcScore(double scores[])

{

double sum=0;

int min= findLowest(scores);

int max= findHighest(scores);

for(int i=0;i<5;i++)

{

if(i!=min && i!=max)

{

sum+=scores[i];

}

}

return sum/3;

}

int findLowest(double scores[])

{

double min=scores[0];

int minIndex=0;

for(int i=0;i<5;i++)

{

if(min>scores[i])

{

min=scores[i];

minIndex=i;

}

}

return minIndex;

}

int findHighest(double scores[])

{

double max=scores[0];

int maxIndex=0;

for(int i=0;i<5;i++)

{

if(max<scores[i])

{

max=scores[i];

maxIndex=i;

}

}

return maxIndex;

}

You might be interested in
Jenny needs to record the names of 30 students, write down the subjects they studied, and note their grades in each subject afte
SCORPION-xisa [38]

Changing a worksheet name in Microsoft Excel can be done in multiple ways, but only one of them is correctly explained in the provided option, which is (A) double-click both the worksheet tabs one at a time and then enter the new names.

The other options are incorrect. Even though you can change a worksheet’s name by right-clicking the sheet name, you also need to choose the appropriate option from the window bar that would appear – which is, of course, the rename option.

5 0
3 years ago
Read 2 more answers
What symbol is used for an assignment statement in a flowchart?
Annette [7]

Answer:

processing

Explanation:

The flow chart is a diagram that shows the activity of the program, peoples or things.

Flowchart symbol and meaning in the options:

1. Processing: it is a rectangular shape block which is used for variable declaration or assignment.

2. I/0: it is a parallelogram in shape which is used for input or output.

3. Parallelogram: it is used for input or output.

4. diamond: it is used for decisions or conditions.

Therefore, the correct option is a. Processing is the one that is used for the assignment statement.

3 0
4 years ago
Get ready to be the Quizmaster! You are going to design your own Python game show in the style of a quiz.
marin [14]

Answer:

"Are apples Magenta?"\n(a) yes\n(b) sometimes\n (c) no\n\n",

"Are apples Teal?"\n(a) yes\n(b) sometimes\n (c) no\n\n",

"Are apples Gray?"\n(a) yes\n(b) sometimes\n (c) no\n\n",

"Are apples Green?"\n(a) yes\n(b) sometimes\n (c) no\n\n",

"Are apples Cyan?"\n(a) yes\n(b) sometimes\n (c) no\n\n",

]

Questions(Question prompts[0], "a")

Questions(Question prompts[1], "c")

Questions(Question prompts[2], "c")

Questions(Question prompts[3], "c")

Questions(Question prompts[4], "c")

Questions(Question prompts[5], "b")

Questions(Question prompts[6], "c")

Questions(Question prompts[7], "c")

Questions(Question prompts[8], "a")

Questions(Question prompts[9], "c")

Explanation:

6 0
2 years ago
To view the Picture tools tab, a user must first _____.
Amiraneli [1.4K]
Answer: A select the picture
8 0
3 years ago
Read 2 more answers
Nosql is a great technology for storing well-structured data. <br> a. True <br> b. False
mash [69]
I'd say False

NoSQL or the non-rational databases are document oriented and distributed. Unlike the SQL or the relational databases which are structured, NoSQL deals with a huge amount of unstructured data and offer greater flexibility. NoSQL are more like file folders, gathering related information of all types.



3 0
3 years ago
Other questions:
  • Which is the most visual social media site?
    6·1 answer
  • What is the difference between chrome and chromium browser?
    9·1 answer
  • Christine wants to send a quick communication to all department managers. She should send a _____. report
    13·2 answers
  • ethics and internal control are important applications in accounting . Provide FIVE code of ethics and five internal control mea
    14·1 answer
  • The following types of websites are
    10·1 answer
  • @anthonydboss23<br><br> it’s goldielove6 <br><br> .....this is not a question everyone ignore this
    11·2 answers
  • Write a generator function named count_seq that doesn't take any parameters and generates a sequence that starts like this: 2, 1
    7·1 answer
  • Select the layer of the OSI model that is responsible for reformatting, compressing, and/or encrypting data in a way that the ap
    14·1 answer
  • What are five don’ts of using a computer
    8·2 answers
  • Rather than entering an IP address into our browser, we use a text-based address known as a(n
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!