Salaries
We'll cover the following...
Let’s say that teachers make $50, scientists make $70, and students don’t make any money. We can write a method to help with that:
Press + to interact
enum Job {Teacher,Scientist,Student,}impl Job {fn salary(&self) -> Option<u32> {match self {Job::Teacher => Some(50),Job::Scientist => Some(70),Job::Student => None,}}}
We want to find out how much money two people will make together. ...
Access this course and 1400+ top-rated courses and projects.