Repository navigation
Conversation
Import System.Diagnostics and add Stopwatch timing around the question loop. Capture start timestamp before the do/while loop and compute elapsed time after, formatted as mm:ss.fff and shown in console output. Replace scoreTracker int with score and update increments/usages. Change scoreList from List<int> to List<string> and store combined "score + formatted elapsed" entries. Update console messages to display points alongside elapsed time.
Replace the old string-based score list with a typed GameResult model and update program logic to store, sort, and display GameResult instances. - Add GameResult class (Score:int, Time:TimeSpan) with ctor and ToString() that formats time as mm:ss.fff. - Add using System.Collections.Generic and System.Linq to Program.cs. - Replace List<string> scoreList with List<GameResult> scoreHistory. - Build sortedLeaderboard with LINQ: OrderByDescending(r => r.Score).ThenBy(r => r.Time) and print entries via GameResult.ToString(). - On game end compute elapsedTime (TimeSpan) and add new GameResult(score, elapsedTime) instead of a preformatted string.
🚀 Project Submitted!Thanks for submitting your project! I will review it soon. 📋 Please check the dashboard to make sure the project is marked as Pending. |
|
@cparkes1 Project approved! 😄✅ ✅ Well done for completing the timer challenge. It's a shame you didn't complete the other ones this time. 😟 It's always a good use of your time. But nothing stops you from revisiting the project later. 👩🎤 🥋And congratulations! You got your green belt!! 🟩🟩 Feedback
🔍️It would be much easier and more readable to handle all menu options with a switch case instead of a massive if-else. You can use the default case to handle all invalid inputs. 🔍Adding the date and time a game was played would make the history feature more informative. 🗺️I noticed that you haven't completed any of our courses yet. I suggest you try our Intro to Object Oriented Programming course next. This will close gaps in your knowledge and give you more confidence about OOP ☕If you like our roadmap, please consider buying us a coffee. We appreciate your help 🙂 Overall good work!✋🏻Looking forward to seeing your next projects! |

No description provided.