Write a program in python that will ask a ticket officer

Assignment Help Python Programming
Reference no: EM132357224

Task

Inspired by the success of the Mount Panorama Motor Racing Circuit, International Motor Sports Authority (IMSA) has recently built a motor racing circuit on Mount Everest that will be the most challenging and thrilling motor racing event on earth. Mount Everest Motor Racing Circuit (MEMRC) has the following types of tickets and prices.

Table 1: Ticket Type and Price

Ticket Type

Price

General Admission

$90

Reserved Grandstand Seating

$150

The Precinct

$250

Lunch Packages on Everest

$350


IMSA employs you to build a Ticket Management System (TMS) so that their Ticket Officers can easily compute the prices of various tickets sold.

Write a program in Python that will ask a Ticket Officer for the number of tickets sold for each type of tickets one by one. That is, it will first ask a Ticket Officer "Please enter the number of tickets sold for General Admission". Once the Ticket Officer enters the number of tickets sold for General Admission it will then ask "Please enter the number of tickets sold for Reserved Grandstand Seating" and so on. Finally, the program will compute and display the total sale amount for each ticket type, and then the combined total cost of all tickets.

A typical example of the display of your program can be as follows. Your program MUST follow the same display style.
----------------------------------------------------------------------------------------------
Mount Everest Motor Racing Circuit (MEMRC)
-----------------------------------------------------------------------------------------------
Please enter the number of tickets sold for General Admission: 100
Please enter the number of tickets sold for Reserved Grandstand Seating: 70
Please enter the number of tickets sold for The Precinct: 15
Please enter the number of tickets sold for Lunch Packages on Everest: 5
Thank You!

The sale amount of tickets for General Admission (in dollars): 9000
The sale amount of tickets for Reserved Grandstand Seating (in dollars): 10500
The sale amount of tickets for The Precinct (in dollars): 3750
The sale amount of tickets for Lunch Packages on Everest (in dollars): 1750
The total sale amount: 25000

Good Bye.

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified.

Select 3 sets of test data that will demonstrate the ‘normal' operation of your program: that is test data that will demonstrate what happens when VALID input is entered.

Select another 2 sets of test data that will demonstrate the "abnormal" operation of your program. Set it out in a tabular form: the test data, the reason it was selected, the output expected as a result of using that test data, and finally leave space to record the output actually observed when the test data is used.

Implement your algorithm in Python. Comment your code as necessary to explain it clearly.

Run your program using the test data you have selected and save the output it produces in a text file.

 

Task 2


Dr Ho Coaching Centre gives lessons on three programming languages: Python, Java and C++. They have divided each programming language into a number of topics such as if-statement, while-loop, and for-loop. They teach each topic through a standard one-hour long lesson.

Students can request any number of additional hours on the topics that they have already studied. They can also request for any number of practice tests at the centre.

The centre charges for each standard lesson, additional hour and test according to the table below.

Language

Fee for each Lesson

Fee for an additional hour

Fee for each test

Python

$300

$200

$250

Java

$200

$150

$150

C++

$175

$175

$170


For example, if a student studying Python requests 20 topics, 10 additional hours and 5 tests the total tuition fee for him/her will be ($6,000 + $2,000 + $1,250) = $9,250.
The Principal of Dr Ho Coaching Centre (Dr Wise Ho) contracts you to build a computer system, Power of Knowledge (PK), for them in Python.

PK will ask them to input, for a student, the name of the programming language that the student wants to study, the number of topics/lessons that he/she wants to study, the number of additional hours that he/she wants to study, and the number of tests that he/she wants to sit for. Based on the inputs the program will compute and display the tuition fee for the lessons, additional hours and tests. It will also display the total tuition fee.

PK will then ask Dr Ho "Do you want to compute the tuition fee for another student?"

If Dr Ho wants to compute the tuition fee for another student (i.e. enters "Y" or "y" to the question above), PK will ask for all these inputs again for the new student, and compute and display the total tuition fee for the new student. The program will then again ask Dr Ho "Do you want to compute the tuition fee for another student?"

The above process will continue as long as they want to compute the tuition fee for another student. However, if Dr Ho does not want to compute the tuition fee for another student (i.e. he enters anything other than "Y" or "y") then the program will exit.

Dr Ho also imposes the minimum number of lessons, additional hours and tests, that a student must enrol for, as follows.

Language

Minimum number of Lessons

Minimum additional hours

Minimum number of tests

Python

5

5

5

Java

4

10

2

C++

6

7

2

If a student wants to take an invalid number of lessons, additional hours and/or tests, PK will ask to enter them again. For example, when PK prints "Enter the number of lessons:" if a student studying Python wants to enter 4 then PK will again print "Enter the number of lessons:" until a valid number of lessons is entered.

A typical example of the display of your program can be as follows. Your program MUST follow the same display style.

Welcome to Dr Ho Coaching Centre

Enter the name of the programming language: Python
Enter the number of lessons: 4
Enter the number of lessons: 20
Enter the additional hours: 10
Enter the number of tests: 5

Tuition fee for the lessons (in dollars): 6000
Tuition fee for additional hours (in dollars): 2000
Tuition fee for the tests (in dollars): 1250
Total tuition fee (in dollars): 9250

Do you want to compute the tuition fee for another student? Y

Enter the name of the programming language: Java
Enter the number of lessons: 25
Enter the additional hours: 10
Enter the number of tests: 10

Tuition fee for the lessons (in dollars): 5000
Tuition fee for additional hours (in dollars): 1500
Tuition fee for the tests (in dollars): 1500
Total tuition fee (in dollars): 8000

Do you want to compute the tuition fee for another student? N

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified.

Select 3 sets of test data that will demonstrate the correct ‘normal' operation of your program. Select another 2 sets of test data that will demonstrate the "abnormal" operation of your program. Set these out in the same format as in Assignment 1.

Implement your algorithm in Python.

Avoid duplicate code. For example, DO NOT calculate the tuition fee in multiple places in your code.

Comment your code as necessary to explain it clearly.

Run your program using the test data you have selected and save the output it produces in a text file.

Reference no: EM132357224

Questions Cloud

What were some areas of noted improvement on the surveys : In discussion 1, you took a minimum of four surveys to help provide data to your classmates. Talk about your thoughts while taking the various surveys.
What happens if you change the capacity of a choke point : Give an efficient algorithm to determine if a given edge e is a choke point in G.
What do you see as the most successful terrorist tactic : Select one terrorist tactic and explain how it has evolved over time. What do you see as the most successful terrorist tactic in the next decade, and why?
Discuss utilitarianism and deontological ethics : Discuss utilitarianism and deontological ethics. Discuss the different categories of unethical police behavior and provide an example of each.
Write a program in python that will ask a ticket officer : Write a program in Python that will ask a Ticket Officer for the number of tickets sold for each type of tickets one by one. Write an algorithm in structured.
Explain the different forms of restraint of trade : Identify and explain the different forms of restraint of trade in your example and, what are some of the defenses? Support your answer.
Create celsiusconverter gui : Create CelsiusConverter GUI that will show some decimal (not integer) number in the text field, along with the correct conversion in the Fahrenheit label.
Application portfolio and an investment portfolio : Draw 5 parallels between Managing and IT Application Portfolio and an Investment Portfolio
Define proposal for change in the terms of contract : In Week 1, on behalf of your client Clarence Holden, you drafted an offer letter to Flour-Is-Us, with the terms of the contract for sale. In Week 2, you drafted

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd