diff options
| author | mo8it <mo8it@proton.me> | 2024-07-05 15:38:59 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-05 15:38:59 +0200 |
| commit | 65834fc42012cb6c0412757b830294e9af26549f (patch) | |
| tree | 51abbacbf2192cde3f13d0eab37bd38f44095787 /solutions | |
| parent | f5a4965de7174e122c5d99ec0a300285d0a0c658 (diff) | |
Improve quizes
Diffstat (limited to 'solutions')
| -rw-r--r-- | solutions/quizzes/quiz1.rs | 5 | ||||
| -rw-r--r-- | solutions/quizzes/quiz2.rs | 7 | ||||
| -rw-r--r-- | solutions/quizzes/quiz3.rs | 4 |
3 files changed, 2 insertions, 14 deletions
diff --git a/solutions/quizzes/quiz1.rs b/solutions/quizzes/quiz1.rs index bc76166..5503c8c 100644 --- a/solutions/quizzes/quiz1.rs +++ b/solutions/quizzes/quiz1.rs @@ -1,8 +1,7 @@ // Mary is buying apples. The price of an apple is calculated as follows: // - An apple costs 2 rustbucks. -// - If Mary buys more than 40 apples, each apple only costs 1 rustbuck! -// Write a function that calculates the price of an order of apples given the -// quantity bought. +// - However, if Mary buys more than 40 apples, the price of each apple in the +// entire order is reduced to only 1 rustbuck! fn calculate_price_of_apples(n_apples: u64) -> u64 { if n_apples > 40 { diff --git a/solutions/quizzes/quiz2.rs b/solutions/quizzes/quiz2.rs index 0d2a513..2f5cc05 100644 --- a/solutions/quizzes/quiz2.rs +++ b/solutions/quizzes/quiz2.rs @@ -1,10 +1,3 @@ -// This is a quiz for the following sections: -// - Strings -// - Vecs -// - Move semantics -// - Modules -// - Enums -// // Let's build a little machine in the form of a function. As input, we're going // to give a list of strings and commands. These commands determine what action // is going to be applied to the string. It can either be: diff --git a/solutions/quizzes/quiz3.rs b/solutions/quizzes/quiz3.rs index e3413fd..7b91278 100644 --- a/solutions/quizzes/quiz3.rs +++ b/solutions/quizzes/quiz3.rs @@ -1,7 +1,3 @@ -// This quiz tests: -// - Generics -// - Traits -// // An imaginary magical school has a new report card generation system written // in Rust! Currently, the system only supports creating report cards where the // student's grade is represented numerically (e.g. 1.0 -> 5.5). However, the |
