Final answer:
To design an algorithm/flowchart using Raptor with three sub-flowcharts/subprocedures: readData, maxincome, and avgIncome.
Step-by-step explanation:
To design an algorithm/flowchart using Raptor with three sub-flowcharts/subprocedures: readData, maxincome, and avgIncome, you can follow the following steps:
readData: Create two arrays called 'months' and 'income' to read the provided text file 'income.txt' which saves the income of twelve months. 'months' array saves the month names, and 'income' array saves the income of each month.
maxIncome: Calculate the month with the maximum income by iterating through the 'income' array and keeping track of the maximum income value and its corresponding month name.
avgIncome: Calculate the average income per year by summing up all the income values in the 'income' array and dividing it by the total number of months (which is 12 in this case).
The algorithm for reading data from the "income.txt" file using RAPTOR involves opening the file, initializing arrays for months and income, and populating them with corresponding data. The maxIncome sub-flowchart identifies the month with the highest income, while the avgIncome sub-flowchart calculates the average income per year.
Utilizing a while loop, the readData sub-flowchart iterates through the file, extracting month names and income values. These sub-flowcharts collectively facilitate effective handling and analysis of monthly income data, supporting tasks such as identifying the month with the highest income and computing the average annual income.