Purpose: The lab this week will focus on learning how to implement a Monte Carlo simulation using die rolls. The concepts covered in this lab are for loops, file input, and randomness.
Task: This program will need all classes in the io package as well as the Random class. You will use the PrintWriter class to save the results of this lab to a text file. Use the Random class to simulate rolling a die. This means randomly picking a number from 1 to 6. Perform this action 10000 times and maintain a count of how often you roll each side of the die. When printing the results to a file, including both the number of rolls as well as the percentage of rolls out of the 10000 total rolls. As a small bonus, provide a short write up explaining the meaning behind the results of this simulation.
Bonus Task: As a much larger bonus, instead of simulating rolling a die, refer to the following scenario:
Suppose you're on a game show, and you're given the choice of three doors: Behind one door is a car; behind the others, goats. You pick a door, say No. 1, and the host, who knows what's behind the doors, opens another door, say No. 3, which has a goat. He then says to you, "Do you want to pick door No. 2?" Is it to your advantage to switch your choice?
You will simulate this game show 10000 times and keep a count of how often you win before making the switch and how often you win after making the switch. This means that your program must handle the process of selecting a prize door, having a contestant pick a door, revealing a door to the contestant, and switching the contestant’s choice after the reveal. The results printed to the file should include both the counts and percentages for each type of win.
Criteria: Program correctness includes proper and accurate results from the simulation as well as correctly printing the results to a file. Program correctness is worth 50 points. The simulation process requires properly using loops and the Random class. This process is worth 45 points. Descriptive comments explaining the overall program and key elements are 5 points. The write up is worth 10 bonus points. Implementing a simulation of the game show is worth 50 bonus points.
CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,
Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This
7COM1028 Secure Systems Programming Referral Coursework: Secure
Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip
CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme