Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In a Lebanese store, the seller will let you choose between 2 payment options. Option 1: to pay your total in Lebanese Lira at

 

In a Lebanese store, the seller will let you choose between 2 payment options. Option 1: to pay your total in Lebanese Lira at the dollar rate of 18000. Option 2: to pay part of your total in fresh dollar and the second part in Lebanese Lira with a different rate. Write a program that will ask the user to enter the total in dollar and to choose an option (1 or 2). Java langauge If the user choose 1 the program should display the total amount due in $ and the equivalent in L.L. The amount in L.L can be calculated as follow: Amount in LL = Total * 18000 If the user choose 1, the program should ask the user about how much percentage he will pay in fresh $ and what is the dollar rate for this option. The program should then display the total amount due in fresh $, and the total amount due in L.L. The amount in $ can be calculated as follow: Amount in $ = Total * percentage The amount in L.L can be calculated as follow: Amount in LL = Total * (1 - percentage) * dollar rate Below is a sample run : Sample Run1: Enter the total in $: 1000 Option 1: pay the full amount in L.L. Option 2: pay part in $ and part in L.L. Please choose an option (1 or 2): 1 Your total 1000$ is equivalent to a payment of 18000000.0 L.L. Sample Run2 : Enter the total in $: 1000 Option 1: pay the full amount in L.L. Option 2: pay part in $ and part in L.L. Please choose an option (1 or 2): 2 Enter the percentage of fresh dollar payment: 0.3 Enter the new dollar rate: 15000 Your total due payment is 300.0$ and 10500000.0 L.L Sample Run3: Enter the total in $: 1000 Option 1: pay the full amount in L.L. Option 2: pay part in $ and part in L.L. Please choose an option (1 or 2): 4 Invalid option.

Step by Step Solution

3.47 Rating (170 Votes )

There are 3 Steps involved in it

Step: 1

import javautilScanner public class Main public static void mainString args int totalchnewdollar... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Document Format ( 2 attachments)

PDF file Icon
635f6c6fa1169_231853.pdf

180 KBs PDF File

Word file Icon
635f6c6fa1169_231853.docx

120 KBs Word File

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals of Futures and Options Markets

Authors: John C. Hull

8th edition

978-1292155036, 1292155035, 132993341, 978-0132993340

More Books

Students also viewed these Programming questions

Question

Determine miller indices of plane X z 2/3 90% a/3

Answered: 1 week ago