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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education