Prime Ministerhas announced that the government wilgive financial aid to reduce the burden of the people during the pandemic. Upon this initiation, recipient will receive money with the following amounts: • RM1000 for household category B40 • RM600 for household category M40 In this problem, N data are given which contains the category, name, and the amount of money received. You are asked to display all data in a category, B40 or M40. Output the information of the recipients in that category, how many recipients are in that category, and the total amount of money for all of the recipientsin that category.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

PLEASE HELP SIR, THX. using c language

(D Page view
A Read aloud
V Draw
F Highlight
O Erase
of 17
To exit full screen, move mouse to top of screen or press F11
C. Financial Aid During Pandemic[EN]
Prime Minister has announced that the government willgive financial aid to reduce the burden of the
people during the pandemic. Upon this initiation, recipient will receive money with the following
amounts:
RM1000 for household category B40
RM600 for household category M40
In this problem, N data are given which contains the category, name, and the amount of money
received. You are asked to display all data in a category, B40 or M40. Output the information of the
recipients in that category, how many recipients are in that category, and the total amount of money
for all of the recipients in that category.
Input Format
Input will be given in a file named "testdata.in".
The first line consists of an integer N.
The next N lines consist of the given data. Each data consists of category, name, and the amountf
money received, respectively, separated by commas.
The next line contains the category you want to display, B40 or M40.
Output Format
First, forall recipients underthe asked category, outputthe category, name, and the amount of money
received. Print in the orderfrom the input.
In the next line, output "Total Recipients: ", followed by the number of recipients under the asked
category.
In the next line, output "Total Amount: ", followed by the total amount of money for all recipients
underthe category.
Constraints
1<NS 50
Length of name is between land 20 (inclusive). Names consist of upper case Latin alphabet.
Category can only be B40 or M40.
It is guaranteed that the amount of money received is in accordance with the category and the
provisions that hae beenexplained in the description above.
Transcribed Image Text:(D Page view A Read aloud V Draw F Highlight O Erase of 17 To exit full screen, move mouse to top of screen or press F11 C. Financial Aid During Pandemic[EN] Prime Minister has announced that the government willgive financial aid to reduce the burden of the people during the pandemic. Upon this initiation, recipient will receive money with the following amounts: RM1000 for household category B40 RM600 for household category M40 In this problem, N data are given which contains the category, name, and the amount of money received. You are asked to display all data in a category, B40 or M40. Output the information of the recipients in that category, how many recipients are in that category, and the total amount of money for all of the recipients in that category. Input Format Input will be given in a file named "testdata.in". The first line consists of an integer N. The next N lines consist of the given data. Each data consists of category, name, and the amountf money received, respectively, separated by commas. The next line contains the category you want to display, B40 or M40. Output Format First, forall recipients underthe asked category, outputthe category, name, and the amount of money received. Print in the orderfrom the input. In the next line, output "Total Recipients: ", followed by the number of recipients under the asked category. In the next line, output "Total Amount: ", followed by the total amount of money for all recipients underthe category. Constraints 1<NS 50 Length of name is between land 20 (inclusive). Names consist of upper case Latin alphabet. Category can only be B40 or M40. It is guaranteed that the amount of money received is in accordance with the category and the provisions that hae beenexplained in the description above.
(D Page view
A Read aloud V Draw
F Highlight
O Erase
of 17
Sample Input
Sample Output
6
B40 Sofea 1000
B40, Sofea, 1000
M40, Mikael, 60e
B40, Adam, 1000
B40, Irene, 1000
B40 Adam 1000
B40 Irene 1000
B40 Alif 1000
Total Recipients: 4
M40, Cyntia, 600
B40, Alif,1000
Total Amount: 4000
B40
6
M40 Mikael 600
B40, Sofea, 1000
M40, Mikael,600
B40, Adam, 1000
B40, Irene, 1000
M40, Cyntia,600
B40, Alif,1000
M40 Cyntia 600
Total Recipients: 2
Total Amount: 1200
M40
+
Transcribed Image Text:(D Page view A Read aloud V Draw F Highlight O Erase of 17 Sample Input Sample Output 6 B40 Sofea 1000 B40, Sofea, 1000 M40, Mikael, 60e B40, Adam, 1000 B40, Irene, 1000 B40 Adam 1000 B40 Irene 1000 B40 Alif 1000 Total Recipients: 4 M40, Cyntia, 600 B40, Alif,1000 Total Amount: 4000 B40 6 M40 Mikael 600 B40, Sofea, 1000 M40, Mikael,600 B40, Adam, 1000 B40, Irene, 1000 M40, Cyntia,600 B40, Alif,1000 M40 Cyntia 600 Total Recipients: 2 Total Amount: 1200 M40 +
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY