Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. impl Currency {
  2. fn to_won(&mut self, amount: i32) -> i32 {
  3. self.exchange_rate = 1200;
  4. self.exchange_rate * amount
  5. }
  6. }
  7.  
  8. fn main() {
  9. let dollar: Currency = Currency {
  10. currency_symbol: '$',
  11. exchange_rate: 1100
  12. };
  13. println!("{}", dollar.to_won(200));
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement