Answer:
Python code is given below
Explanation:
# create an empty array
arr = []
# loop 5 times
for i in range( 0 , 5 ):
x = float(input('Enter a number : '))
# add x to arr
arr.append( x )
sum = 0
# find the sum of all elements in arr
for x in arr:
sum += x
# calculate average
average = sum / len(arr)
print('\n%15s %15s\n' %('Original Value' , 'Interest Value'))
for Original_value in arr:
# calculate interesr value
Interest_Value = Original_value * 0.2
print('%10f %15f' %( Original_value , Interest_Value ))
print('\nTotal :', sum)
print('Average :', average)
print('Maximum :', max(arr))
print('Miniimum :', min(arr))
C, because technology has changed our social life by texting and messaging.
Hope this helps
Answer:
Von Neumann describió el fundamento de todo ordenador electrónico con programas almacenados. Describía, a diferencia de como pasaba anteriormente, como podía funcionar un ordenador con sus unidades conectadas permanentemente y su funcionamiento estuviese coordinado desde la unidad de control (a efectos prácticos es la CPU). Aunque la tecnología ha avanzado mucho y aumentado la complejidad de la arquitectura inicial, la base de su funcionamiento es la misma y probablemente lo seguirá siendo durante mucho tiempo. El artículo viene acompañado de una representación gráfica del funcionamiento.
Explanation:
Answer:
public static void vowelsConsonantCount(String str){
String text = str.toLowerCase();
String word = text.replaceAll("[^a-zA-Z0-9]", "");
int lenWord = word.length();
int count = 0;
for(int i=0; i<lenWord; i++){
if(word.charAt(i)=='a'||word.charAt(i)=='e'||word.charAt(i)=='i'
||word.charAt(i)=='o'||word.charAt(i)=='u'){
count++;
}
}
int consonants = lenWord-count;
System.out.println("the total vowels are "+count);
System.out.println("The total consonants are: "+consonants);
}
Explanation:
- In Java programming language
- The method uses java's replaceAll() method to remove all spaces and special characters and punctuations.
- It converts the string entered into all lower cases using toLowerCase() method
- Calculates the length of the resulting string using the length() method
- Using if statement the total vowels are counted, subtracting the total vowels from the size of the string gives the total consonants
- These two values are outputed.