TORONTO KIDS COMPUTER CLUB | PMCA Sunday 10:00 Java Homework 20.03.15.
17225
post-template-default,single,single-post,postid-17225,single-format-standard,ajax_fade,page_not_loaded,,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Sunday 10:00 Java Homework 20.03.15.

20 Mar PMCA Sunday 10:00 Java Homework 20.03.15.

Question:
Canada Cosmos Control has received a report of another incident. They believe that an alien has illegally entered our space. A person who witnessed the appearance of the alien has come forward to describe the alien’s appearance. It is your role within the CCC to determine which alien has arrived. There are only 3 alien species that we are aware of, described below:

  • TroyMartian, who has at least 3 antenna and at most 4 eyes;
  • VladSaturnian, who has at most 6 antenna and at least 2 eyes;
  • GraemeMercurian, who has at most 2 antenna and at most 3 eyes.

Input Specification
The user will be prompted to enter two numbers. First, the user will be prompted to enter the number of antenna that the witness claimed to have seen on the alien. Second, the user will be prompted to enter the number of eyes seen on the alien.

Output Specification
The output will be the list of aliens who match the possible description given by the witness. If no aliens match the description, there is no output.

Sample Session 1 (with output shown in text, user input in italics)
How many antennas?
4
How many eyes?
5
VladSaturnian

Sample Session 2
How many antennas?
2
How many eyes?
3
VladSaturnian
GraemeMercurian

Sample Session 3
How many antennas?
8
How many eyes?
6
(Note: there is no output for Sample Session 3)

No Comments

Sorry, the comment form is closed at this time.