Write a Java program correctly that generates a receipt for a delivery company, called “Montréal Delivery Express” that delivers goods to its clients. The company is located in Montréal and operates only in Québec. Write a program which: 1. Display a welcome message. 2. Then prompts the user to enter the following • First name of the client. • Last name of the client. • Address of the client (include street number, street name and apt number if applicable). • City of the client. • Postal code of the client. • Day of delivery. • Month of delivery. • Year of delivery. • Distance from source to destination in kilometers. • Value of the goods to be delivered. 3. Generate the receipt based on the information entered by the user above, see a sample output in the next page. First the receipt should display the Company name followed by the delivery date. Then, the first name and last name of the client. The first letter in first name and last name should be displayed in Upper Case letters and the rest should be displayed in Lower Case letters. Then, the full address should be displayed (include street, city, province and postal code). Province should be displayed as QC and Postal code should be displayed in Upper Case letters. Next, the value of the goods should be displayed followed by the delivery fees, then the TPS value, then the TVQ value and finally the Total value of the bill. The delivery fees are calculated based on the distance from the source to the destination where each kilometer is charged 55 cents. The TPS is calculated based on the sum of the value of goods and the delivery fees with a rate of 5%. The TVQ is calculated based on the sum of the value of the goods and the delivery fees with a rate of 9.975%. The total of the bill is calculated based on the sum of the value of the goods and the delivery fee and the TPS value and the TVQ value. The TPS and TVQ numbers associated with the company should be displayed on the receipt with values 12345 6789 RT0001 and 1234567890 TQ0020 respectively. For example, if sub total is 100 $, and distance is 10 KM, then Delivery Fees = 10 * 0.55 = 5.5 TPS = (100 + 5.5) * 0.05 = 105.5 * (5 / 100) = 5.28 TVQ = (100 + 5.5) * 0.09975 = 105.5 * (9.975 / 100) = 10.52 Total = 100 + 5.5 + 5.28 + 10.52 = 121.3
Write a Java program correctly that generates a receipt for a delivery company, called “Montréal Delivery
Express” that delivers goods to its clients. The company is located in Montréal and operates only
in Québec.
Write a program which:
1. Display a welcome message.
2. Then prompts the user to enter the following
• First name of the client.
• Last name of the client.
• Address of the client (include street number, street name and apt number if applicable).
• City of the client.
• Postal code of the client.
• Day of delivery.
• Month of delivery.
• Year of delivery.
• Distance from source to destination in kilometers.
• Value of the goods to be delivered.
3. Generate the receipt based on the information entered by the user above, see a sample output
in the next page. First the receipt should display the Company name followed by the delivery
date. Then, the first name and last name of the client. The first letter in first name and last name
should be displayed in Upper Case letters and the rest should be displayed in Lower Case
letters. Then, the full address should be displayed (include street, city, province and postal
code). Province should be displayed as QC and Postal code should be displayed in Upper Case
letters. Next, the value of the goods should be displayed followed by the delivery fees, then
the TPS value, then the TVQ value and finally the Total value of the bill.
The delivery fees are calculated based on the distance from the source to the destination where
each kilometer is charged 55 cents.
The TPS is calculated based on the sum of the value of goods and the delivery fees with a rate
of 5%.
The TVQ is calculated based on the sum of the value of the goods and the delivery fees with a
rate of 9.975%.
The total of the bill is calculated based on the sum of the value of the goods and the delivery
fee and the TPS value and the TVQ value.
The TPS and TVQ numbers associated with the company should be displayed on the receipt
with values 12345 6789 RT0001 and 1234567890 TQ0020 respectively.
For example, if sub total is 100 $, and distance is 10 KM, then
Delivery Fees = 10 * 0.55 = 5.5
TPS = (100 + 5.5) * 0.05 = 105.5 * (5 / 100) = 5.28
TVQ = (100 + 5.5) * 0.09975 = 105.5 * (9.975 / 100) = 10.52
Total = 100 + 5.5 + 5.28 + 10.52 = 121.3
![Welcome to the Receipt Generator:
Please enter the client info:
First Name ? ALFRED
Last Name ? leblanc
Address ? 123 Queen Mary Apt 45
City ? Montréal
Postal Code ? alb2c3
Please enter the delivery info:
Day of delivery (between 1 and 31) ? 17
Month of delivery (between 1 and 12) ? 12
Year of delivery (between 2020 and 2021) ? 2021
Distance from source to destination in kilometers ? 28.4
Value of the goods ? 92.85
Montréal Delivery Express
17 / 12 / 2021
Alfred Leblanc
123 Queen Mary Apt 45
Montréal, QC, A1B2C3
Sub-total
92.85 $
15.62 $
5.42 $
10.82 $
Delivery Fees (55 Cents * 28.4 KM)
No 12345 6789 RTO001 - 5 %
TPS
TVQ No 1234567890 TQØ020 - 9.975 %
Total
124.71 $
Thank you for choosing Montréal Delivery Express.
Receipt generated successfully.
Figure 2. Sample output screen for Question 2
Note: Your program must display the same information but can be formatted differently.](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2Fd3be9fc5-49dc-4987-93dc-30b0d6519ab7%2Fc814b3fb-f3b1-49bd-8c3a-6da657986fd5%2Fvjl5w0s_processed.png&w=3840&q=75)
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Starting Out with Python (4th Edition)](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Digital Fundamentals (11th Edition)](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![C How to Program (8th Edition)](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Database Systems: Design, Implementation, & Manag…](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Programmable Logic Controllers](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)