Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can this please be done in C Write a program to determine the charges to ship a package. Ask the user for the weight of

image text in transcribed

Can this please be done in C

Write a program to determine the charges to ship a package. Ask the user for the weight of a package. Based on the weight of the package, it will be charged as shown below: Validate that the weight of the package greater than 0.0 pounds, and if not inform the user and exit the program. Create constants for the cutoff values of 2.0,6.0, and 10.0 pounds, the value of 0.0, and for the 4 shipping charges, and use the constants in the validation decision, the validation error message, and in the shipping charge decisions. Format the shipping charges to 2 decimal places. The decisions for the shipping charges should just assign the charge to a variable, and the program should just have 1 printf () statement to display the shipping charge. Example Run \#1: (bold type is what is entered by the user) Enter the weight of the package: 2.5 The shipping charge is $xxx. Example Run \#2: Enter the weight of the package: 0 The weight of the package must be greater than 0.00. The example runs show EXACTLY how your program input and output will look

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_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

Relational Database Design A Practical Approach

Authors: Marilyn Campbell

1st Edition

1587193175, 978-1587193170

More Books

Students also viewed these Databases questions