- Muhammad Aims To Start A Quranic Campaign For One Day One Juz Chapter Among His Friends A Juz Consists Of 20 Pages Of 1 (187.16 KiB) Viewed 60 times
Muhammad aims to start a Quranic campaign for one day one juz (chapter) among his friends. A juz consists of 20 pages of
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Muhammad aims to start a Quranic campaign for one day one juz (chapter) among his friends. A juz consists of 20 pages of
Muhammad aims to start a Quranic campaign for one day one juz (chapter) among his friends. A juz consists of 20 pages of the Quran. He needs a program to divide the number of pages evenly and assign page numbers among his friends as participants for a group reading of one juz one day. See sample output. Your task is to complete the program based on the following program requirements: i. The program consists of three user-defined functions named GetNum (), GetNames () and AssignPages (). The following variables are already declared in main (): juz - the juz number n - the number of participants (to read the juz) prompt - prompt message (for user input) pagesno [] - an array of integers to store pages' numbers for each participant names [] [] - a two-dimensional array of characters to keep participants' names ii. ● ● V. ● ● respond-user's response iii. Function GetNum () will get an integer from the user and return the integer to main (). GetNum () has a prompt message as its parameter. GetNum () is called in main () twice to get the juz number and to get the number of participants. iv. main () will check to ensure that the number of pages can be equally divided among the participants. Otherwise, the program will ask the user to re-enter the correct number of participants. ● In main (), calculate a start page by using (juz-1) x 20+1 and store the start page in pagesno [0], the first element of array pagesno [ ]. vi. Function GetNames () will receive a two-dimensional array of characters to store the participant names. Then, this function will ask the user to enter all the names. The variable names [] [], to store the names, are already declared in main (). vii. Function Assign Pages () will receive the number of participants, the array of participants' names, and the array of pages' numbers to be read (per participant) from main (). AssignPages () will calculate the average pages per participant and display the average. Then, this function will determine the end page assigned to each participant based on the start page of each participant by using the formula: end page= start page average pages -1. Lastly, it will display each participant name, his start page and his end page number. viii. The program will continue until the user responds with 'n'. A variable respond is already declared in main () ix. Do NOT use any global variable in the program. X. You may add variables you deemed as necessary in the functions GetNum (), GetNames () and AssignPages ().