A program that repeatedly prompts a user for integer numbers :
biggest = none
smallest = none
while True:
input = raw_input(“Enter a number:”)
if(input == “done” break
try:
number = float(inp)
except ValueError:
print “Please enter only numbers”
else
if smallest is None:
smallest = number;
biggest = number;
elif number < smallest:
smallest = number
elif num > largest:
largest = number
Print “Greatest is “, biggest
Print “Smallest is”, smallest
In this program an input is obtained, if it is equal to the word “done”, then the program stops b printing greatest and smallest number in the given input.
If invalid inputs are given then user is prompted to enter valid number. Otherwise the value of smallest and greatest are calculated according to the input using if-else construct.
Answer:
please tell the question clearly
I agree with the programmers who think object-oriented programming is a superior approach to procedural programming.
<h3>Why is OOP better than procedural programming?</h3>
In terms of Security, Object-oriented programming is said to have more of a secure based than procedural programming, due to the level of abstraction or that is due to data hiding property.
Note that It hinders the access of data to any member functions of the same class and one cannot see a thing like that such as data hiding in the procedural programming framework.
Learn more about object-oriented programming from
brainly.com/question/12342989
#SPJ1
Answer:
a[j] = 2*a[j+1];
Explanation:
The statement above assigns a new value to the element of the array indexed by j. The new value should be equal to twice the value stored in the next element of the array.