Use java MyKad is the compulsory identity card for Malaysian citizens aged 12 and above. The current format of the Malaysian identity card number was introduced in 1990, features 12 digits separated into three blocks by hyphens, as illustrated below: YYMMDD-PB-###G The first six digits signify the person's date of birth in the ISO 8601:2000 format; the seventh and eighth digit, represents the place of birth of the person. The ninth through eleventh digit is the generic special number generated by the National Registration Department of Malaysia's computer system. G, the 12th digit represents the gender of the person. The odd number for G denote male while the even number denote female. For example, 2906 is female (6 is even number) and 8995 is male (5 is odd number) You are given a list of the last 4 digits of MyKad. Write a program to calculate the number of male and female. Input The input starts with X (1 ≤X ≤20) which is the number of students. This is then followed by X number of data G (1000 ≤G≤9999) that represent the last 4 digits of MyKad number. Output The output displays a number of male and female with the following format: M F Sample Input Output Sample Input 5 2906 2652 8195 3441 9534 2M3F Sample Output

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter1: A First Program Using C#
Section: Chapter Questions
Problem 15RQ
icon
Related questions
Question
Use java
MyKad is the compulsory identity card for Malaysian citizens aged 12 and above. The current
format of the Malaysian identity card number was introduced in 1990, features 12 digits
separated into three blocks by hyphens, as illustrated below:
YYMMDD-PB ###G
B
The first six digits signify the person's date of birth in the ISO 8601:2000 format; the seventh
and eighth digit, represents the place of birth of the person. The ninth through eleventh digit
is the generic special number generated by the National Registration Department of Malaysia's
computer system. G, the 12th digit represents the gender of the person. The odd number for G
denote male while the even number denote female.
For example, 2906 is female (6 is even number) and 8995 is male (5 is odd number)
You are given a list of the last 4 digits of MyKad. Write a program to calculate the number of
male and female.
Input
The input starts with X (1 ≤X ≤20) which is the number of students. This is then followed by
X number of data G (1000 ≤G ≤9999) that represent the last 4 digits of MyKad number.
Output
The output displays a number of male and female with the following format;
<number of male> M <number of female> F
Sample Input Output
Sample Input
5 2906 2652 8195 3441 9534
2 M 3 F
Sample Output
Transcribed Image Text:Use java MyKad is the compulsory identity card for Malaysian citizens aged 12 and above. The current format of the Malaysian identity card number was introduced in 1990, features 12 digits separated into three blocks by hyphens, as illustrated below: YYMMDD-PB ###G B The first six digits signify the person's date of birth in the ISO 8601:2000 format; the seventh and eighth digit, represents the place of birth of the person. The ninth through eleventh digit is the generic special number generated by the National Registration Department of Malaysia's computer system. G, the 12th digit represents the gender of the person. The odd number for G denote male while the even number denote female. For example, 2906 is female (6 is even number) and 8995 is male (5 is odd number) You are given a list of the last 4 digits of MyKad. Write a program to calculate the number of male and female. Input The input starts with X (1 ≤X ≤20) which is the number of students. This is then followed by X number of data G (1000 ≤G ≤9999) that represent the last 4 digits of MyKad number. Output The output displays a number of male and female with the following format; <number of male> M <number of female> F Sample Input Output Sample Input 5 2906 2652 8195 3441 9534 2 M 3 F Sample Output
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
InputStream
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,