Question: USE C PROGRAMMING LANGUAGE ONLY (#include ) Thank you Prime Minister has announced that the government will give financial aid to reduce the burden of

USE C PROGRAMMING LANGUAGE ONLY (#include )

USE C PROGRAMMING LANGUAGE ONLY (#include ) Thank you Prime Minister has

announced that the government will give financial aid to reduce the burden

Thank you

Prime Minister has announced that the government will give 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 recelved, respectively, separated by commas. The next line contains the category you want to display, B40 or M40. Output Format First, forall recipients under the asked category, output the category, name, and the amount of money received. Print in the order from 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 under the category. Constraints 1SN 50 Length of name is between land 20 (inclusive). Names consist of uppercase Latin alphabet. Category can only be 340 or M40. It is guaranteed that the amount of money received is in accordance with the category and the provisions that hae been explained in the description above. Sample Input B40, Sofea, 1880 M40, Mikael,600 B40, Adam, 1888 B40, Irene, 1000 Me, Cyntia,680 B40, Alif, 1000 B40 Sample Output B48 Sofea 1800 B40 Adam 1880 B40 Irene 1800 848 Alif 1880 Total Recipients: 4 Total Amount: 4eee M48 Mikael Gee Me Cyntia 600 Total Recipients: 2 Total Amount: 1200 B40, Sofea, 1980 M4e, Mikael, 680 B48, Adam, 1800 B40, Irene, 1880 M4, Cyntia, 680 B48, Alif, 1880 M40

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!