From ec8aefc4b92141fa6ccaf51d6655ac5d13e47101 Mon Sep 17 00:00:00 2001 From: "David E. Perez Negron R." Date: Sun, 12 May 2024 21:30:09 -0600 Subject: [PATCH] quiz3 done --- exercises/quiz3.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/exercises/quiz3.rs b/exercises/quiz3.rs index 3b01d31..62d4872 100644 --- a/exercises/quiz3.rs +++ b/exercises/quiz3.rs @@ -16,15 +16,15 @@ // // Execute `rustlings hint quiz3` or use the `hint` watch subcommand for a hint. -// I AM NOT DONE +use std::fmt::Display; -pub struct ReportCard { - pub grade: f32, +pub struct ReportCard { + pub grade: T, pub student_name: String, pub student_age: u8, } -impl ReportCard { +impl ReportCard { pub fn print(&self) -> String { format!("{} ({}) - achieved a grade of {}", &self.student_name, &self.student_age, &self.grade) @@ -52,7 +52,7 @@ mod tests { fn generate_alphabetic_report_card() { // TODO: Make sure to change the grade here after you finish the exercise. let report_card = ReportCard { - grade: 2.1, + grade: "A+", student_name: "Gary Plotter".to_string(), student_age: 11, };