Questions
Project #2 ## Language Should be Python. Using for, while, if, elif only. No advanced functions....

Project #2

## Language Should be Python. Using for, while, if, elif only. No advanced functions.

Assignment Specifications

The program will compute and display information for a company which rents vehicles to its customers. For a specified customer, the program will compute and display the amount of money charged for that customer’s vehicle rental.

  1. The program should start by asking the user if he wants to continue. The answer is ‘Y’ for yes or ‘N’ for no.

The basic structure of the main loop is

Prompt to see if the user wants to continue

While the value is ‘Y’:

All your other code goes here

Prompt to see if the user wants to continue

  1. It will then continue to prompt the user to enter the following four items for a given customer (in the specified order):
    1. The customer's classification code (a character)
    1. The number of days the vehicle was rented (an integer)
    1. The vehicle's odometer reading at the start of the rental period (an integer)
    1. The vehicle's odometer reading at the end of the rental period (an integer)

It will then process that customer information and display the results. At the end, the program should ask the user if he wants to process another request and it will keep asking until the user enter 0.

  1. The program will compute the amount of money that the customer will be billed, based on the customer's classification code, number of days in the rental period, and number of miles driven. The program will recognize both upper case and lower case letters for the classification codes.

Code 'B' (budget)

base charge: $40.00 for each day

mileage charge: $0.25 for each mile driven

Code 'D' (daily)

base charge: $60.00 for each day

mileage charge: no charge if the average number of miles driven per day is 100 miles or less; otherwise, $0.25 for each mile driven above the 100 mile per day limit.

Code 'W' (weekly)

base charge: $190.00 for each week (or fraction of a week)

mileage charge: no charge if the average number of miles driven per week is 900 miles or less; $100.00 per week if the average number of miles driven per week exceeds 900 miles but does not exceed 1500 miles; otherwise, $200.00 per week plus $0.25 for each mile driven above the 1500 mile per week limit.

The amount billed to the customer is the sum of the base charge and the mileage charge.

  1. The program will compute the number of miles driven by the customer during the rental period. The odometer readings are taken from an odometer which has six digits and records tenths of a mile.
  2. For each customer, the program will display a summary with the following information:
    1. The customer's classification code
    1. The number of days the vehicle was rented
    1. The vehicle's odometer reading at the start of the rental period
    1. The vehicle's odometer reading at the end of the rental period
    1. The number of miles driven during the rental period
    1. The amount of money billed to the customer for the rental period

All output will be appropriately labeled and formatted. The number of miles driven will be rounded to one fractional digit. The amount of money billed will be displayed with a dollar sign and will be rounded to two fractional digits (for example, $125.99 or $43.87). Note that we do not have the ability yet to fine tune the output so if cents end in zero that final zero will not be

displayed—that is fine for this project. We provide a file strings.txt with the strings we used to make it easier for you to match our output.

  1. The program will detect, report and recover from invalid classification codes. When an invalid classification code is detected, the program will display an error message and re-prompt until a correct classification code is entered.

Hint: use a while loop that will loop until a correct classification code is entered. Here is pseudo code of that loop:

Prompt for a value

While the value is not correct:

Print an error message

Prompt for a value

  1. The program will assume that all other user inputs are valid and correct. That is, the program will not check the number of days or odometer readings for validity. However, as noted below you may encounter an ending odometer reading that is less than the beginning reading and you need to handle that correctly.

Assignment Notes

  1. As stated above, the odometer's dial has six digits and records tenths of a mile. For example, if the beginning reading was 100003 and the ending reading was 100135, then the customer drove 13.2 miles during the rental period.
  2. Since the odometer’s dial is fixed with only six digits, the reading at the end of the rental period may be less than the reading at the beginning of the billing period. For example, if the beginning reading was 999997 and the ending reading was 000005, then the customer drove 0.8 miles during the rental period. You need to handle that arithmetic correctly.

Test 1

Welcome to car rentals.

At the prompts, please enter the following:

Customer's classification code (a character: BDW)

Number of days the vehicle was rented (int)

Odometer reading at the start of the rental period (int)

Odometer reading at the end of the rental period (int)

Would you like to continue (Y/N)? N

Thank you for your loyalty.

Test 2

Welcome to car rentals.

At the prompts, please enter the following:

Customer's classification code (a character: BDW)

Number of days the vehicle was rented (int)

Odometer reading at the start of the rental period (int)

Odometer reading at the end of the rental period (int)

Would you like to continue (Y/N)? Y

Customer code (BDW): D

Number of days: 1

Odometer reading at the start: 100003

Odometer reading at the end:      100135

Customer summary:

classification code: D

rental period (days): 1

odometer reading at start: 100003

odometer reading at end:      100135

number of miles driven:    13.2

amount due: $ 60.0

Would you like to continue (Y/N)? Y

Customer code (BDW): D

Number of days: 4

Odometer reading at the start: 101010

Odometer reading at the end:      108200

Customer summary:

classification code: D

rental period (days): 4

odometer reading at start: 101010

odometer reading at end:      108200

number of miles driven:    719.0

amount due: $ 319.75

Would you like to continue (Y/N)? Y

Customer code (BDW): D

Number of days: 2

Odometer reading at the start: 002000

Odometer reading at the end:      004000

Customer summary:

classification code: D

rental period (days): 2

odometer reading at start: 2000

odometer reading at end:      4000

number of miles driven:    200.0

amount due: $ 120.0

Would you like to continue (Y/N)? Y

Customer code (BDW): B

Number of days: 3

Odometer reading at the start: 999997

Odometer reading at the end:      000005

Customer summary:

classification code: B

rental period (days): 3

odometer reading at start: 999997

odometer reading at end:      5

number of miles driven: 0.8

amount due: $ 120.2

Would you like to continue (Y/N)? N

Thank you for your loyalty.

Test 5

Welcome to car rentals.

At the prompts, please enter the following:

Customer's classification code (a character: BDW)

Number of days the vehicle was rented (int)

Odometer reading at the start of the rental period (int)

Odometer reading at the end of the rental period (int)

Would you like to continue (Y/N)? Y

Customer code (BDW): x

*** Invalid customer code. Try again. ***

Customer code (BDW): y

*** Invalid customer code. Try again. ***

In: Computer Science

1. Suppose a car driven under specific conditions gets a mean gas mileage of 40 miles...

1. Suppose a car driven under specific conditions gets a mean gas mileage of 40 miles per gallon with a standard deviation of 3 miles per gallon. On about what percentage of the trips will your gas mileage be above 43 miles per gallon?

A.About 68%, because 43 miles per gallon is 2 std. deviations above the mean. By the 68-95-99.7 rule, about 68% of the distribution lies within 2 std. deviations of the mean.

B.About 68%, because 43 miles per gallon is 1 std. deviation above the mean. By the 68-95-99.7 rule, about 68% of the distribution lies within 1 std. deviation of the mean.

C.About 16%, because 43 miles per gallon is 1 std. deviation above the mean. By the 68-95-99.7 rule, about 16% of the distribution lies within 1 std. deviation of the mean.

D.About 2.5%, because 43 miles per gallon is 2 std. deviations above the mean. By the 68-95-99.7 rule, about 2.5% of the distribution lies within 2 std. deviations of the mean.

E.About 16%, because 43 miles per gallon is 1 std. deviation above the mean. By the 68-95-99.7 rule, about 68% of the distribution lies within 1 std. deviation of the mean. So 32% lies outside of this range, 16% in each tail.

F.About 2.5%, because 43 miles per gallon is 2 std. deviations above the mean. By the 68-95-99.7 rule, about 95% of the distribution lies within 2 std. deviations of the mean. So 5% lies outside of this range, 2.5% in each tail.

2.Assume that a set of test scores is normally distributed with a mean of 80 and a standard deviation of 25. Use the 68-95-99.7 rule to find the following quantities.

a. The percentage of scores less than 80 is ___________%. (Round to one decimal place as needed.)

b. The percentage of scores greater than 105 is _____________%. (Round to one decimal place as needed.)

c. The percentage of scores between 30 and 105 is ___________%.(Round to one decimal place as needed.)

3.Working with equal sample sizes, researchers compared three new cold remedies to a placebo. Which remedy is most likely to be most effective? Explain.

A.The one that gave results statistically significant at the 0.01 level, because the remedy was successful in so many people that the chance of at least this much success would be greater than 0.01, if the remedy were no better than the placebo.

B.The one that gave results that were not statistically significant, because the other tests do not produce positive results.

C.The one that gave results that were not statistically significant, because statistically significant results would indicate that the test was not performed correctly.

D.The one that gave results statistically significant at the 0.05 level, because the remedy was successful in so many people that the chance of at least this much success would be greater than 0.05, if the remedy were no better than the placebo.

E.The one that gave results statistically significant at the 0.01 level, because the remedy was successful in so many people that the chance of at least this much success would be less than 0.01, if the remedy were no better than the placebo.

F.The one that gave results statistically significant at the 0.05 level, because the remedy was successful in so many people that the chance of at least this much success would be less than 0.05, if the remedy were no better than the placebo.

In: Statistics and Probability

The average lightning bolt is about 5 miles long and how wide?

The average lightning bolt is about 5 miles long and how wide?

  • 1 inch
  • 2 feet
  • 8 yards
  • 50 feet

In: Physics

A spaceship is in orbit around the earth at an altitude of 12000 miles. Which one...

A spaceship is in orbit around the earth at an altitude of 12000 miles. Which one of the following statements best explains why the astronauts experience weightlessness

In: Physics

When coding in R Studio install.packages("hflights") library(hflights) if filter for flights >= 3000 miles how many...

When coding in R Studio

install.packages("hflights")
library(hflights)

if filter for flights >= 3000 miles how many flights in new dataframe

In: Computer Science

1D Array Function Write a function in MATLAB to convert miles to feet. This function should...

1D Array Function

Write a function in MATLAB to convert miles to feet. This function should work for one number, or an array of numbers to be converted.

In: Computer Science

Develop and test a Python program that converts pounds to grams, inches to centimeters, and kilometers...

Develop and test a Python program that converts pounds to grams, inches to centimeters, and kilometers to miles. The program should allow conversions both ways.

In: Computer Science

Suppose that the sitting​ back-to-knee length for a group of adults has a normal distribution with...

Suppose that the sitting​ back-to-knee length for a group of adults has a normal distribution with a mean of mu equals 23.4 in. and a standard deviation of sigma equals 1.1 in. These data are often used in the design of different​ seats, including aircraft​ seats, train​ seats, theater​ seats, and classroom seats. Instead of using 0.05 for identifying significant​ values, use the criteria that a value x is significantly high if​ P(x or ​greater)less than or equals0.01 and a value is significantly low if​ P(x or ​less)less than or equals0.01. Find the​ back-to-knee lengths separating significant values from those that are not significant. Using these​ criteria, is a​ back-to-knee length of 25.7 in. significantly​ high?

In: Statistics and Probability

A cliché that sums up the concept of diminishing marginal returns/increasing marginal costs is: Question 8...

A cliché that sums up the concept of diminishing marginal returns/increasing marginal costs is:

Question 8 options:

Question 33 (5 points)

Which of the following are examples of price discrimination (select all that apply):

Question 33 options:

A restaurant charges "senior citizens" 15% percent lower prices than other customers.

An airline charges more for first class seats than for economy class seats.

An online retailer charges different prices based on shipping costs.

A theater charges lower prices for matinees (movies shown during the day) than for movies shown in the evening.

You can't have you cake and eat it too.

In: Economics

Talk about the reasons the hotel company Marriott is expanding into markets globally. Describe the motivation...

Talk about the reasons the hotel company Marriott is expanding into markets globally. Describe the motivation for Marriott being a multinational company and talk about current economic implications such as costs, benefits, etc. for the United States of America and any host countries.

At least 200 words, please. Please complete as soon as possible. Thanks in advance!

In: Economics