My take on a program that uses Object Oriented Programming to simulate the throwing of a die. I created a dice object with a roll function that returns a randomized number based off of the total sides of the die. The main file instantiates two instances of your Die class: one with 6 sides, and another with 20 sides. The program then rolls both dice 3 times, and for each attempt prints out the number rolled by each, as well as the sum of both die rolls.
A sample of the output looks like this:
Roll of a 6-sided Die: 4. Roll of a 20-sided Die: 12. Total rolled: 16
Roll of a 6-sided Die: 1. Roll of a 20-sided Die: 20. Total: 21
Roll of a 6-sided Die: 6. Roll of a 20-sided Die: 1. Total: 7