Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions 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
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
2M3F
Sample Output
expand button
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 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 2M3F Sample Output
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
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.
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education