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
Flauer [41]
3 years ago
10

Statistics are often calculated with varying amounts of input data. Write a program that takes any number of non-negative intege

rs as input and outputs the average and max. A negative integer ends the input and is not included in the statistics. Ex: When the input is 15 20 0 5 -1, the output is: 10 20 You can assume that at least one non-negative integer is input. Can this be written in CORAL please!!
Computers and Technology
1 answer:
sveta [45]3 years ago
7 0

Answer:

// Program is written in Coral Programming Language

// Comments are used for explanatory purpose

// Declare and input n; n stands for the number of input data

integer n

n = Get next input

// Declare and initialise two Variables to 0;

// The first Variable Sum, is used for addition and the second, Max is used for the max

integer sum

integer max

Sum = 0

Max = 0

// Declare and intialise Variable count to hold the number of positive input data

integer count

count = 0

// Declare array. The array is used to hold all input data

integer array(n) Arr

// Declare iterating variable I

integer i

//Use the following iterative statement to input array data

for i = 0; i < Arr.size; i = i + 1

Arr[I] = Get next input

if Arr[i] >= 0

Sum = Sum + Arr[i]

count = count + 1

if Arr[i] >= Max

Max = Arr[I]

// Declare Variable average

float average

//Calculate and print average

average = Sum/count

Put average to output

Put Max to output

You might be interested in
A security system uses sensors at every door and window which will set off an alarm if any one of them is opened. There is also
AnnyKZ [126]
You have a raspberry pi connected to all the sensors and a code running to  trigger if the sensors are triggered. Each sensor and keypad would run to a different input on the pi. They should al be able to be powered with a single cell lipo. Is that what you are asking?
5 0
3 years ago
Which of the following should you do if you are exhibiting your photographs?
Naddika [18.5K]

I would go with option a

hope that helped

3 0
3 years ago
Write a Java test program, named TestGuitar, to create 3different Guitars representing each representing a unique test case and
alina1380 [7]

Answer:

Explanation:

//Guitar.java

import java.awt.Color;

import java.lang.reflect.Field;

import java.util.Random;

public class Guitar

     /**

     * these two fields are used to generate random note and duration

     */

     static char[] validNotes = 'A', 'B', 'C', 'D', 'E', 'F', 'G' ;

     static double[] validDuration = 0.25, 0.5, 1, 2, 4 ;

     /**

     * basic guitar attributes

     */

     private int numStrings;

     private double guitarLength;

     private String guitarManufacturer;

     private Color guitarColor;

     public Guitar()

           /**

           * default constructor

           */

           numStrings = 6;

           guitarLength = 28.2;

           guitarManufacturer = Gibson;

           guitarColor = Color.RED;

     

     public Guitar(int numStrings, double guitarLength,

                 String guitarManufacturer, Color guitarColor)

           /**

           * parameterized constructor

           */

           this.numStrings = numStrings;

           this.guitarLength = guitarLength;

           this.guitarManufacturer = guitarManufacturer;

           this.guitarColor = guitarColor;

     

     /**

     * required getters and setters

     */

     public static char[] getValidNotes()

           return validNotes;

     public static void setValidNotes(char[] validNotes)

           Guitar.validNotes = validNotes;      

     public static double[] getValidDuration()

           return validDuration;

     public

4 0
3 years ago
What is the advantage of video conferecing
Svet_ta [14]

some advantages of video conferencing include:

• you can talk no matter how far you are from the person

•you won’t have to go somewhere to talk

•there is no cost if you need to travel far

7 0
3 years ago
Read 2 more answers
The SQL WHERE clause: Limits the row data that are returned. Limits the column data that are returned. ALL Limits the column and
enyata [817]

Answer: Limits the row data that are returned.

Explanation: In structured query language (SQL), The where clause is used as a filter. The filter is applied to a column and as such the filter value or criteria determines the values that are spared in the column on which the WHERE clause is applied. All rows in which the column value does not meet the WHERE clause criteria are exempted from the output. This will hence limit the number of rows which our command displays.

For instance,

FROM * SELECT table_name WHERE username = 'fichoh' ;

The command above filters the username column for username with fichoh, then displays only rows of Data with fichoh as the username. All data columns are displayed but rows of data which do not match fichoh are exempted.

3 0
2 years ago
Other questions:
  • Write a program that asks the user to enter a birth year. the program should then indicate which generation a person of that yea
    14·1 answer
  • Which of the four basic functions of a computer refers to the collection of data by a computer?
    11·2 answers
  • Team A found 342 errors during the software engineering process prior to release. Team B found 184 errors. What additional measu
    12·1 answer
  • What are the three fundamental principals of mnemonics? <br><br>HELP FASTTT!
    15·1 answer
  • A(n) ________ operator, such as the greater than or less than symbol, can be used in a query criterion to limits the results pro
    12·2 answers
  • PLEASE HELP I WILL GIVE YOU BRAINLILY
    15·2 answers
  • Describe the difference between a myth and a fable.
    12·1 answer
  • Fill in this function that takes three parameters, two Strings and an int. 4- // Write some test function calls here! The String
    9·1 answer
  • How can we style the images and layouts of our pages?
    8·1 answer
  • A ______ is a group of slides designed and formatted for a specific purpose. These include themes as well as content.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!