Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Pseudocode of the program description by method Project Description Write an application that calculates the shipping charge for a package, based on its weight. The

Pseudocode of the program description by method

Project Description

Write an application that calculates the shipping charge for a package, based on its weight. The user will input the name of the client, a six digit identification code and weight in ounces. The shipping charge is calculated as $0.15 per ounce. Display the user's name, package id, weight in ounces and calculated shipping charge.

Input

Collect the identification code and the weight using a Scanner object. You must prompt the user for the Package Id on the console and then prompt the user for the weight in ounces on the console. Then ask the user for their name via a TextInputDialog dialog box.

Processing

Use appropriate Scanner method(s) so the input is assigned to appropriate variables. The package ID code needs not be calculated, so must be collected as text. The weight will be used in a calculation, and therefore must be assigned to an appropriate whole number variable. You will also retrieve the name from the TextInputDialog. You will calculate the charge by using the shipping rate of $0.15 per ounce

The shipping rate must be stored as a constant.

Output

Display the user's name, the package ID, the weight in ounces and the shipping charge each in separate labels with appropriate labeling information as the sample below shows. In order to display in labels you will have to create a GUI application with GridPane and Label objects. You will be using 8 Label objects - Four for the prompts and four the information

Name John Smith

Package ID 123456 Weight 17 oz. Shipping Cost 2.55

Step by Step Solution

3.46 Rating (146 Votes )

There are 3 Steps involved in it

Step: 1

Here is a sample implementation of the program in Java using JavaFX for the GUI java import javafxapplicationApplication import javafxgeometryInsets i... 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_2

Step: 3

blur-text-image_3

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

Programming With Microsoft Visual Basic 2017

Authors: Diane Zak

8th Edition

1337102121, 9781337517058, 978-1337102124

More Books

Students also viewed these Programming questions