Menu

[solved]-Need Help Creating Python Program Generate Set Arithmetic Problems Place Text File Example Q39084667

I need help creating a Python program that will generate a setof arithmetic problems and place them in a text file. This is a anexample of how the format should look like:

How many problems do you want to generate (1-100)? 50 How many digits would you like to have (1-4)? 3 Would you like to inclu

The program asks the user how many problems does he/she want togenerate in the text file. At least one problem could be generatedand a max of 100 problems. Your program should do boundarychecking.

Next the program should ask the number of digits wanted in theproblem set. Example if the user selects 2 digits then the programshould generate problems like

  • 32+44=
  • 22/11=

If the user selects 3 digits for example, then problems couldlook like

  • 276+234=
  • 998*436=                            

The program should make sure the user does not enter more than 4digits and no less than 1 digit. The program then should ask whatkind of operations to generate. The user can select all fouroperations shown above, or some of them by answering (Y/N) or(y/n).

The program should generate the question in a file calledgen_problems.txt and should also generate a second file calledgen_problems_answer.txt in the same folder.

To put some twist to the program. Make sure your divisionoperation yields only to full integers. So 9/3 is a full integerbut 10/3 is not.

I will thumbs up upon completion and testing.

How many problems do you want to generate (1-100)? 50 How many digits would you like to have (1-4)? 3 Would you like to include the addition (+) operation (Y/N)? Y Would you like to include the subtraction (-) operation (Y/N)? N Would you like to include the division () operation (Y/N)? N Would you like to include the multiplication (*) operation (Y/N)? y === Generating Problems… === Done… === Remember: if you need help, the answer file is provided as well. Show transcribed image text How many problems do you want to generate (1-100)? 50 How many digits would you like to have (1-4)? 3 Would you like to include the addition (+) operation (Y/N)? Y Would you like to include the subtraction (-) operation (Y/N)? N Would you like to include the division () operation (Y/N)? N Would you like to include the multiplication (*) operation (Y/N)? y === Generating Problems… === Done… === Remember: if you need help, the answer file is provided as well.

Expert Answer


Answer to I need help creating a Python program that will generate a set of arithmetic problems and place them in a text file. Thi… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *