- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ladies and gentlemen, I need help with modifying a simulation software. It is a business simulation where people enter decisions as managers at a factory. When you make a wrong decision, you will see a message like "you made a wrong decision at ------". I need to modify this simulation programming a bit so that whenever someone makes a mistake, there is a counter that adds up all the mistakes. Then by the end of the day, I know the number of mistakes one made in each trial of the simulation. I can pay you for your work and I need the work to be done by the middle of November. Please contact me by sending me an e-mail (ninizhao@yahoo.com) if you can help. I would really appreciate it if you can contact me as soon as possible! Thanks!
Link Copied
6 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have the code of the software, it will be very easy to do this. Just insert some counter after your message.
Good luck!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Sir or Madam,
Thanks for your kind response to my message. Yes, I have the code. The problem is, I am a layman to programming. Can you help me with it?If you can help me, PLEASE contact me again. I can call you or e-mail you for further details, whichever way you prefer.
Thanks and I look forward to your reply!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
You need to ensure that the variable that counts the number of faults is saved. Write something like this:
program simulation
integer, save :: faults = 0
...
...
if (error_by_user) then
faults = faults + 1
...
...
write(*,*)'You did ',faults,' mistakes'
end program simulation
This code initializes the number of faults to zero (the first time), and then increments the number of faults as the user is doing mistakes. Before the program is terminated the number of mistakes is displayed at the screen.
Best Regards,
Lars Petter Endresen
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your detailed reply, Lars, I really appreciate it. However, there is still one question: what if I need to save the number of mistakes in the output file but do not want it to display on the screen?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Then you need to know the file unit number of the output file. This is the number used in the OPEN statement, for example OPEN(10,...), where 10 is the unityouare using.Then you can do WRITE(10,*)'faults = ',faults.
Best Regards,
Lars Petter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Got it. Thanks! Really appreciate it.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page