Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- impl Currency {
- fn to_won(&mut self, amount: i32) -> i32 {
- self.exchange_rate = 1200;
- self.exchange_rate * amount
- }
- }
- fn main() {
- let dollar: Currency = Currency {
- currency_symbol: '$',
- exchange_rate: 1100
- };
- println!("{}", dollar.to_won(200));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement