main module Module main() // Local variables Declare Real weight, shipping // Get package weight Call getWeight(weight) // Calculate the shipping charge Call setShipping(weight, shipping) // Display shipping charge Call showShipping(shipping)
// main module
Module main()
// Local variables
Declare Real weight, shipping
// Get package weight
Call getWeight(weight)
// Calculate the shipping charge
Call setShipping(weight, shipping)
// Display shipping charge
Call showShipping(shipping)
End Module
// The getWeight module gets package weight and stores it
// in the inputWeight reference variable.
Module getWeight(Real Ref inputWeight)
Display “Enter package weight: ”
Input inputWeight
End Module
// The setShipping module sets the shipping charge and stores it
// in the calcShipping reference variable.
Module setShipping(Real weight, Ref calcShipping)
If weight > 10 Then
Set calcShipping = 3.80
Else
If weight > 6 Then
Set calcShipping = 3.70
Else
If weight > 2 Then
Set calcShipping = 2.20
Else
Set calcShipping = 1.10
End If
End Module
// The showShipping module accepts shipping as argument
// and displays the amount
Module showShipping(Real shipping)
Display "Shipping charge: $", shipping
End Module
I want to learn about
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
![Programming with Microsoft Visual Basic 2017](https://www.bartleby.com/isbn_cover_images/9781337102124/9781337102124_smallCoverImage.gif)