Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Custom Exception for Business Rules | Custom Exceptions and Guard Clauses
C# Exceptions and Error Handling Practice
セクション 2.  2
single

single

bookChallenge: Custom Exception for Business Rules

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

Create a custom exception and use it to enforce a business rule in a banking scenario. Your goal is to prevent negative deposit amounts by throwing a custom exception when such an attempt is made.

  • Throw a NegativeDepositException if the amount passed to the Deposit method is less than zero.
  • Do not change the account balance if the exception is thrown.
  • If the deposit is valid, add the amount to the account balance.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 2.  2
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt