Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Operators | Aloitus
C# Perusteet

bookChallenge: Operators

Tehtävä

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.

Ratkaisu

Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 14
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

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

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 1. Luku 14
single

single

some-alt