Skip to content

Commit 124ee5b

Browse files
committed
finsih quiz3
1 parent 773cac0 commit 124ee5b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

exercises/quiz3.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818

1919
// I AM NOT DONE
2020

21-
pub struct ReportCard {
22-
pub grade: f32,
21+
pub struct ReportCard<T> {
22+
pub grade: T,
2323
pub student_name: String,
2424
pub student_age: u8,
2525
}
2626

27-
impl ReportCard {
27+
impl<T: std::fmt::Display> ReportCard<T> {
2828
pub fn print(&self) -> String {
2929
format!("{} ({}) - achieved a grade of {}",
3030
&self.student_name, &self.student_age, &self.grade)
@@ -52,7 +52,7 @@ mod tests {
5252
fn generate_alphabetic_report_card() {
5353
// TODO: Make sure to change the grade here after you finish the exercise.
5454
let report_card = ReportCard {
55-
grade: 2.1,
55+
grade: "A+",
5656
student_name: "Gary Plotter".to_string(),
5757
student_age: 11,
5858
};

0 commit comments

Comments
 (0)