In this challenge, you will implement a function calculate_area
that computes the area of a rectangle using a given width
and height
. The purpose of this exercise is to practice variable declaration.
You are provided with a helper function prints_values
that takes two parameters, width
and height
, and prints their values. Your task is to call this helper function inside calculate_area
and ensure that the printed values are correct.
The calculate_area
function should:
width
and height
.prints_values
function to display the values of the width
and height
.width
and height
.Do not modify the prints_values
function.
Note: While it is possible to solve the challenge and pass the tests without explicitly declaring variables (e.g., by directly passing values to
prints_values
or using expressions inline), we recommend you practice declaring variables using thelet
keyword.
let
keyword to declare variables in Rust.prints_values
function is invoked with the correct arguments.width
and height
.