Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a python script that will compute and display information for a company th

ID: 3809926 • Letter: W

Question

Write a python script that will compute and display information for a company that 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 after prompting the user to enter the following four items for a given customer (in the specified order) The customer's classification code (a character either B, D.) The number of days the vehicle was rented (an integer) The vehicle's odometer reading at the start of the rental period (an integer) The vehicle's odometer reading at the end of the rental period (an integer) The program will compute the amount of money that the customer will be billed, based on the customers 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. You work for an on-line game site. Your job is to develop a program that accepts a user name and password. Write a Python script that prompts users for a user name and password. a. The user name should be at least 6 characters long and is stored in a list such that it can't be used again. b. The password can only be validated if the following conditions are met: At least 1 letter between [a-z] and 1 letter between [A-Z]. At least 1 number between [0-9]. At least 1 character from [$#@]. Minimum length 6 characters. Maximum length 16 characters. Write a Python script to find numbers between 100 and 400 (both included) where each digit of a number is an even number. The numbers obtained should be printed in a comma-separated sequence.

Explanation / Answer

3)
#save as rentalService.py
#Python program that prompts user to enter
#customer code, days, odometer start and ending
#readings and finds the total charge and print to
#console.
def main():
    #prompt for code
    cCode = input('Customer classification code (B or D): ')
    #prompt for day
    days = int(input('Number of vehicle rented days: '))
    #prompt for starting odometer
    start = int(input('Starting odometer reading: '))
    #prompt for ending odometer
    end = int(input('Starting odometer reading: '))

    #calculate number of miles
    miles=end-start;
    totalCharge=0;

#checking of code is either B or b
    if cCode=="B" or cCode=="b":
      totalCharge=days*40+miles*0.25;
#checking of code is either D or d and miles <=100
    elif cCode=="D" or cCode=="d" and miles<=100:
      totalCharge=days*60;
#checking of code is either D or d and miles >100
    elif cCode=="D" or cCode=="d" and miles>100:
      totalCharge=days*60+(miles-100)*0.25;
  
        
    #print factorial of a number,nVal
    print('The total charge = %.2f'%(totalCharge))

main()  

--------------------------
sample output:
>>>
Customer classification code (B or D): b
Number of vehicle rented days: 10
Starting odometer reading: 0
Starting odometer reading: 100
The total charge = 425
>>> ================================ RESTART

================================
>>>
Customer classification code (B or D): d
Number of vehicle rented days: 10
Starting odometer reading: 0
Starting odometer reading: 150
The total charge = 612
>>> ================================ RESTART

================================
>>>
Customer classification code (B or D): d
Number of vehicle rented days: 10
Starting odometer reading: 0
Starting odometer reading: 150
The total charge = 612.50
>>>

-------------------------------------------------------------------------------------------
5)

#Python program that finds the even numbers in
#a range of 100 to 400 wiht comma separated sequence
# to console.
def main():

      #initialize
      start=100;
      end=400;

      #run for loop over a range of start to end
      for val in range(start,end):
            #checking if val is even
            if val%2==0:
                  #print to console
                print(val,end=',')


#calling main method
main()
          
    
Sample outout:
>>
100,102,104,106,108,110,112,114,116,118,120,122,124,126,128,130,132,134,136,13

8,140,142,144,146,148,150,152,154,156,158,160,162,164,166,168,170,172,174,176,

178,180,182,184,186,188,190,192,194,196,198,200,202,204,206,208,210,212,214,21

6,218,220,222,224,226,228,230,232,234,236,238,240,242,244,246,248,250,252,254,

256,258,260,262,264,266,268,270,272,274,276,278,280,282,284,286,288,290,292,29

4,296,298,300,302,304,306,308,310,312,314,316,318,320,322,324,326,328,330,332,

334,336,338,340,342,344,346,348,350,352,354,356,358,360,362,364,366,368,370,37

2,374,376,378,380,382,384,386,388,390,392,394,396,398,

Note : post 3 in different post since multiple questions.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote