Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Calculate Customer Acquisition Cost | Variables and Data Types
Introduction to Scala
course content

Kursinnhold

Introduction to Scala

Introduction to Scala

1. Getting Started
2. Variables and Data Types
3. Conditional Statements and Loops
4. Arrays
5. Strings

book
Challenge: Calculate Customer Acquisition Cost

Here is the formula to calculate CAC:

Task

Your task is to calculate CAC given the values for cost of sales, cost of marketing and the number of new customers acquired.

  1. Create an immutable variable costOfSales and assign 1200 to it.

  2. Create an immutable variable costOfMarketing and assign 2460 to it.

  3. Create an immutable variable newCustomersAcquired and assign 20 to it.

  4. Create an immutable variable customerAcquisitionCost.

  5. Calculate the value of customerAcquisitionCost using the other variables according to the formula provided above.

java

Main

copy
123456789
object Main { def main(args: Array[String]): Unit = { ___ ___ = ___ // Initialize costOfSales ___ ___ = ___ // Initialize costOfMarketing ___ ___ = ___ // Initialize newCustomersAcquired ___ ___ = ___ // Calculate customerAcquisitionCost println(customerAcquisitionCost) } }

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 7

Spør AI

expand
ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

course content

Kursinnhold

Introduction to Scala

Introduction to Scala

1. Getting Started
2. Variables and Data Types
3. Conditional Statements and Loops
4. Arrays
5. Strings

book
Challenge: Calculate Customer Acquisition Cost

Here is the formula to calculate CAC:

Task

Your task is to calculate CAC given the values for cost of sales, cost of marketing and the number of new customers acquired.

  1. Create an immutable variable costOfSales and assign 1200 to it.

  2. Create an immutable variable costOfMarketing and assign 2460 to it.

  3. Create an immutable variable newCustomersAcquired and assign 20 to it.

  4. Create an immutable variable customerAcquisitionCost.

  5. Calculate the value of customerAcquisitionCost using the other variables according to the formula provided above.

java

Main

copy
123456789
object Main { def main(args: Array[String]): Unit = { ___ ___ = ___ // Initialize costOfSales ___ ___ = ___ // Initialize costOfMarketing ___ ___ = ___ // Initialize newCustomersAcquired ___ ___ = ___ // Calculate customerAcquisitionCost println(customerAcquisitionCost) } }

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 2. Kapittel 7
Vi beklager at noe gikk galt. Hva skjedde?
some-alt