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
Lorico [155]
3 years ago
7

Write a program that accepts any number of homework scores ranging in value from 0 through 10. Prompt the user for a new value i

f they enter an alphabetic character. Store the values in array. Calculate the average excluding the lowest and highest scores. Display the average as well as the highest and lowest score that were discarded.
Computers and Technology
1 answer:
vazorg [7]3 years ago
8 0

Answer:

This program is written in C++

Note that the average is calculated without the highest and the least value.

Comments are used for explanatory purpose

See attachment for .cpp file.

Program starts here

#include<iostream>

using namespace std;

int main()

{

int num;

cout<<"Enter Number of Test [0-10]: ";

//cin>>num;

while(!(cin>>num) || num > 10|| num<0)

{

cout << "That was invalid. Enter a valid digit: "<<endl;

cin.clear(); // reset the failed input

cin.ignore(123,'\n');//Discard previous input

}

//Declare scores

int scores[num];

//Accept Input

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

{

cout<<"Enter Test Score "<<(i+1)<<": ";

cin>>scores[i];

}

           //Determine highest

           int max = scores[0];

           for (int i = 1; i < num; i++)

           {

               if (scores[i] > max)

               {

                   max = scores[i];

               }

           }

           //Determine Lowest

           int least = scores[0];

           for (int i = 1; i < num; i++)

           {

               if (scores[i] < least)

               {

                   least = scores[i];

               }

           }

           int sum = 0;

           //Calculate total

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

           {

               sum += scores[i];

           }

           //Subtract highest and least values

           sum = sum - least - max;

           //Calculate average

           double average = sum / (num - 2);

           //Print Average

           cout<<"Average = "<<average<<endl;

           //Print Highest

           cout<<"Highest = "<<max<<endl;

           //Print Lowest

           cout<<"Lowest = "<<least;

return 0;  

}

Download cpp
You might be interested in
All of the following are methods of communication
NNADVOKAT [17]

Answer:

Extremal hard drive is not form of communication.

3 0
3 years ago
Read 2 more answers
_____ is a predefined format used for text the can include multiple font formatting features
seraphim [82]
The correct answer is



style
8 0
3 years ago
'|'/2`/ '|'[] |)[-([]|)[- '|'#!$
natita [175]

Answer: mr Man

Explanation:

7 0
3 years ago
This is the formula for the future worth of an investment over time with consistent additional monthly payments and a steady rat
stepladder [879]

Answer:

The code is given in C++ below

Explanation:

#include <iostream>

using namespace std;

int main()

{

float fv,pv,r,k,n,pmt,totalmoneyinvested;

pv=1000.00;

r=6/100;

k=12; //The value of k should be 12 for monthly installments

n=45;

pmt=250;

totalmoneyinvested=pv+(pmt*12*45); //The total money you invested

 

fv=pv*(1+r/k)*n*k+pmt*((1+r/k)*n*k-1)*(1+r/k)*r/k;

 

cout<<"Initial Investment:"<<" $"<<pv;

cout<<"\nRate Of Return:6%";

cout<<"\nLength of Time:"<<n<<"year";

cout<<"\nMonthly Payment:"<<" $"<<pmt;

cout<<"\nFinal Amount:"<<" $"<<fv;

cout<<"\nThe Money You Invested Is $"<<totalmoneyinvested<<" And The Final Amount Is $"<<fv;

return 0;

}

4 0
3 years ago
A software-based _________ is dedicated to examining and blocking internet traffic.
igomit [66]

A software-based <u>Firewall</u> is dedicated to examining and blocking internet traffic.

7 0
3 years ago
Read 2 more answers
Other questions:
  • HELP ME RIGHT NOW !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    8·1 answer
  • What does in-private or incognito browsing do?
    5·1 answer
  • Which of these jobs would be most appropriate for someone who majors in computer engineering? I need the answer ASAP Helping com
    14·2 answers
  • Sara has a habit of stealing money from her brother Charlie. When he found out, Charlie rebuked Sara in the presence of his frie
    11·1 answer
  • Write a script which: Uses the input function to get any number and store it in a variable named my_number Create a new variable
    8·1 answer
  • Which is a characteristic of an effective problem statement? It is based on research. It contains outside information. It contai
    12·1 answer
  • Know when the double, int, String, and char data types are best used. Example: I would store a social security number in a strin
    7·1 answer
  • A computer (mainframe, server, or workstation) that has an operating system enabling _____________ to access it at the same time
    11·1 answer
  • List any three importance of computer points​
    8·1 answer
  • Who is tim berners-lee
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!