Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

29. Write a program in a script file that calculates the cost of renting a car according to the following price schedule Sedan SUV Duration

image text in transcribed
29. Write a program in a script file that calculates the cost of renting a car according to the following price schedule Sedan SUV Duration of rent Daily rate Free miles (per day) Cost of additional mile Daily Free miles (per Cost of additional mile rate day) 1-6 days 7-29 days 30 or more days $79 $69 $59 80 100 120 $0.69 $0.59 $0.49 $84 $74 $64 80 100 120 $0.74 $0.64 $0.54 The program asks the user to enter the type of car (sedan or SUV), the number of days, and the number of miles driven. The program then displays the cost (rounded to cents) for the rent Run the program three times for the following cases (a) Sedan 10 days, 769 miles. (b) SUV, 32 days, 4,056 miles (c) Sedan 3 days, 511 miles

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

Semantics Of A Networked World Semantics For Grid Databases First International Ifip Conference Icsnw 2004 Paris France June 2004 Revised Selected Papers Lncs 3226

Authors: Mokrane Bouzeghoub ,Carole Goble ,Vipul Kashyap ,Stefano Spaccapietra

2004 Edition

3540236090, 978-3540236092

More Books

Students also viewed these Databases questions