Python Answers

Questions answered by Experts: 5 288

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search

Online Cake Ordering System: 1) Add a new order 2) Retrieve an order 3) Deliver an order 4) Print summary report 5) Exit system 

+ a new order

  • require auto generated ID
  • Expected delivery Date & time
  • Name of the cake (choco, frap, straw, blue)
  • Weight (0.5kg/1kg/1.5kg)
  • Price(vary for each)
  • Status

Retrieve order

retrieve&remove the order (with nearest delivery data&time) from the binary heap data structure & update the status as “in progress” &move the order into queue data structure.

Deliver order

The user will retrieve a work in progress order from queue based on first in first out (FIFO) concept and move the order to a stack. Status of order will be updated as “delivered”.

View summary report

  • Outstanding order list: Display a list of outstanding order info
  • Work In progress:Display a list of work in progress order info
  • Top & latest order delivered: Display the n latest order delivered.

No built-in classes of data structure (heap, queue and stack) are allowed. 


Dieting is common in our society and everyone wants a piece of the action. So many diets are available to choose from if someone wants to change their health; e.g., lose weight. Often times, diets are promoted with claims of great success.

For the purposes of this assignment, you are to choose a particular diet and analyze it in terms of scientific evidence, or lack thereof. Then, you are to design a controlled experiment to test a hypothesis based on this diet. The experiment must include multiple individuals within a control and experimental group. You must specify how you will measure the outcome of the experiment identifying both the independent and dependent variables. You must describe the potential outcomes of the experiment in terms of supporting the hypothesis.

Write a 2-3 page (500 – 750 words, 12 point font) paper including the following elements. Be sure to compose your work with your own words. Do not copy and paste from any source.


In your assigned readings, you learned how inductive and deductive reasoning are used to answer questions about life. Briefly compare and contrast each type of reasoning as they apply to biological investigation. Which, if any, type of reasoning is best used to establish cause and effect relationships? Explain your rationale using one or more examples.



Write a Python program using lists, function and loops that will prompt a user to enter a temperature as an integer. Your program will print "it is hot" if the temperature is over 100, "it is cold" if the temperature is under 60, and "it is just right" if the temperature is between 61 and 99 inclusive. The program continues to ask for temperatures, and evaluates them as above, until the user enters a temperature of 0 (to exit the program). An example of the anticipated program is shown below: Please enter a temperature: 95 It is just right. Please enter a temperature: 110 It is hot. Please enter a temperature: 32 It is cold. Please enter a temperature: 0 Good bye! 



Timetable Extractor using Python

1. Create a simple database and table structure (0NF) for timetable schedule in SQLite

2. Create a Python function (def) to:

a. read all timetables in Microsoft Excel format

b. extract the timetable contents

c. store the contents into the created table (in item #1)

3. Illustrate a flowchart for the overall task workflow

Chat started



1. Create a SQLite database for Places‐of‐Interests (POI) 2. Apply the CRUD concept using Python‘s function (def) 3. Test each of your CRUD functions with the following use case: a. Create the appropriate table with it‘s table structure,  b. Populate 20 POIs into the table c. Get the latest row in the table d. Retrieve all POI data e. Update several POI data f. Delete two POI records g. Undo the deletion record proces


Max Contiguous Subarray input 2 -4 5 -1 2 -3


Parallelogram

Write a program to print a parallelogram pattern with

* characters. The size N represents the length (the number of * characters in each line) & breadth (the number of lines) of the parallelogram.The slope of the parallelogram

T represents the number of extra spaces a line should have in the beginning compared to its next line. The last line of the pattern does not have any spaces in the beginning.Input

The input contains an integer

N.Output

The output should have

N lines. Each line should have spaces followed by N number of * characters as mentioned above.Explanation

Given

N = 3 and T = 2.Each line should have

3 star(*) characters. The last line should have 0 spaces at the beginning. Each line has 2 extra space characters when compared to its next line.

Sample Input 1

2 2

Sample Output 1

**

**

Sample Input 2

3 2

Sample Output 2

***

***

***


Leaders

You are given a list(

A) of integers. An element is a leader if it is greater than all the elements to its right side. And the rightmost element is always a leader.Write a program to print all the leaders in the list by maintaining their relative order.

Input

The input contains space-separated integers denoting the elements of the list

A.Output

The output should have the numbers in

A that are leaders.Explanation

Given

A = [4, 5, 1, 3, 2].The number

5 has no numbers that are greater than itself to its right side. The number 3 has no numbers that are greater than itself to its right side. The last number 2 is always a leader.So the leaders are

5 3 2.

Sample Input 1

4 5 1 3 2

Sample Output 1

5 3 2

Sample Input 2

9 8 10 12

Sample Output 2

12


Minimum Platforms

You are given arrival and departure times of all trains that reach a railway station. Find the minimum number of platforms required for the railway station so that no train is kept wait

Input

The first line contains space-separated integers that represent the arrival time of the trains.

The second line contains space-separated integers represent the corresponding end time of the trains.

Output

The output should have an integer that represents the number of platforms needed to arrange the commute of all the trains.

Explanation: The arrival times of 5 trains are

0900 0940 0950 1100 1500. The departure times of 5 trains are 0910 1200 1120 1130 1900.The first platform will be used to run the trains that arrive at

0900 0940 1500. The second platform will be used to run the trains that arrive at 0950.

Sample Input 1

0900 1100 1235

1000 1200 1240

Sample Output 1

1

Sample Input 2

0900 0940 0950 1100 1500

0910 1200 1120 1130 1900

Sample Output 2

3


LATEST TUTORIALS
APPROVED BY CLIENTS