Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
1 answer
195 views

Simulating a toilet seat usage in Java - follow-up

(See the previous iteration.) This time, I removed the stuff I don't need in my demo runner. Also, I consolidated some code that seemed DRY to me. Simulation rules When a female arrives, she ensures ...
coderodde's user avatar
  • 28.4k
2 votes
2 answers
124 views

Simulating a toilet seat usage in Java

(See also the next iteration.) I have this small simulation program simulating a toilet seat. The toilet seat may be in two positions: up or down. If a male arrives to the toilet to urinate, and ...
coderodde's user avatar
  • 28.4k
4 votes
2 answers
1k views

Traffic simulation GUI: an exercise in concurrent programming using threads

To avoid a code dump I have removed most of the code and left the first few lines of constructors and methods and anything relevant. Full code at the bottom. The purpose of this code is to use threads ...
Corey Hodges's user avatar
1 vote
4 answers
329 views

Given the arrival times of people at a door, resolve their passage times

I was trying to solve the following question: You are given 2 arrays: one representing the time people arrive at a door and other representing the direction they want to go (in or out) You have to ...
coder1532's user avatar
  • 177
5 votes
2 answers
301 views

A type of game simulation dropping disks

Quincunx is that little game where you drop a ball or disk down rows of nails in a pyramid formation until they land in a slot. This was a project for my class, but it's already been submitted. I am ...
Daedric_Man_guy's user avatar
6 votes
2 answers
5k views

Fast Food Order Simulator

I have been trying learn OOP lately, and have made a simple program that simulates some sort of drive thru experience using a 9 digit keypad to add, delete, and pay for items ordered from the menu. ...
RobotMan's user avatar
  • 359
2 votes
1 answer
124 views

Code which creates the Game Of life In Java

Link to github Link to github: https://github.com/zombi3123/Game-Of-Life/ Source code: Window.Java ...
jamie's user avatar
  • 31
4 votes
3 answers
213 views

Simulation of forest growth and pruning

I was wondering how I could streamline the following code. This was the project assigned to us: The Canadian Forest Service wants to do a simple simulation of the growth and pruning of forests. ...
Corbin's user avatar
  • 71
2 votes
1 answer
150 views

Incrementing time in a discrete-event simulation of a supermarket queue

A method has been written that increments time in minutes that simulates how much time it takes to process item in a supermarket queue and if there is an empty queue, skip it and loops around to find ...
Xander Powel's user avatar
4 votes
2 answers
287 views

Follow up Implementation on Monty Hall Simulation

I have taken your inputs on my original question and formed a new implementation of the Monty Hall Simulation: Again keep an eye on CleanCode and OOP The Price to be won: ...
Martin Frank's user avatar
  • 2,838
1 vote
1 answer
308 views

Counting results of die rolls

The algorithm bellow is meant to allow a user to roll a die as many times as he would like, then print how many times each side was rolled and how many rolls there were total. ...
Q The Great's user avatar
3 votes
2 answers
2k views

Extending Combo from Food in FoodOrder Simulator

This is an assignment and I'm trying to improve upon the design factor. Honestly the task seems very trivial to use inheritance so I kind of did it for the sake of doing it. The problem description ...
Prashin Jeevaganth's user avatar
7 votes
3 answers
7k views

Discrete Event Simulator

I'm an undergraduate student and I have this assignment on a Discrete Event simulator. Currently I have completed to the end of v1.2 here. Attached also, is an algorithmic overview. I have wrote my ...
Prashin Jeevaganth's user avatar
3 votes
1 answer
558 views

Classic Hundred Doors Simulation

I am doing the 100 Doors problem as an exercise to practice user input and loops. I do understand the problem can be solved by outputting every square number up to the maximum number, but it defeats ...
Anthony Pham's user avatar
4 votes
2 answers
2k views

Java Conway's Game Game of Life

I have implemented Conway's Game of Life simulation. What can I improve? How could I structure my programme better? All suggestions would be appreciated. World.java: ...
Marten's user avatar
  • 585

15 30 50 per page