Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Calculate Shipping Cost | Section
C++ Conditional Statements
セクション 1.  10
single

single

bookChallenge: Calculate Shipping Cost

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

タスク

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

You are building a shipping cost calculator that computes the final shipping price for a product based on its weight and selected delivery option.

  1. Inside the function calculateShipping, set the initial shippingPrice to 10% of productPrice.
  2. If the product's weight exceeds 25 pounds, add an additional $2.25 to shippingPrice.
  3. Use a switch statement on the option parameter:
    • Case 1 → add $0.3 to shippingPrice.
    • Case 2 → add $0.5 to shippingPrice.
    • Case 3 → add $1.75 to shippingPrice.
    • Default → do nothing.
  4. Return the value of shippingPrice from the function.

解答

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

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

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

セクション 1.  10
single

single

AIに質問する

expand

AIに質問する

ChatGPT

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

some-alt