Coder Social home page Coder Social logo

aa-final-practical-exam's Introduction

Final Practical Exam

Your application will demonstrate the ability to retrieve 5 unique numbers in a range from 0 to 100 (inclusive), then determine the largest number, the smallest number, the sum of all the numbers, the average of the numbers entered, and divide the last number entered by the first number entered. Note: exception handling will be required โ€“ throw an exception if the value entered is out of range; handle the system exception if a division by 0 error is encountered. Incorporate the following requirements into your application:

  • The program will consist of two files
  • 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
    • Hint: How you approach the ability to get the above values is up to you - you may process the stored values within each function, you may use member variables to store the information as you retrieve it from the user, or you may use a combination of both techniques
  • The main application does the following
    • Print a line that states "Your Name - Final Practical Exam"
    • 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)

aa-final-practical-exam's People

Contributors

jdfdoyley avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.