Question: TechGiant Electronics is issuing a safety notice for certain models of its portable chargers, specifically the 'PowerPack' model from 2 0 1 5 to 2

TechGiant Electronics is issuing a safety notice for certain models of its portable chargers, specifically the 'PowerPack' model from 2015 to 2018 and the 'EnergyBar' model from 2016 to 2019, due to potential overheating issues.
Write a prograam that reads the model data from input, specifically the name and then the year of productions. As different versions of these models were produced, you need to print out:
1. whether the input model equals either PowerPack or EnergyBar exactly
2. whether the input model equals either PowerPack of EnergyBar ignoring case
3. whether the input model contains either substring PowerPack or EnergyBar ignoring case
If any of these checks are true, check also the model year and print out OK if the year does not fall in the relative range or Issue Notice otherwise. Your class name should be Answer.
Take note of the sample run, as you will need to follow the same format (user input between [])
[PowerPack]
[2017]
Exact match found.
Case-insensitivy match found.
Substring match found.
Test runs:
Case 2:
[powerpack]
[2014]
Exact match not found.
Case-insensitive match found.
Substring match found.
OK.
case 3:
[EnergyBar]
[2019]
Exact match found.
Case-insensitive match found.
Substring match found.
Issue notice.
case 4:
[energybar]
[2020]
Exact match not found.
Case-insensitive match found.
Substring match found.
OK.
case 5:
[SuperCharge PowerPack Edition]
[2016]
Exact match not found.
Case-insensitive match not found.
Substring match found.
Issue notice.
case 6:
[Total Energy Bar]
[2018]
Exact match not found.
Case-insensitive match not found.
Substring match not found.
OK.
language is java

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!