Question: QUESTION 2 Write a program that user may select to convert Ringgit Malaysia (RM) to Singapore Dollar (SGD), to Indonesian Rupiah(IDR) or to Thai Baht

QUESTION 2 Write a program that user may select to convert Ringgit Malaysia (RM) to Singapore Dollar (SGD), to Indonesian Rupiah(IDR) or to Thai Baht (THB). main() method: A. Call method displayMenu(). B. Prompt the user to enter his/her choice. C. Check the choice (use while structure if choice is 0, execute E) Ask user to enter RM amount to convert to. If the user selects menu 1: o Call method toSGD() and pass the RM amount as the parameter. If the user selects menu 2: o Call method toIDR() and pass the RM amount as the parameter. If the user selects menu 3: o Call method named toTHB() and pass the RM amount as the parameter. Display the conversion. Call method displayMenu() again. Prompt the user to enter his/her choice. D. Repeat (C ) steps if user enters 1 or 2 or 3. E. Stop the program if user enters 0. Methods definition: Method displayMenu(): This void method is to display a menu: (may refer to the sample output). 1. Convert to Singapore Dollar (SGD) 2. Convert to Indonesian Rupiah (IDR) 3. Convert to Thai Baht (THB) 0. Exit Program Method toSGD(): This method converts the RM amount to SGD. Write the formula accordingly (RM1.00 is equivalent to S$0.33) Return the result to the caller (main). Method toIDR(): This method converts the RM amount to IDR. Write the formula accordingly (RM1.00 is equivalent to Rp3465.14) Return the result to the caller (main). Method toTHB(): This method converts the RM amount to THB. Write the formula accordingly (RM1.00 is equivalent to B7.38) Return the result to the caller (main). Sample output: QUESTION 2 Write a program that user may select to convert Ringgit

run: D> DD MENU RM Converter 1. Convert to Singapore Dollar (SGD) 2. Convert to Indonesian Rupiah (IDR) 3. Convert to Thai Baht (THB) 0. Exit program Please enter you choice : 3 Please enter the RM amount : 25.50 RM 25.50 is equivalent to 3188.19 MENU RM Converter 1. Convert to Singapore Dollar (SGD) 2. Convert to Indonesian Rupiah (IDR) 3. Convert to Thai Baht (THB) 0. Exit program Please enter your choice : 2 Please enter the RM amount : 500.00 RM 500.00 is equivalent to Rp1732570.00 MENU RM Converter 1. Convert to Singapore Dollar (SGD) 2. Convert to Indonesian Rupiah (IDR) 3. Convert to Thai Baht (THB) 0. Exit program Please enter your choice : 0 Program end

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!