Contenido del Curso
Introduction to C++
Introduction to C++
1. Basics
Challenge
Let's practice!
Tarea
Swipe to begin your solution
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.
- Assign the multiplication of
1.5
and30
to find the income of Tracy and assign it to the variableincomeTracy
. - Assign the multiplication of
2
and20
to find the income of Lily and assign it to the variableincomeLily
. - Find the greater income using the function
max()
and girls’ incomes as the parameters, and assign the result to the variablemaximumIncome
. - Print the variable
maximumIncome
. - Find the sum of girls’ incomes and assign the result to the variable
sum
. - Print the variable
sum
.
Solución
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 9
Challenge
Let's practice!
Tarea
Swipe to begin your solution
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.
- Assign the multiplication of
1.5
and30
to find the income of Tracy and assign it to the variableincomeTracy
. - Assign the multiplication of
2
and20
to find the income of Lily and assign it to the variableincomeLily
. - Find the greater income using the function
max()
and girls’ incomes as the parameters, and assign the result to the variablemaximumIncome
. - Print the variable
maximumIncome
. - Find the sum of girls’ incomes and assign the result to the variable
sum
. - Print the variable
sum
.
Solución
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 2. Capítulo 9
Cambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones