1. Learn
  2. /
  3. Courses
  4. /
  5. Cleaning Data in Java

Connected

Exercise

Validating numeric ranges

As a data analyst at a video game publisher, you need to validate sales data across your game catalog. Video game sales can vary dramatically. Invalid data could mislead strategic decisions about which games to develop or promote. By implementing range validation, you can quickly identify suspicious sales figures that might indicate data entry errors. You've extracted sample sales quantities from a video game dataset below. Set up range checks on this data.

Game Platform Release date Quantity (millions of units)
Wii Sports Wii 11/19/2006 41.49
Super Mario Bros. NES 11/13/1985 29.08
Mario Kart Wii Wii 4/10/2008 15.85

The necessary packages such as Range, and Collections have been imported for you.

Instructions

100 XP
  • Get the minimum and maximum of quantities.
  • Define ranges for low and high sales quantities.
  • Check if the quantity is in the low range.
  • Check if the quantity is in the high range.