Challenge: Basic Type Conversion
Tarefa
Swipe to start coding
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.ToInt32to 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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 19
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
Incrível!
Completion taxa melhorada para 1.25
Challenge: Basic Type Conversion
Deslize para mostrar o menu
Tarefa
Swipe to start coding
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.ToInt32to 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.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 19
single