From 65834fc42012cb6c0412757b830294e9af26549f Mon Sep 17 00:00:00 2001 From: mo8it Date: Fri, 5 Jul 2024 15:38:59 +0200 Subject: [PATCH] Improve quizes --- exercises/quizzes/quiz1.rs | 5 ++--- solutions/quizzes/quiz1.rs | 5 ++--- solutions/quizzes/quiz2.rs | 7 ------- solutions/quizzes/quiz3.rs | 4 ---- 4 files changed, 4 insertions(+), 17 deletions(-) diff --git a/exercises/quizzes/quiz1.rs b/exercises/quizzes/quiz1.rs index a79a1624..04fb2aaf 100644 --- a/exercises/quizzes/quiz1.rs +++ b/exercises/quizzes/quiz1.rs @@ -7,11 +7,10 @@ // - An apple costs 2 rustbucks. // - However, if Mary buys more than 40 apples, the price of each apple in the // entire order is reduced to only 1 rustbuck! + // TODO: Write a function that calculates the price of an order of apples given // the quantity bought. - -// Put your function here! -// fn calculate_price_of_apples(???) -> ??? { +// fn calculate_price_of_apples(???) -> ??? { ??? } fn main() { // You can optionally experiment here. diff --git a/solutions/quizzes/quiz1.rs b/solutions/quizzes/quiz1.rs index bc761667..5503c8c7 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 0d2a5132..2f5cc050 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 e3413fd0..7b912782 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