Write the pseudocode for an application that will:
a. Prompt a user for three numbers.
b. Store the values entered by a user in an array as they are provided by
the user.
c. Ask a user if they would like to search for a value:
i. If the user wishes to search for a value, the user needs to be
prompted for a value to search for. If the value is found, a
notification needs to be provided to the user.
d. Use a for loop to cycle through the arrays in order to calculate and
display the total of the values stored in the array
For this exercise, use the following 2D array, which is already declared and initialized in your programming environment below.
34 38 50 44 39
42 36 40 43 44
24 31 46 40 45
43 47 35 31 26
37 28 20 36 50
Your task is to find the average of all values in the 2D array.
Note: Be sure that your program accounts for arrays of any size, not just arrays that are 5 x 5. Your program will be tested against arrays of size n by n. It should work for any square array, not just the one shown. You should also use for loops in your program, not while loops.
Write a program that asks the user for a month as a number between 1 and 12. The
program should display a message indicating whether the month is in the first quarter,
the second quarter, the third quarter, or the fourth quarter of the year. Following are the
guidelines:
• If the user enters either 1, 2, or 3, the month is in the first quarter.
• If the user enters a number between 4 and 6, the month is in the second quarter.
• If the number is either 7, 8, or 9, the month is in the third quarter.
• If the month is between 10 and 12, the month is in the fourth quarter.
• If the number is not between 1 and 12, the program should display an error.
Edhesive 10.4:
For this exercise, use the following 2D array, which is already declared and initialized in your programming environment below.
34 38 50 44 39
42 36 40 43 44
24 31 46 40 45
43 47 35 31 26
37 28 20 36 50
Your task is to determine whether each item in the array above is divisible by 3 or not. If an item is divisible by 3, then leave that value as-is in the array, but if it is not divisible by 3, then replace that value in the array with a 0. Remember that you will need to use modular division from Unit 2 to determine if a value is divisible by 3. Finally, print out the array in the format as seen in the sample run below.
Note: Be sure that your program accounts for arrays of any size, not just arrays that are 5 x 5. Your program will be tested against arrays of size n by n. It should work for any square array, not just the one shown. You should also use for loops in your program, not while loops.
Write your own function that illustrates a feature that you learned in this unit. The function must take at least one argument. The function should be your own creation, not copied from any other source. Do not copy a function from your textbook or the Internet.
Include all of the following in your Learning Journal:
The code for the function that you invented.
The inputs and outputs to three calls of your invented function.
Give an example of a while loop, then provide the equivalent do-while loop and for loop. Then give a different example of a do-while loop along with the equivalent while loop and for loop. Finally give an example of a for loop along with the equivalent while loop and do-while loop. Use your examples to illustrate the advantages and disadvantages of each looping structure and describe those disadvantages and advantages.
3.7 Code Practice
Instructions
When we read code and predict its output, it is called tracing code.
For this lesson, you will come up with your own challenging algorithm for other students to trace. It must contain at least 5 if statements and use at least one AND or OR boolean condition.
Note: Elif or else statements will not count - your statements must be if statements. Each if statement should use a unique variable name.
For this challenge, try reading 3 or 4 of your classmates' code as well. Trace their code and predict what it will output, then check the code by running it to see if you got it right, and submit your work for a grade.
The volume of a sphere is 4/3πr3, where π has the value of "pi" given in Section 2.1 of your textbook. Write a function called print_volume (r) that takes an argument for the radius of the sphere, and prints the volume of the sphere.
Call your print_volume function three times with different values for radius.
Include all of the following in your Learning Journal:
The code for your print_volume function.
The inputs and outputs to three calls of your print_volume.
edhesive 9.6 code practice:
4x5 grid array called n
n=[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5],[1,2,3,4,5]
and use a def printIt: and change n to [1,1,1,1,1],[2,2,2,2,2],[3,3,3,3,3],[4,4,4,4,4]
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot