Object-Oriented Programming · Lyft · Medium
Problem Design a simulation for an alien base under attack. The base spans the continuous interval [0, n], where n is a positive integer. An attack is launched at a coordinate x and annihilates the segment [x, x+1] of the base. After a sequence of attacks, decide whether the base has been completely obliterated. Implement the AlienBaseAttack class with the following methods: AlienBaseAttack(int base): constructs an instance for an alien base of length n. void attack(double…
Checking your access…