Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function spaceship(input) {
- let width = Number(input.shift());
- let length = Number(input.shift());
- let height = Number(input.shift());
- let average = Number(input.shift());
- let volumeRacket = width * length * height;
- let volumeRoom = 2 * 2 * (average + 0.40);
- let people = Math.floor(volumeRacket / volumeRoom);
- if (people >= 3 && people <= 10) {
- console.log(`The spacecraft holds ${people} astronauts.`);
- } else if (people < 3) {
- console.log("The spacecraft is too small.");
- } else if (people > 10) {
- console.log("The spacecraft is too big.");
- }
- }
Add Comment
Please, Sign In to add comment