Answer:
La cilindrada total del motor es de 1997,025 centímetros cúbicos.
Explanation:
Para determinar la cilindrada total Vt en un motor de 4 cilindros de 83,6 mm de diámetro por 91 mm de carrera se debe realizar el siguiente cálculo, sabiendo que para calcular la cilindrada de un motor se debe utilizar la fórmula ((Pi x Diámetro^2)/4) x Carrera x Número de cilindros = X:
((3.14 x 83.6^2)/4) x 91 x 4 = X
((3.14 x 6,988.96)/4) x 364 = X
(21,945.3344 / 4) x 364 = X
5,486.3336 x 364 = X
1,997,025.4304 = X
1 milímetro cúbico = 0.001 centímetro cúbico
1,997,025.4304 milímetros cúbicos = 1997.0254304000005 centímetros cúbicos
Por lo tanto, la cilindrada total del motor es de 1997,025 centímetros cúbicos.
Add the following constants in the class definition, before the main method:
private final static float START_COST = 1.5f;
private final static float HIGH_TARIFF = 0.5f;
private final static float LOW_TARIFF = 0.25f;
private final static int FIXED_MINS = 2;
private final static int HIGH_TARIFF_MINS = 10;
Then add this to the main method you already had:
float price = START_COST;
if (x > FIXED_MINS) {
if (x <= HIGH_TARIFF_MINS) {
price += HIGH_TARIFF*(x-FIXED_MINS);
}
else {
price += HIGH_TARIFF*(HIGH_TARIFF_MINS-FIXED_MINS)
+ LOW_TARIFF*(x-HIGH_TARIFF_MINS);
}
}
System.out.printf("A %d minute call costs %.2f", x, price);
Answer:
def length( mystring):
count = 0
for i in mystring:
count += 1
return count
def reversed( mystring):
strlist = []
for i in range(length(mystring)):
strlist.append(mystring[(length(mystring) - 1) - i])
txt = "".join(strlist)
return txt
string = 'Yolanda'
print(reversed(string))
Explanation:
The python module defines two functions 'reversed' and 'length'. The length function counts the number of characters in a string variable while the reversed function reverses the string variable value.