write a program that calculates the average of a group of 5 testscores, where the lowest score in the group is dropped. it shoulduse the following functionsa. void getscore() should ask the use for the test score, store itin a reference parameter variable and validate it. this functionshould be called by main once for each ofthe five score to be entered.

Answers

Answer 1
Answer:

C++ program for calculating the average of scores

#include <iostream>

using namespace std;

const int n=5;//As per question only 5 test scores were there

int numbers[5];

void getscore(int i)//defining function for taking input

{

cin >> numbers[i];

while(numbers[i]<0 || numbers[i]>100)//score should be between 0 to 100

{

cout<<"\nThe number should be between 0 to 100\n";

cin>>numbers[i];

}

}

int main()//driver function

{

cout << "Enter 5 scores:\n";

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

{

getscore (i);//calling function each time for input

}

int s = 101;

double avg = 0;

for (int i = 0; i < n; i++)//loop for finding the smallest

{

s = numbers[i] < s ? numbers[i] : s;

}

for (int i = 0; i < n; i++) //loop for finding the Average

{

avg += numbers[i];

}

avg -= s;

avg /= 4;

cout << "Average of the four scores are: " << avg<< endl;//printing the output

return 0;

}

Output

Enter 5 scores:

4

5

6

7

8

Average of the four scores are: 6.5


Related Questions

What game is this? help mee?
To return the value of the cell D8, the formula should be OFFSETA1=________.
What is the most important trait of the first pilot project in the AI Transformation Playbook?
Write a program that accepts a four digit number, such as 1998, and displays it on number on a line, like: 1 9 9 8 The program should prompt for a four digit number. The program assumes that the user enters the correct information. Provide the java code, including a comment with your name, course code and date.
Is the willingness to put a customer’s needs above ones own needs and to go beyond a job description to achieve customer satisfaction

Consider a demand-paging system in which processes are performing sequential data accesses with the following time-measured utilizations: CPU utilization 20%
Paging disk 98%
Other I/O devices 10%

For each of the following, indicate yes or no to say whether or not it will (or is likely to) improve CPU utilization:

a. Install a faster CPU
b. Install a bigger paging disk
c. Increase the degree of multiprogramming
d. Decrease the degree of multiprogramming
e. Install more main memory
f. Install a faster hard disk
g. Increase the page size

Answers

Answer:

a. Install a faster CPU - No

b. Install a bigger paging disk - No

c. Increase the degree of multiprogramming - No

d. Decrease the degree of multiprogramming - Yes

e. Install more main memory - Yes

f. Install a faster hard disk - Yes

g. Increase the page size - Yes

Explanation:

a. Install a faster CPU No.

Installing a faster CPU will not improve CPU utilization too much because the CPU utilization is low (20%) and the utilization of the paging disk is very high (98%), we can see that the system has lack of free memory.

b. Install a bigger paging disk No.

Installing a bigger paging disk doesn't improve the CPU utilization because the system has lack of free memory.

c. Increase the degree of multiprogramming No.

If the level of multiprogramming is increased more processes would have to be swapped in and out of the memory with a higher chance of page fault much frequently and the CPU utilization would reduce.

d. Decrease the degree of multiprogramming Yes.

If the level of multiprogramming is reduced less processes would have to be swapped in and out of memory, reducing the chance of page fault and the CPU utilization would improve.

e. Install more main memory

This is likely to improve CPU utilization as more pages can remain resident and not require paging to or from the disks.

f. Install a faster hard disk

With a faster hard disk, the CPU will get more data more quickly and this will lead to faster response and more throughput to the disks. With a faster hard disk, the disk is not a bottleneck to utilization.

g. Increase the page size

Increase the page size will likely degrade the performance, because the internal fragmentation will be worse, the utilization of main memory will be low, more processes will not be able to fit into main memory, and the system will have to spend more time in swapping. So this is as likely to decrease utilization as it is to increase it.

98 POINTS HELP ASAP PLEASE!!!!You have been asked to create a program for an online store that sells their items in bundles of five. Select the appropriate code that would display how many bundles are available for sale.

A.print(5 // totalItems)
B.print(totalItems // 5)
C.print(totalItems(5) )
D.print(5(totalitems) )

Answers

B. Print(totalitems // 5)

Answer:

B. Print Totalltems // 5

Explanation:

Well, if you learn how to create bundles on Amazon, you can eliminate the competition, set your price, and offer customers a product they’ll absolutely love.

What are the things that a computer literate understands?Name thems.​

Answers

Answer:

•Determine your IP address.

•Verify physical connectivity to the network.

•Check that you have a logical connection to the network.

•Find out what path network traffic takes to get to its destination.

Translate from DNS names to IP addresses.

Write a program to read a list of exam scores given as integer percentages in the range 0-100. Display the total number of grades in each letter grade defined as follows:90-100 is an A, 80-89 is a B, 70-79 is a C, 60-69 is a D, 0-59 is an F. Use a negative score as a sentinel to indicate the end of the input. (The negative value is used just to end the loop, do not use it in the calculations). Then output the highest and lowest score, and the average score.For example if the input is: 72 98 87 50 70 86 85 78 73 72 72 66 63 85 -1the output would be:Total number of grades = 14Number of As =1Number of Bs = 4Number of Cs = 6Number of Ds = 2Number of Fs = 1The highest score is 98The lowest score is 50The average is 75.5This is what I have so far and it is not working correctly:public static void main(String[] args) {// scannerScanner scnr =new Scanner (System.in);//ints grades and countint x;int A = 0;int B = 0;int C = 0;int D = 0;int F = 0;int count = 1;//int min max totalint min, max;int total = 0 ;//doubledouble average;//prompt user for inputSystem.out.print("Please enter the exam scores as integer ");System.out.print("percentages in the rage 0-100. ");System.out.println("Please end the list with a negative integer.");//scnrx = scnr.nextInt();min = x;max = x;//while loopwhile (x >= 0){x = scnr.nextInt();if (x >= 0){total = total + x;count++;if (x < min)min = x;if (x > min)max = x; }while (x >= 90 && x <= 100) {x = scnr.nextInt();A++;//Grade Bif (x >= 80 && x <= 89)B++;//Grade Cif (x >= 70 && x <= 79)C++;//Grade Dif (x >= 60 && x <= 69)D++;//Grade Fif (x >= 0 && x <= 59)F++;}}// averageaverage = total/count;//results/outputSystem.out.println("Total number of grades: " + count);System.out.println("Number of A's: " + A);System.out.println("Number of B's: " + B);System.out.println("Number of C's: " + C);System.out.println("Number of D's: " + D);System.out.println("Number of F's: " + F);System.out.println("Highest score: " + max);System.out.println("Lowest score: " + min);System.out.println("Average: " + average);}}

Answers

system out print , 100-5292

This program outputs a downwards facing arrow composed of a rectangle and a right triangle. The arrow dimensions are defined by user specified arrow base height, arrow base width, and arrow head width.(1) Modify the given program to use a loop to output an arrow base of height arrowBaseHeight. (1 pt)
(2) Modify the given program to use a loop to output an arrow base of width arrowBaseWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow base. (1 pt)
(3) Modify the given program to use a loop to output an arrow head of width arrowHeadWidth. Use a nested loop in which the inner loop draws the *’s, and the outer loop iterates a number of times equal to the height of the arrow head. (2 pts)
(4) Modify the given program to only accept an arrow head width that is larger than the arrow base width. Use a loop to continue prompting the user for an arrow head width until the value is larger than the arrow base width. (1 pt)
while (arrowHeadWidth <= arrowBaseWidth) {
// Prompt user for a valid arrow head value
}
Example output for arrowBaseHeight = 5, arrowBaseWidth = 2, and arrowHeadWidth = 4:
Enter arrow base height:
5
Enter arrow base width:
2
Enter arrow head width:
4

**
**
**
**
**
****
***
**
*
This is what I have:
import java.util.Scanner;
public class DrawHalfArrow
{
public static void main(String[] args)
{
Scanner scnr = new Scanner(System.in);
int arrowBaseHeight = 0;
int arrowBaseWidth = 0;
int arrowHeadWidth = 0;
System.out.println("Enter arrow base height:");
arrowBaseHeight = scnr.nextInt();
System.out.println("Enter arrow base width:");
arrowBaseWidth = scnr.nextInt();
while (arrowHeadWidth >= arrowBaseWidth)
{
System.out.println("Enter arrow head width:");
arrowHeadWidth = scnr.nextInt();
}
// Draw arrow base (height = 3, width = 2)
for(int i=0; i < arrowBaseHeight; ++i)
{
for(int j=0; j < arrowBaseWidth; ++j)
{
System.out.print("*");
}
System.out.println();
}
// Draw arrow head (width = 4)
for(int i=0; i < arrowHeadWidth; ++i)
{
for(int j=0; j < arrowHeadWidth-i; ++j)
{
System.out.print("*");
}
System.out.println();
}
return;
}
}

Answers

Answer:

The modified program in Java is as follows:

import java.util.*;

public class Main{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

 int arrowHeadWidth, arrowBaseWidth, arrowBaseHeight;

 System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();

 System.out.print("Base Height: "); arrowBaseHeight = input.nextInt();

 while (arrowHeadWidth <= arrowBaseWidth) {

       System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();      }

 for(int i = 0; i<arrowBaseHeight; i++){

     for(int j = 0; j<arrowBaseWidth;j++){

         System.out.print("*");        }

         System.out.println();    }

 for(int i = arrowHeadWidth; i>0;i--){

     for(int j = 0; j<i;j++){

         System.out.print("*");        }

         System.out.println();    }

}

}

Explanation:

This declares the arrow dimensions

 int arrowHeadWidth, arrowBaseWidth, arrowBaseHeight;

This get input for the head width

 System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

This get input for the base width

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();

This get input for the base height

 System.out.print("Base Height: "); arrowBaseHeight = input.nextInt();

This loop is repeated until the head width is greater than the base width

 while (arrowHeadWidth <= arrowBaseWidth) {

       System.out.print("Head Width: "); arrowHeadWidth = input.nextInt();

 System.out.print("Base Width: "); arrowBaseWidth = input.nextInt();      }

This iterates through the base height

 for(int i = 0; i<arrowBaseHeight; i++){

This iterates through the base width

     for(int j = 0; j<arrowBaseWidth;j++){

This fills the base

         System.out.print("*");        }

This prints a new line

         System.out.println();    }

These iterate through the arrow head

 for(int i = arrowHeadWidth; i>0;i--){

     for(int j = 0; j<i;j++){

This fills the arrow head

         System.out.print("*");        }

This prints a new line

         System.out.println();    }

Most new information systems must communicate with other, existing systems, so the design of the method and details of these communication links must be precisely defined. These are called ____.

Answers

Answer:

System Interfaces.

Explanation:

Most new information systems must communicate with other, existing systems, so the design of the method and details of these communication links must be precisely defined. These are called system interfaces.