Posted at 22:04h
in
Uncategorized
by admin
Question:
You are in charge of adding cheese topping to a pizza prepared for a special customer. This pizza is a very long rectangular strip. It is divided into N slices, numbered 1 to N from left to right. To add cheese topping to the pizza, you have a special...
Question:
Write a program to ask the user for five names. The program should store the names in a list, and print them all out at the end. It should look something like this:
Sample input:
Enter 5 names:
Tony
Paul
Nick
Michel
Kevin
Sample output:
The names are Tony, Paul, Nick, Michel, Kevin
Hint:
You can use...
Question:
Jack save money by using piggy bank, he has many coins valued 1 cent, 5 cents, 10 cents, 50 cents and 1 dollar(100 cents) in the piggy bank.Now Jack has a book to buy, it costs P cents. He wonders how many coins at least,and...
Question 1:
Write a program to print a multiplication table (a times table). At the start, it should ask the user which table to print. The output should look something like this:
Sample Input:
Which multiplication table would you like? 5
Sample Output:
Here’s your table:
5 x 1 = 5
5 x 2...
Question:
A soccer team is looking for girls from ages 10 to 12 to play on their team. Write a program to ask the user’s age and if male or female (using “m” or “f”). Display a message indicating whether the person is eligible to play on the team.
Sample Input 1:
Age:...
Question:
Create a Python class Person with attributes: name and age of type string.
Create a display() method that displays the name and age of an object created via the Person class.
Create a child class Student which inherits from the Person class and which also has a section attribute.
Create a method displayStudent() that...