Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help me to solve these questions: and these are the outputs: The Red Sea Logistics offers national and international freight services to its customers.

please help me to solve these questions:

image text in transcribedimage text in transcribed

and these are the outputs:

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

The Red Sea Logistics offers national and international freight services to its customers. The company needs a program that allows the customers to calculate national and international shipment cost. There are different rates for different freight types and shipment weight categories. For instance, the rate is higher for low weight parcels, while international freight rates are higher than national freight rates. Similarly, air freight cost is higher than sea freight. The total shipment cost also includes tax and insurance amount. Details of all these rates and categories are shown in the Table 1 Write a Java program that prompts the user to enter the scope of cargo (National or International), the freight type National, Sea, and Air), the actual cargo weight in KGs and then other required information such as name, phone number, address etc. The progra m then displays results as shown in the sample output file. Hint: You should study the sample runs (output) of the program to identify for yourself what is required. Input validation The user has to enter Nat (Upper case or lower), or Int (Upper case or lower) for shipment scope, or Exit (Upper case or lower) for exiting from the program. Then, user will enter R or r (for Road freight), S or s (for Sea freight), A or a (for Air freight). Please note that Road freight is not available for international cargo while Sea freight is not available for national cargo as shown in the given Table 1 as well as in the sample input/output file. Next, the user will enter the remaining information. 1. If the user inputs a word that is not recognized (NOT Nat, Int or Exit) for shipment scope, then the program 2. If the user inputs a character that is not recognized (NOT from R, r, S, s, A, or a) for freight type, then the 3. If the user inputs incorrect values for other information, the program displays "Sorry! Wrong input!", and exits. displays Wrong Selection of shipment scope!", and exits. program displays Wrong selection offreight type!", and exits. 4. You have to check the entered information with the corresponding requirements according to the data mentioned in the given Table 1 In case of International Sea freight, more than 10000KG will be automatically shipped as container. One container can hold a maximum of 25000KG. The system will automatically calculate the number of required containers as per entered weight. The program output should be similar to the one shown below. You should strictly make sure your output is 100% identical to the given output. 5. 6. xample on how to calculate the cost based on scope and freight t Example 1: Suppose a customer wish to ship 29.3 KG parcel to other country via Air freight. Shipment Cost- Weight x Rate Total Shipment Cost-Shipment Cost + Tax on Shipment Cost + Insurance Fee Total Shipment Cost-(29.3 x 12.5) +23.81 50440 SAR (Note: The total shipment cost is rounded) . Example 2: Suppose a customer wish to ship 170 KG parcel to other city within same country via Road freight. Shipment Cost- Weight x Rate Total Shipment Cost-Shipment Cost + Tax on Shipment Cost + Insurance Fee Total Shipment Cost-(170 x 2.5)+ 21.25 15 461 SAR Example 3: Suppose a customer wish to ship 148 KG of luggage to other country via Sea freight. Total Shipment Cost-Shipment Cost +Tax on Shipment Cost+Insurance Fee Total Shipment Cost = (148 x 4) + 38.48 + 50 680 SAR

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions