[solved] – Question 97231

A local shop in your town needs to calculate the total bill of customers after getting discount on shopping. You are required to write a program that takes input of the total amount spent by its 10 customers and then calculate the total bill after calculating the discount. The discount is calculated accordingly if
1.Bill > 8000 discount given is 35%
2.Bill > 7000 discount given is 30%
3.Bill > 6000 discount given is 25%
4.Bill > 5000 discount given is 20%
5.Less than 5000 – No discount will be given.

Expert Answer


[solved] – Question 97279

What is an example of a purpose being met by the use of a program that involves file processing (batch processing)?

Expert Answer


[solved] – Question 97305

import os

# This program has read/write access to the WORKSPACE directory
filepath = os.path.join( os.environ[‘WORKSPACE’], ‘NewYorkTemps.txt’ )

# The testing system will let this program know how many lines to expect
num_of_lines = int( input() )

# Copy input into the file. Do not modify!
with open( filepath, ‘w’ ) as file:
for _ in range( num_of_lines ):
file.write( input() + ‘n’ )

# Write your program below

Expert Answer


[solved] – Question 97306

Enter your word: zebras
Enter a number: 62
Password not long enough.

Enter your word: newyorkcity
Enter a number: 892
Password: N@wyorkci+y892

Expert Answer


[solved] – Question 97307

import os

# This program has read/write access to the WORKSPACE directory
filepath = os.path.join( os.environ[‘WORKSPACE’], ‘NewYorkTemps.txt’ )

# The testing system will let this program know how many lines to expect
num_of_lines = int( input() )

# Copy input into the file. Do not modify!
with open( filepath, ‘w’ ) as file:
for _ in range( num_of_lines ):
file.write( input() + ‘n’ )

# Write your program below

Expert Answer


[solved] – Question 97308

import os

# This program has read/write access to the WORKSPACE directory
filepath = os.path.join( os.environ[‘WORKSPACE’], ‘yourfilename.txt’ )
file = open(filepath, ‘w’)
Write a program to input ten book titles and authors names then save them to a file named book.txt.

For each book, the user will first input the title, then input the first name, then the last name of the author, all on separate lines. In addition to saving the books in the file, please output, using the print method, the information you’ve gathered from the user.

You should follow the format uppercase title, tab, capitalized last name, comma, single space, capitalized first name. Here’s an example for your output:

Format:

TO KILL A MOCKINGBIRD Lee, Harper
All book titles should be in upper case and the authors name should be capitalized.

Expert Answer


[solved] – Question 9731

I want to fetch data from database to jsp Page. Whenever we type a word relating words starting with letter typed should be filled automatically by fetching from the DB like a drop down.

Expert Answer


[solved] – Question 97336

A chatbot is a computer program designed to emulate human conversation. For this program you will use if statements, user input, and random numbers to create a basic chatbot.

Here is the scenario: You have decided to start an online website. You are creating a prototype to show investors so you can raise money and launch your website. You should ask the user at least 5 questions ( 5 inputs required ) and use at least 2 if-elif-else statements and give answers depending on how they answer. Some responses should be based on what they type, and some should be based on random numbers.

For example, if they say they are sad, your chatbot might respond Im sorry to hear that.

You could also have a random number generated between 1 and 3 and have a corresponding response depending on the number such as That is great to hear or So interesting.

Expert Answer


[solved] – Question 97339

Consider a point of sale terminal at a supermarket that displays electronic versions of receipts in the following format
***Touch Supermarket***
Item 1 2000
Item 2 4000
Item 3 1000
Total: 7000
Amount: Seven thousand only.
Required: Create a program that has a menu with 10 items of your choice and allow a user to select up to a maximum of 5 items. The program should display a receipt like above (including the total amount in words)

Expert Answer


[solved] – Question 97394

Determine of the following Matrix
[1 1 2; 1 3 2; 1 3 4]

Expert Answer