Uncategorized
Home > Uncategorized (Page 72)
Posted at 03:07h
in
Uncategorized
by admin
Question 1:
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...
Posted at 20:56h
in
Uncategorized
by admin
Question:
Write a function to calculate the total value of some change—quarters, dimes, nickels, and pennies. The function should return the total value of the coins. Then write a program that calls the function. The output should look like this when it runs:
Sample input:
quarters: 3
dimes: 6
nickels: 7
pennies: 2
Sample output:
total is...
Posted at 02:44h
in
Uncategorized
by admin
Problem Description
Suppose we have a number like 12. Let’s define shifting a number to mean adding a zero at the end. For example, if we shift that number once, we get the number 120. If we shift the number again we get the number 1200....
Posted at 00:49h
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’...
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’...
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...
Posted at 18:13h
in
Uncategorized
by admin
Problem DescriptionWe have learn how to use stack to solve some problems and how to convert decimal number into binary number:
Please write the program to convert a given decimal number into a binary number by using the following steps for python coding solutions:
takes an argument...
Posted at 16:13h
in
Uncategorized
by admin
Question:
You are given a string . Suppose a character ‘a’ occurs consecutively n times in the string. Replace these consecutive occurrences of the character ‘a’ with (n, ‘a’) in the string.
Input Format: A single line of input consisting of the string .
Output Format: A single line of...