Question

Hi Guys,

Need help on python questions

Question 3. At the Singapore Zoo, each adult ticket costs $ 39, each child (>= 3 years old, <= 12 years old) ticket costs $26

Question 4. A subject has 3 assessments: An assignment whose mark is an integer between 0 and 20; A project whose mark is an

0 0
Add a comment Improve this question Transcribed image text
Answer #1

3.

adult=int(input('How many adult tickets you want to order: '))
children1=int(input('How many children(>=3 years old,<=12 years old) tickets: '))
children2=int(input('How many children(<3) tickets: '))
sum1=0
sum12=0
acost=adult*39.0
c1cost=children1*26.50
sum1=adult+children1+children2
sum2=acost+c1cost

print('Type                      Number of tickets                  Cost')
print('Adult                      ',adult,'                             $',acost)
print('Children(>=3,<=12)         ',children1,'                             $',c1cost)
print('Children(<3)               ',children2,'                             $','free')
print('Total                      ',sum1,'                           $',sum2)

OUTPUT:-

How many adult tickets you want to order: 2
How many children(>=3 years old,<=12 years old) tickets: 3
How many children(<3) tickets: 2
Type                      Number of tickets                  Cost
Adult                       2                              $ 78.0
Children(>=3,<=12)          3                              $ 79.5
Children(<3)                2                              $ free
Total                       7                               $ 157.5

1 adult=int(input(How many adult tickets you want to order: )) children1=int(input(How many children(>=3 years old,<=12 ye

4.

am=int(input('Enter your assignment mark: '))
pm=int(input('Enter your project mark: '))
fm=int(input('Enter your final_exam mark: '))
print('Your result:')
total=am+pm+fm
if fm<=20 or total<60:
    grade='Fail'
elif total>=90:
    grade='A'
elif total>=75:
    grade='B'
elif total>=60:
    grade='C'
print('Your result:')
print('Assignment:          ',am)
print('Project:             ',pm)
print('Final_exam:          ',fm)
print('Grade:               ',grade)

OUTPUT:-

Enter your assignment mark: 11
Enter your project mark: 20
Enter your final_exam mark: 41
Your result:
Your result:
Assignment:           11
Project:              20
Final_exam:           41
Grade:                C

09 + Run с» Code In [4]: 1 am=int(input(Enter your assignment mark: )) 2 pm=int(input(Enter your project mark: )) 3 fm=in+ I c Code < Run 18 printGrade: grade) Enter your assignment mark: 11 Enter your project mark: 20 Enter your final_exam mar

Add a comment
Know the answer?
Add Answer to:
Hi Guys, Need help on python questions Question 3. At the Singapore Zoo, each adult ticket...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • C programming Construct a console program to simulate Zoo ticketing system. The system is used for...

    C programming Construct a console program to simulate Zoo ticketing system. The system is used for dispensing tickets to customers. In order to buy tickets, the customer need to enter the following information: a) Number of ticket they want to buy. Everybody must have a ticket to enter. b) Only up to 5 tickets may be purchased for every transaction or customer. c) Type of ticket either for adult, children (aged 5 12 years old) or toddler (aged 2-5 years...

  • Professor Dolittle has asked some computer science students to write a program that will help him...

    Professor Dolittle has asked some computer science students to write a program that will help him calculate his final grades. Professor Dolittle gives two midterms and a final exam. Each of these is worth 100 points. In addition, he gives a number of homework assignments during the semester. Each homework assignment is worth 100 points. At the end of the semester, Professor Dolittle wants to calculate the median score on the homework assignments for the semester. He believes that the...

  • Can someone help me with this problem? I have been struggling with Python 3 for a...

    Can someone help me with this problem? I have been struggling with Python 3 for a while now and not even the professor would help me solve this problem. I have to import a file called grades.csv and use error handling for a mid-semester report. please help me, I have been having trouble understand import csv. You don't have to check for errors or anything like that. I just have to display the mid-semester report This project will have you...

  • Matlab question Task 2 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following...

    Matlab question Task 2 Download the ENG1060studentmarks.txt file from the Moodle. The file contains the following information: 1. Column 1: Student ID 2. Column 2--11: Lab marks (/10) worth 2% each (20% total of final grade) 3. Column 12: Assignment mark (/10) worth 10% of the final grade 4. Column 13: Exam mark (100) worth 70% of the final grade a) Write a function that accepts a student's laboratory, assignment and exam marks as inputs to determine the final mark...

  • Need code written for a java eclipse program that will follow the skeleton code. Exams and...

    Need code written for a java eclipse program that will follow the skeleton code. Exams and assignments are weighted You will design a Java grade calculator for this assignment. A user should be able to calculate her/his letter grade in COMS/MIS 207 by inputting their scores obtained on worksheets, assignments and exams into the program. A skeleton code named GradeCompute.java containing the main method and stubs for a few other methods, is provided to you. You must not modify/make changes...

  • The assignment : Assignment You will be developing a speeding ticket fee calculator. This program will...

    The assignment : Assignment You will be developing a speeding ticket fee calculator. This program will ask for a ticket file, which is produced by a central police database, and your program will output to a file. Furthermore, your program will restrict the output to the starting and ending dates given by the user. The ticket fee is calculated using four multipliers, depending on the type of road the ticket was issued: Interstate multiplier: 5.2252 Highway multiplier: 9.4412 Residential multiplier:...

  • This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp,...

    This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp, and Main.cpp 1. The system must be able to manage multiple students (max of 5) and their grades for assignments from three different assignment groups: homework (total of 5), quizzes (total (total of 2) of 4), and exams 2. For each student record, the user should be able to change the grade for any assignment These grades should be accessible to the gradebook for...

  • Assignment You will be developing a speeding ticket fee calculator. This program will ask for a t...

    Assignment You will be developing a speeding ticket fee calculator. This program will ask for a ticket file, which is produced by a central police database, and your program will output to a file or to the console depending on the command line arguments. Furthermore, your program will restrict the output to the starting and ending dates given by the user. The ticket fee is calculated using four multipliers, depending on the type of road the ticket was issued: Interstate...

  • Project: Using Java API Classes Page 3 of 5 SpaceTicket.java Requirements: The purpose of this program is accept coded...

    Project: Using Java API Classes Page 3 of 5 SpaceTicket.java Requirements: The purpose of this program is accept coded space ticket information as input that includes the ticket price, category, time, date, and seat, followed by the description of the travel. Note that the eight digits for price have an implied decimal point. The program should then print the ticket information including the actual cost, which is the price with discount applied as appropriate: 25% for a student ticket (s),...

  • For the following task, I have written code in C and need help in determining the...

    For the following task, I have written code in C and need help in determining the cause(s) of a segmentation fault which occurs when run. **It prints the message on line 47 "printf("Reading the input file and writing data to output file simultaneously..."); then results in a segmentation fault (core dumped) I am using mobaXterm v11.0 (GNU nano 2.0.9) CSV (comma-separated values) is a popular file format to store tabular kind of data. Each record is in a separate line...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT