Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Basic Type Conversion | Dealing with Data Types
C# Basics
セクション 2.  19
single

single

book Challenge: Basic Type Conversion

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

タスク

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

You will calculate the total weight of an order, including the weight of individual items and their packaging, and then convert the total weight to an integer.

  • Inside the method, calculate the total weight of all items by multiplying the weight of one item by the total number of items.
  • Calculate the total packaging weight by multiplying the packaging weight per item by the total number of items.
  • Add the items' weight and the total packaging weight to get the total order weight.
  • Convert the total weight from a double to an integer using Convert.ToInt32 to show a rounded whole number.
  • Print all relevant information to the console, including the weight of a single item, the packaging weight per item, the number of items, the total weight as a double, and the total weight as an integer.

解答

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

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

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

セクション 2.  19
single

single

AIに質問する

expand

AIに質問する

ChatGPT

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

some-alt