What type of program would have a class named Student with objects called fullTime and partTime?
A. machine language program
B. object-oriented program
C. markup language program
D. procedural language program
Answer:
B. object-oriented program
Explanation:
An object-oriented program or OOP is a type of program that uses the concepts of objects and methods.
Although they are quite broad, they also make use of classes and types.
Java, for instance makes use of OOP as they use classes and objects under those classes and name them anyhow they want.
Therefore, the correct answer is B
Answer:
The definition of function is as follows:
def typing_speed(number_of_words,Time_Interval):
number_of_words>=0
Time_Interval>0
speed=float(60*number_of_words/Time_Interval)
return speed
Explanation:
Above function is defined step-by-step as follows:
def typing_speed(number_of_words,Time_Interval):
- A function named typing speed has two arguments, num_of_words and Time_Interval.
number_of_words>=0
Time_Interval>0
- The variable number_of_words is the number of words entered that a person enters, they must be greater than or equal to 0. Where as Time_Interval is the variable for counting the time span in seconds, it must be greater than 0.
speed=float(60*number_of_words/Time_Interval)
return speed
- For determining result firstly the seconds are converted int minutes by multiplying with 60 and number_of_words is divided with Time_Interval in order to get words per minute. The return value will give speed which has data type float.
Answer:
Explanation:
The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.
def in_values():
num_list = []
while True:
try:
num = input("Input non-zero floating point: ")
num = int(num)
if num == 0:
break
else:
num_list.append(num)
except ValueError:
print("No valid integer! Please try again ...")
try:
num = input("Input non-zero floating point: ")
num = int(num)
break
except ValueError:
break
sum = 0
for number in num_list:
sum += number
return sum