Peso Converter Create a PesoCurrency Class with an amount attribute. Define an overloaded convertTo method that will convert the amount attribute to Dollars or Euros. Assume that 1 dollar is equivalent to 50 pesos while 10 dollars is equivalent to 2 Euros. Implement the class in a computer program that will ask the user an amount in Peso to convert. The program should be able to display the Dollar and Euro equivalent of the input Peso amount. For this exercise, you are required to apply all OOP concepts that you learned in class.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Peso Converter
Create a PesoCurrency Class with an amount attribute. Define an overloaded convertTo method that will convert the amount attribute to Dollars or Euros. Assume that 1 dollar is equivalent to 50 pesos while 10 dollars is equivalent to 2 Euros. Implement the class in a computer
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images