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: 3808844 • 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 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. 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

I'm using python 2.7.13.

3.

#Reading Inputs.
cc = raw_input(" Customer's Classification Code: ")
days = int(raw_input(" No. of days the vehicle was rented: "))
srp = int(raw_input(" Vehicle's odometer reading at the start of rental period: "))
erp = int(raw_input(" Vehicle's odometer reading at the end of rental period: "))

miles = erp - srp
#Calculating amount
if cc == 'b' or cc == 'B':
    amount = (40.0 * days) + (0.25 * miles)
elif cc == 'd' or cc == 'D':
    if ((erp - srp) / days) > 100.0:
        amount = (60.0 * days) + (0.25 * miles)
    else:
        amount = 60.0 * days
print " Total bill: ", amount


4.

import sys
#List to keep details of registered users.
users = []
password = []
#To input user name.
def user():
    while True:
        flag = True
        uid = raw_input(" Enter Username: ")
        if len(uid) >= 6:
            for i in users:
                if i == uid:#To check if username is available.
                    flag = False
                    break
            if flag:
                users.append(uid)#Accepting username.
                return True

def pswd():
    while True:
        pwd = raw_input(" Enter Password: ")
        #Checking for password criteria.
        if (any(i.isupper() for i in pwd) and any(i.islower() for i in pwd)
            and any(i.isdigit() for i in pwd) and len(pwd) >= 6 and len(pwd) <= 16
            ):
            for i in ['@','#','$']:
                for j in list(pwd):
                    if i == j:
                        password.append(pswd)#Accepting password.
                        return True

while True:#creating menu driven program.
    print " 1. Register."
    print " 2. Exit."
    ch = int(raw_input(" Enter Choice: "))
    if ch == 1:
        user()
        print " For password, fulfill these: "
        print " One Capital and One Small Letter and one number."
        print " Minimum 6 and maximum 16 characters."
        print " One special character from [$,#,@]."
        pswd()
    if ch == 2:
        print " Exiting... "
        sys.exit()#Exiting program.


5.

l = 100
u = 400
li = []

def isEven(d): #Checking if digit is even.
    if d % 2 == 0:
        return True
    else:
        return False

while l <= u:
    n = l
    c = 0
    while n > 0:#Checking each no.
        d = n % 10
        if not(isEven(d)):#Checking each digit.
            c = 1
            break
        n = n / 10
    if c == 0:
        li.append(l) #Appending no. with all even digits to list.
    l += 1
print li

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