Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Challenge | Variables
Introduction to C++
course content

Зміст курсу

Introduction to C++

Introduction to C++

1. Basics
2. Variables
3. Conditional Statements
4. Loops
5. Intro to Arrays

Challenge

Let's practice!

Завдання

Tracy sells apples for 1.5$ per one and she has in total 30 apples. Lily sells oranges, for 2$ per one and she has 20 oranges. Find how much will each of the girls earn if they sell all fruits. Which of them will earn more and the sum of their incomes.

  1. Assign the multiplication of 1.5 and 30 to find the income of Tracy and assign it to the variable incomeTracy.
  2. Assign the multiplication of 2 and 20 to find the income of Lily and assign it to the variable incomeLily.
  3. Find the greater income using the function max() and girls’ incomes as the parameters, and assign the result to the variable maximumIncome.
  4. Print the variable maximumIncome.
  5. Find the sum of girls’ incomes and assign the result to the variable sum.
  6. Print the variable sum.

Завдання

Tracy sells apples for 1.5$ per one and she has in total 30 apples. Lily sells oranges, for 2$ per one and she has 20 oranges. Find how much will each of the girls earn if they sell all fruits. Which of them will earn more and the sum of their incomes.

  1. Assign the multiplication of 1.5 and 30 to find the income of Tracy and assign it to the variable incomeTracy.
  2. Assign the multiplication of 2 and 20 to find the income of Lily and assign it to the variable incomeLily.
  3. Find the greater income using the function max() and girls’ incomes as the parameters, and assign the result to the variable maximumIncome.
  4. Print the variable maximumIncome.
  5. Find the sum of girls’ incomes and assign the result to the variable sum.
  6. Print the variable sum.

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

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

Секція 2. Розділ 9
toggle bottom row

Challenge

Let's practice!

Завдання

Tracy sells apples for 1.5$ per one and she has in total 30 apples. Lily sells oranges, for 2$ per one and she has 20 oranges. Find how much will each of the girls earn if they sell all fruits. Which of them will earn more and the sum of their incomes.

  1. Assign the multiplication of 1.5 and 30 to find the income of Tracy and assign it to the variable incomeTracy.
  2. Assign the multiplication of 2 and 20 to find the income of Lily and assign it to the variable incomeLily.
  3. Find the greater income using the function max() and girls’ incomes as the parameters, and assign the result to the variable maximumIncome.
  4. Print the variable maximumIncome.
  5. Find the sum of girls’ incomes and assign the result to the variable sum.
  6. Print the variable sum.

Завдання

Tracy sells apples for 1.5$ per one and she has in total 30 apples. Lily sells oranges, for 2$ per one and she has 20 oranges. Find how much will each of the girls earn if they sell all fruits. Which of them will earn more and the sum of their incomes.

  1. Assign the multiplication of 1.5 and 30 to find the income of Tracy and assign it to the variable incomeTracy.
  2. Assign the multiplication of 2 and 20 to find the income of Lily and assign it to the variable incomeLily.
  3. Find the greater income using the function max() and girls’ incomes as the parameters, and assign the result to the variable maximumIncome.
  4. Print the variable maximumIncome.
  5. Find the sum of girls’ incomes and assign the result to the variable sum.
  6. Print the variable sum.

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

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

Секція 2. Розділ 9
toggle bottom row

Challenge

Let's practice!

Завдання

Tracy sells apples for 1.5$ per one and she has in total 30 apples. Lily sells oranges, for 2$ per one and she has 20 oranges. Find how much will each of the girls earn if they sell all fruits. Which of them will earn more and the sum of their incomes.

  1. Assign the multiplication of 1.5 and 30 to find the income of Tracy and assign it to the variable incomeTracy.
  2. Assign the multiplication of 2 and 20 to find the income of Lily and assign it to the variable incomeLily.
  3. Find the greater income using the function max() and girls’ incomes as the parameters, and assign the result to the variable maximumIncome.
  4. Print the variable maximumIncome.
  5. Find the sum of girls’ incomes and assign the result to the variable sum.
  6. Print the variable sum.

Завдання

Tracy sells apples for 1.5$ per one and she has in total 30 apples. Lily sells oranges, for 2$ per one and she has 20 oranges. Find how much will each of the girls earn if they sell all fruits. Which of them will earn more and the sum of their incomes.

  1. Assign the multiplication of 1.5 and 30 to find the income of Tracy and assign it to the variable incomeTracy.
  2. Assign the multiplication of 2 and 20 to find the income of Lily and assign it to the variable incomeLily.
  3. Find the greater income using the function max() and girls’ incomes as the parameters, and assign the result to the variable maximumIncome.
  4. Print the variable maximumIncome.
  5. Find the sum of girls’ incomes and assign the result to the variable sum.
  6. Print the variable sum.

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

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

Let's practice!

Завдання

Tracy sells apples for 1.5$ per one and she has in total 30 apples. Lily sells oranges, for 2$ per one and she has 20 oranges. Find how much will each of the girls earn if they sell all fruits. Which of them will earn more and the sum of their incomes.

  1. Assign the multiplication of 1.5 and 30 to find the income of Tracy and assign it to the variable incomeTracy.
  2. Assign the multiplication of 2 and 20 to find the income of Lily and assign it to the variable incomeLily.
  3. Find the greater income using the function max() and girls’ incomes as the parameters, and assign the result to the variable maximumIncome.
  4. Print the variable maximumIncome.
  5. Find the sum of girls’ incomes and assign the result to the variable sum.
  6. Print the variable sum.

Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Секція 2. Розділ 9
Перейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
We're sorry to hear that something went wrong. What happened?
some-alt