Posted at 00:35h
in
Uncategorized
by admin
Question 1:
Vehicles are classified based on their total interior volume. Write a program to classify a vehicle based on total interior volume, in cubic feet, as shown in the table below:
Vehicle size class
Total interior volume
Minicompact
Less than 85 cubic feet
Subcompact
85 to 99 cubic feet
Compact
100 to 109...
Posted at 00:24h
in
Uncategorized
by admin
Question:
Using function or object method to write a program to return the number of times that the string “code” appears anywhere in the given string, except we’ll accept any letter for the ‘d’, so “cope” and “cooe” count.
For example:
‘aaacodebbb’ will have 1 “code”
‘codexxcode’ will have 2 “code”
‘cozexxcope’...
Problem Description
A vote is held after singer A and singer B compete in the final round of a singing competition. Your job is to count the votes and determine the outcome.
Input Specification
The input will be two lines. The first line will contain V (1 ≤...
Question:
Create an object WordReverse to reverse a string.
You need one argument (which is the original string) to create the object.
def __init__(self, word):
You need one method to reverse the string
def reverse(self):
You can print the object with the following expected output...
Posted at 00:11h
in
Uncategorized
by admin
Question:
Make a function that will allow you to print any name, address, street, city, state or province, zip or postal code, and country in the world. (Hint: It needs seven arguments. You can pass them as individual arguments or as a list.)...
Posted at 00:07h
in
Uncategorized
by admin
Question:
You’re on a long car trip and arrive at a gas station. It’s 200 km to the next station. Write a program to figure out if you need to buy gas here, or if you can wait for the next station.
The program should ask these questions, Input Sample:
How...