A Visual Basic Program
This is a practice program is Visual Basic that simulates the procedure of paying farm subsidies.
Description of Exercise
Write a program that:
- Reads the following data for the Regions of the country for the payment of the subsidy:
- Region Code (integers with values 1-13)
- Product name (alphanumeric)
- Cultivated farm acres (real number)
- Numbers of farms (real number)
- For each region and product to calculate the average size of farms and accordingly to calculate the subsidy that will be given. The subsidy is calculated in stages based on the average size of the farm and according to the table:
Average farm size Compensation per acre Up to 49 120€ 50 to 99 100€ More than 100 50€
- Write in a file, which has the name RESULTS.txt the region code, the name of the product, the cultivated acres and the total compensation that must be given.
The procedure is repeated until the value 0 is given as the region code. After the end of the data entry, the program calculates and displays:
The total subsidy that must be given for the product "WHEAT" and the number of farms that will receive it.
The region code to which the largest subsidy was given overall.