Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In Ruby Task: Write a program that asks the user to enter a shipping weight and then calculates shipping charge based on that weight Discussion:
In Ruby
Task: Write a program that asks the user to enter a shipping weight and then calculates shipping charge based on that weight Discussion: Most shipping companies calculate shipping charges for a particular order based on the weight of the ordered items. In this program, you are to ask the user to enter a shipping weight for an item. Then, the program should calculate the expected shipping charge based on the item's weight. Use the following criteria to determine the shipping charge: . An item that weighs less than 2 pounds has a shipping cost of S3.25 per pound. An item that weighs between 2 and 4.9 pounds inclusive has a shipping cost An item that weighs between 5 and 9.9 pounds inclusive has a shipping cost An item that weighs between 10 and 24.9 pounds inclusive has a shipping cost . An item that weighs 25 pounds or more has a flat rate shipping cost of $75.00 of $3.00 per pound. of $2.75 per pound. of $2.50 per pound. Criteria: Submissions must adhere to the criteria specified in the syllabus. Re- member to use meaningful variable names; keep in mind the type of data for your input, and include all required comments and make good comments throughout your program Your program should run like this $ ruby cs140mod4hw_v2.rb Enter the item weight in pounds: 1.7 The shipping cost is $5.5:3Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started