Problem Description 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 M F Sample Input Output Sample Input 5 2906 2652 8195 3441 9534 Sample Output 2 М3F

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section: Chapter Questions
Problem 11PP
icon
Related questions
Topic Video
Question
Problem Description
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<XS 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
Sample Output
2 М3F
Transcribed Image Text:Problem Description 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<XS 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 Sample Output 2 М3F
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Instruction Format
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
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,