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 to and the 'EnergyBar' model from to 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:
whether the input model equals either PowerPack or EnergyBar exactly
whether the input model equals either PowerPack of EnergyBar ignoring case
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
Exact match found.
Caseinsensitivy match found.
Substring match found.
Test runs:
Case :
powerpack
Exact match not found.
Caseinsensitive match found.
Substring match found.
OK
case :
EnergyBar
Exact match found.
Caseinsensitive match found.
Substring match found.
Issue notice.
case :
energybar
Exact match not found.
Caseinsensitive match found.
Substring match found.
OK
case :
SuperCharge PowerPack Edition
Exact match not found.
Caseinsensitive match not found.
Substring match found.
Issue notice.
case :
Total Energy Bar
Exact match not found.
Caseinsensitive 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
