Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Operators | Початок Роботи
Practice
Projects
Quizzes & Challenges
Quizzes
Challenges
/
Основи C#

bookChallenge: Operators

Завдання

Swipe to start coding

  • You are creating a simple store calculator. The calculator should compute the total price, discount, tax, and final price for items in a store.

  • Complete the RunStoreCalculator method by filling in the missing parts (___) to correctly calculate:

    • To calculate the total price, multiply the price of a single item by the quantity of items.

    • To calculate the discount amount, multiply the totalPrice by discountPercent and then divide by 100 to convert the percentage into a value.

    • To calculate the tax amount, first subtract the discountAmount from the totalPrice to get the price after discount, then multiply by taxPercent and divide by 100.

    • To calculate the final price, subtract the discountAmount from the totalPrice, then add the taxAmount to get the final total the customer needs to pay.

  • Print all values with clear labels inside the method.

Рішення

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 14
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me a real-world example?

close

bookChallenge: Operators

Свайпніть щоб показати меню

Завдання

Swipe to start coding

  • You are creating a simple store calculator. The calculator should compute the total price, discount, tax, and final price for items in a store.

  • Complete the RunStoreCalculator method by filling in the missing parts (___) to correctly calculate:

    • To calculate the total price, multiply the price of a single item by the quantity of items.

    • To calculate the discount amount, multiply the totalPrice by discountPercent and then divide by 100 to convert the percentage into a value.

    • To calculate the tax amount, first subtract the discountAmount from the totalPrice to get the price after discount, then multiply by taxPercent and divide by 100.

    • To calculate the final price, subtract the discountAmount from the totalPrice, then add the taxAmount to get the final total the customer needs to pay.

  • Print all values with clear labels inside the method.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 14
single

single

some-alt