Question

In: Computer Science

write code in python and test Conversation with an AI ChatBot Learning Outcomes: Use the print()...

write code in python and test

Conversation with an AI ChatBot


Learning Outcomes:


Use the print() function to output a variety of data


Use the input() function to ask for multiple data types


Use basic arithmetic operations in a program


Use string methods and operations


Use if/else if/else statements to determine the flow of the program


Comment your code


Debug your code


Test your code


Scenario


A new marketing company is launching an Artificial Intelligence (AI) ChatBot for their website and want you to code a prototype demonstration for their investors. Simulate a "sales conversation" with a customer who will be purchasing licenses for your ChatBot service.

Your code must do the following:


Ask for the customer's first and last name. Store the values input to a variable.


Greet your customer using their full name.


Provide a few sentence overview of your Chatbot program. Be creative - make some stuff up. Output it to the screen with a nice format of your choice. Make this as serious or as silly a scenario as you want it to be.


Ask if your customer would like to make a purchase.


If yes -- continue to the following items:

Ask for their email address. Store the values input to a variable.


Ask for their phone number. Store the values input to a variable.


Ask for how many chatbot licenses they would like to purchase. Store the values input to a variable.


Ask if they would also like to purchase an optional Gold Support plan that gets them priority support.

The Gold Support plan costs $500/year for license purchases 1 - 50.


The Gold Support plan costs $350/year for license purchases 51 - 100.


The Gold Support plan costs $250/year for license purchases 100+.


Each chatbot license costs $75. Calculate and display their current total. Store the values input to a variable.


Apply 10% tax for the total bill.


Calculate the total amount due. Store the values input to a variable.


Ask for a credit card number. Store the values input to a variable.


Ask for a credit card expiration date. Store the values input to a variable.


Ask for a CVC number on the back of the credit card. Store the values input to a variable.


Ask for a zip code. Store the values input to a variable.


Output a receipt using all of the variables you have input. Be sure to show the total license number, the amount for each license, the subtotal, tax, and total amount due.


In the receipt output, include the customer's name, phone number, email address, the credit card number, and expiration date.  


If no - thank the customer by name and say goodbye.


Ask the customer if they would like to restart the ChatBot.

For advanced coders extra


If you want an extra challenge, modify the scenario above with THREE different ChatBot service plans (instead of only the $75.00 version). Perhaps have a LITE, STANDARD, and ADVANCED ChatBot plan. Ask the user how many of each service plans they would like to purchase and calculate the totals based on the price of each plan.

(write code in python and test )

Solutions

Expert Solution

// Python programm for above question

print("Please let me know your name:")             // Asking customer's name

Fname = input("First name: ")                          //Taking first name as input
Lname = input("Last name: ")                          //Taking last name as input
print(" Welcome to chatbot service", Fname, Lname) // printing first name and last name
print("We provide chatbot service for your business and personal purpose. Now do not worry , if you are busy or you are out of station. We are there for you with our chatbot service")

//Describing about chatbot service
print("Would you like to make purchase, If yes please enter '1'") // Asking for decision
ask = int(input("Enter your decision: ")) // taking decision as input
if ask==1:                                                  // checking customer decision
    Email = input("Please enter your Email: ") //asking for email, phone and number of chatbot to add
    Phone = input("Please enter your Phone number: ")
    val = int(input("Number of chatbot you want to purchase: "))
    print("would you like to purchase other plans\n The Gold Support plan costs $500/year for license purchases 1 - 50.\n The Gold Support plan costs $350/year for license purchases 51 - 100, \n The Gold Support plan costs $250/year for license purchases 100+")
// providin other offers
    cost = 75    // cost per license
    currtotal = val*75 // calculating total price
    print("Current price: $", currtotal) //printing price without tax
    tax = currtotal*0.1 // calculating 10% tax
    total = currtotal+tax // calculating price including taxes
    print("Total price: $", total) // printing total price

   //asking for credit card and other personal details
    cc= int(input("Enter credit card number: "))
    exp = int(input("Enter expiry date of your card: "))
    cvc = int(input("Enter CVC: "))
    zip = int(input("Enter ZIP code: "))

   //producing reciept
    print("Reciept")
    print("Total license number: ", val)
    print("Price of each license: $", cost)
    print("Sub Total: $", currtotal)
    print("TAX: $", tax)
    print("Total: $", total)
  
// generating reciept for customer
    print("Reciept output")
    print("Name: ", Fname, Lname)
    print("Phone number: ", Phone)
    print("Email: ", Email)
    print("Credit Card number", cc)
    print("CC expiry date", exp)
else:
    print("Thank you, Good bye ", Fname, Lname)
// customer said No hence this
print("would you like to restart chatbot?") // asking for restart

NOTE: Here I have used // to comment the code but in python language '''..................''' is used to comment the code.


Related Solutions

Important: please use python. Using while loop, write python code to print the times table (from...
Important: please use python. Using while loop, write python code to print the times table (from 0 to 20, incremented by 2) for number 5. Add asterisks (****) so the output looks exactly as shown below.   Please send the code and the output of the program. ****************************************************************** This Program Shows Times Table for Number 5 (from 0 to 20) Incremented by 2 * ****************************************************************** 0 x 5 = 0 2 x 5 = 10 4 x 5 = 20 6...
Beginning Python Programming - Sorting: Write and test a Python program to print a set of...
Beginning Python Programming - Sorting: Write and test a Python program to print a set of real numbers in descending order. The program should also print out the median of the numbers input and how many numbers were input. The program should read in numbers until a negative number is read. The negative number serves as a sentinel or marker telling the program when to stop reading numbers. The program should then sort the numbers and print them out in...
Code in C++ Learning Outcomes Implement two stacks and use them to implement an infix to...
Code in C++ Learning Outcomes Implement two stacks and use them to implement an infix to prefix expression convertor Stacks A stack is an abstract data type which uses a sequential container and limits access to that container to one end. You may enter or remove from the container, but only at one end. Using the Linked List data structure from your last homework assignment, implement a Stack of type string. The Stack should only have one data member: the...
Write and test a Python program to print a set of real numbers in descending order....
Write and test a Python program to print a set of real numbers in descending order. The program should also print out the median of the numbers input and how many numbers were input. The program should read in numbers until a negative number is read. The negative number serves as a sentinel or marker telling the program when to stop reading numbers. The program should then sort the numbers and print them out in order from largest to smallest....
#python #code #AP class #Tech write a function code script which will print out number pyramid...
#python #code #AP class #Tech write a function code script which will print out number pyramid in the form of * so the output will be made up of **** resting on top of each other to form a pyramid shape. Bottom layer should be made of 5 multiplication signs like ***** then next 4 multiplication signs and so on. Top part should have only one *
Given two lists, write python code to print “True” if the two lists have at least...
Given two lists, write python code to print “True” if the two lists have at least one common element. For example, x = [1,2,3], y=[3,4,5], then the program should print “True” since there is a common element 3.
Use python programming to write this code and provide a screen short for the code. 2....
Use python programming to write this code and provide a screen short for the code. 2. Write a function that takes one argument (a string) and returns a string consisting of the single character from that string with the largest value. Your function should contain a for loop. You can assume that the input to your function will always be a valid string consisting of at least one character. You can assume that the string will consist only of lower-case...
Write this code in python Debugging: Use the Debugging Coin Toss code below as the basis...
Write this code in python Debugging: Use the Debugging Coin Toss code below as the basis for this project. Get the program running exactly as it appears in the text. It will run as written. Although it runs, does it run (behave) correctly? That is where you will focus your debugging efforts. Code: import random guess = ' ' while guess not in ('heads', 'tails'):      print('Guess the coin toss! Enter heads or tails: ')      guess = input() toss...
Python. 1.Why is it a good idea to write and test the code for laying out...
Python. 1.Why is it a good idea to write and test the code for laying out a window's components before you add the methods that perform computations in response to events? 2.Explain why you would not use a text field to perform input and output of numbers. 3.Write a line of code that adds a FloatField to a window, at position (1, 1) in the grid, with an initial value of 0.0, a width of 15, and a precision of...
When doing Machine Learning and Deep Learning (AI) research which language is better to use Java...
When doing Machine Learning and Deep Learning (AI) research which language is better to use Java or Python? When would you use Java and when would you use Python?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT