Question 9 Given the following pseudocode: What will be the output from the prog
ID: 3579779 • Letter: Q
Question
Question 9
Given the following pseudocode:
What will be the output from the program? Separate each output with a single space.
Question 10
Given the pseudocode below:
What will be the output from the program? Separate each output with a single space.
Question 11
Given the pseudocode below:
What will be the output from the program? Separate each output with a single space.
Question 12
Given the following pseudocode:
What will be the output from calling main(8)? Separate each answer with a single space.
Explanation / Answer
Question 9:
The function average in the pseudocode computes the average of 6 numbers 90+80+70+100+60+80 = 480/6 = 80
output =80
Question 10:
The function getScore in the pseudocode is using two parallel arrays of names of students and their scores. The function checks if the name passed as argument exists in the array . If it exists ,it returns the score corresponding to the name ,otherwise it returns -1. Here George is passed as name so the output will be his score 90 .
output: 90
Question 11:
The pseudocode getStats() computes the minimum,maximum and average of 5 numbers 100,80,90,70 and 50.
min = 50
max = 100
total = 390/5 = 78
Question 12:
The function fibo() will compute the fibonacci series for the n number of terms and output_vals() function display all the terms generated by fibo() function.
If 8 is passed as an argument to fibo(), the output will be 8 terms:
1 1 2 3 5 8 13 21
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.