Question: Create a document with a form that registers all organic farmers in the area and the non-GMO crop they grow. Your program will create a

Create a document with a form that registers all organic farmers in the area and the non-GMO crop they grow. Your program will create a single text le that saves information for each farmer on a separate line. The name of the data file is data.txt. The file should be created in the same directory as your running program, without hard-coding the file path to ensure portability. (This means that when I am running your file, I will copy it to my working directory, and after I run your program entering information, the file will be created in the same folder as the program). In the data file include the farmers name, age, crop type, and pounds grown, separated by commas. Age and Pounds should only accept numbers, crop should only accept corn, soybeans, and tomatoes. The first line of the output will be the headers. Name, Age, Crop, Pounds John Smith, 23, corn, 200 Sally Brown, 34, soybeans, 550 Ensure that you comment your code appropriately. Be sure to test your assignment with various input to ensure it operates correctly. Grading rubric Data Validated: Name only accepts alphas - 10 points Produce accepts only corn, soybeans, tomatoes - 10 points Age only accepts integers - 10 Weight only accepts integers - 10 Output: Output is sent to a file in the current directory - 20 Each data entry on the new line - 10 Each entry contains commas as delimiters - 10 Headers are output to the file - 10 General code stucture/comments/filenames, etc - 10

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!