Write a program C# named Averages that includes a method named Average that accepts any number of numeric parameters, displays them, and displays their average. For example, if 7 and 4 were passed to the method, the output would be: 7 4 -- Average is 5.5 Test your function in your Main(). Tests will be run against Average() to determine that it works correctly when passed one, two, or three numbers, or an array of numbers. using static System.Console; public class Averages { public static void Main() { // Write your main here } }
Write a program C# named Averages that includes a method named Average that accepts any number of numeric parameters, displays them, and displays their average. For example, if 7 and 4 were passed to the method, the output would be: 7 4 -- Average is 5.5 Test your function in your Main(). Tests will be run against Average() to determine that it works correctly when passed one, two, or three numbers, or an array of numbers. using static System.Console; public class Averages { public static void Main() { // Write your main here } }
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
Write a
For example, if 7 and 4 were passed to the method, the output would be:
7 4 -- Average is 5.5Test your function in your Main(). Tests will be run against Average() to determine that it works correctly when passed one, two, or three numbers, or an array of numbers.
using static System.Console;
public class Averages
{
public static void Main()
{
// Write your main here
}
}
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 2 images

Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question
Hello,the code does work but it seems there is an error with the system i am using.
![Unit Test incomplete
Method Average can average two numbers
Build Status
Build Succeeded
Test Output Ⓡ
NUnit Console Runner 3.10.0 (.NET 2.0)
Copyright (c) 2019 Charlie Poole, Rob Prouse
Wednesday, 15 March 2023 17:35:11
Runtime Environment
OS Version: Linux 5.0.0.27
CLR Version: 4.0.30319.42000
Test Files
Nt Testbacb4ceb.dll
Errors, Failures and Warnings
1) Failed Average TwoNumbers Test. Average Test
Expected the average of 8 and 10 to be 9
Expected string length 21 but was 20. Strings differ at index 5.
Expected: "8 10 -- Average is 9"
But was: "8 10
Average is 9"
at Average TwoNumbers Test. Average Test () [0x00000] in <e7325ba8777f492e818639c
Run Settings
DisposeRunners: True.
WorkDirectory: /root/sandboxfe029a55
ImageRuntimeVersion: 4.0.30319
ImageRequiresX86: False
ImageRequires Default AppDomainAssemblyResolver: False
Number Of TestWorkers: 2
Test Run Summary
Overall result: Failed
Test Count: 1, Passed: 0, Failed: 1, Warnings: 0, Inconclusive: 0, Skipped: 0
Failed Tests - Failures: 1, Errors: 0, Invalid: 0
Start time: 2023-03-15 17:35:11Z
End time: 2023-03-15 17:35:13Z
Duration: 1.392 seconds](https://content.bartleby.com/qna-images/question/f551ebba-f772-4851-b1da-db307480099a/d4f4231b-7f5d-454a-a643-eabb4ba21eb0/2dnu1y_thumbnail.png)
Transcribed Image Text:Unit Test incomplete
Method Average can average two numbers
Build Status
Build Succeeded
Test Output Ⓡ
NUnit Console Runner 3.10.0 (.NET 2.0)
Copyright (c) 2019 Charlie Poole, Rob Prouse
Wednesday, 15 March 2023 17:35:11
Runtime Environment
OS Version: Linux 5.0.0.27
CLR Version: 4.0.30319.42000
Test Files
Nt Testbacb4ceb.dll
Errors, Failures and Warnings
1) Failed Average TwoNumbers Test. Average Test
Expected the average of 8 and 10 to be 9
Expected string length 21 but was 20. Strings differ at index 5.
Expected: "8 10 -- Average is 9"
But was: "8 10
Average is 9"
at Average TwoNumbers Test. Average Test () [0x00000] in <e7325ba8777f492e818639c
Run Settings
DisposeRunners: True.
WorkDirectory: /root/sandboxfe029a55
ImageRuntimeVersion: 4.0.30319
ImageRequiresX86: False
ImageRequires Default AppDomainAssemblyResolver: False
Number Of TestWorkers: 2
Test Run Summary
Overall result: Failed
Test Count: 1, Passed: 0, Failed: 1, Warnings: 0, Inconclusive: 0, Skipped: 0
Failed Tests - Failures: 1, Errors: 0, Invalid: 0
Start time: 2023-03-15 17:35:11Z
End time: 2023-03-15 17:35:13Z
Duration: 1.392 seconds
Solution
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education