The program will consist of two files Program.cs - the main application file; name the class appropriately Unique.cs - class for retrieving the unique values from the user The Unique class provides the following: Constructor Private member variable to store 5 unique values (hint: use an Array or a List) Public function to get 5 unique values from the user and store them in the member variable loop to get the numbers, if a number is already stored, ignore it and keep looping until you have 5 unique numbers if a number is out of range, don't store the value, throw an exception and handle it in such a way that you don't break the loop but do message the user that the value was out of range Public functions to return the following based on the stored values: Largest number Smallest number Sum of all numbers Average of the numbers entered Last number entered divided by the first number entered The main application does the following Creates an instance of the Unique class Calls the Unique class's GetNumbers function to get the necessary values from the user Calls the Unique class's function to print the following (each value with an appropriate label) All unique values entered by the user The largest number entered The smallest number entered The sum of all numbers entered The average of all numbers entered The last number entered divided by the first number entered (handle division by 0 exception properly)
The program will consist of two files Program.cs - the main application file; name the class appropriately Unique.cs - class for retrieving the unique values from the user The Unique class provides the following: Constructor Private member variable to store 5 unique values (hint: use an Array or a List) Public function to get 5 unique values from the user and store them in the member variable loop to get the numbers, if a number is already stored, ignore it and keep looping until you have 5 unique numbers if a number is out of range, don't store the value, throw an exception and handle it in such a way that you don't break the loop but do message the user that the value was out of range Public functions to return the following based on the stored values: Largest number Smallest number Sum of all numbers Average of the numbers entered Last number entered divided by the first number entered The main application does the following Creates an instance of the Unique class Calls the Unique class's GetNumbers function to get the necessary values from the user Calls the Unique class's function to print the following (each value with an appropriate label) All unique values entered by the user The largest number entered The smallest number entered The sum of all numbers entered The average of all numbers entered The last number entered divided by the first number entered (handle division by 0 exception properly)
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
The program will consist of two files
- Program.cs - the main application file; name the class appropriately
- Unique.cs - class for retrieving the unique values from the user
- The Unique class provides the following:
- Constructor
- Private member variable to store 5 unique values (hint: use an Array or a List)
- Public function to get 5 unique values from the user and store them in the member variable
- loop to get the numbers, if a number is already stored, ignore it and keep looping until you have 5 unique numbers
- if a number is out of range, don't store the value, throw an exception and handle it in such a way that you don't break the loop but do message the user that the value was out of range
- Public functions to return the following based on the stored values:
- Largest number
- Smallest number
- Sum of all numbers
- Average of the numbers entered
- Last number entered divided by the first number entered
The main application does the following
- Creates an instance of the Unique class
- Calls the Unique class's GetNumbers function to get the necessary values from the user
- Calls the Unique class's function to print the following (each value with an appropriate label)
- All unique values entered by the user
- The largest number entered
- The smallest number entered
- The sum of all numbers entered
- The average of all numbers entered
- The last number entered divided by the first number entered (handle division by 0 exception properly)
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 2 steps with 8 images
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