AHPA #11: Changing Grades * * Create a C function (switcher) that will receive a pointer to the finalExams array, using only pointers look for D scores and boost them to C scores. (ouput should be same as picture) #include <stdio.h> void switcher() { } int main(void) { int finalExams[] = {90,82,65,79,67,82,94,64,88,78,92,61,96,83,74}; return 0;}
Q: I've written the following C function but it is not working correctly. What did I do wrong? int…
A: The objective of the question is to identify the error in the given C function. The function is…
Q: C++ Write a function SwapArrayEnds() that swaps the first and last elements of the function's…
A: Introduction: In this question, a C++ partially code is given and asked to write a swapping function…
Q: Create a function that takes a single string as argument and returns an ordered array containing the…
A: In this problem we need to design a C# code. Please find the logic below that we will be used.…
Q: Write the function rotateRight which shifts each element in the arra moving the last element to the…
A: NOTE: C++ does not allow to return an entire array as an argument to a function. So you need to use…
Q: Rewrite the countZeros function using a standard algorithm instead of a loop. arrays.cpp #include…
A: count is the function used to count occurrence of a number in an array This function takes the base…
Q: Write a C Program that should: ask the user for how many integers they will enter, use malloc to…
A: #include <stdio.h>int main(int argc, char *argv[]) { int size; int *ptr; //ask the…
Q: 1) Write an InsertFirst function for a partially filled array. This function should accept all…
A: So the Algorithm goes like this: you need to pass the size of array , array and the value you need…
Q: Ac++ application that takes five user inputs and stores them in an array before passing them to a…
A: Introduction: The C++ software shown below will adhere to the following criteria: Including the…
Q: C Programming Write function updateHorizontal to flip the discs of the opposing player, it should…
A: Algorithm: Step 1: Define function checkHorizontal(). Initialize flank to 0 and count to 0. Step 2:…
Q: // Sharissa Sullivan //January 20 2023 // Chapter 9 Array Expander // C ++ #include using…
A: Algorithm: Start Create an array with three elements Create a size variable and set it to three…
Q: in C++ // praphrase or change this code , while the purpose and output is same
A: I have provided code by rephrasing this code. In which purpose and output is same.
Q: Write the function lastOf which searches the array a for the last occurance of any value contained…
A: Algorithm: Start Read size of 2 arrays n and m Read n array elements in array a Read m array…
Q: bool ok(int q[]) which takes an array q and returns true if the array represents a valid…
A: Given that, Write a function bool ok(int q[]) which takes an array q and returns true if the array…
Q: C++ Programming: Design a class to perform various matrix operations. A matrix is a set of numbers…
A: Introduction: Here is the class to perform matrix operations. A matrix is a set of numbers arranged…
Q: (c) The communication of the code is poor. Suggest two changes to the code - one to improve…
A: As you asked multiple question we are answering first. If you want solution of any specific question…
Q: Q1) Write a recursive function in C to check palindrome array. Example: arr[] = {2,1,1,1,2}; This is…
A: NOTE: This is a multiple-type question. So, according to the guidelines, we will answer the first…
Q: Problem Statement Comparing function: Please complete the function below. This function has three…
A: Hello student Greetings The function takes an integer array, an integer as the size of an array,…
Q: Write the function average which returns the mean of the given array (that is, the sum divided by…
A: #include<cstddef>//size_t#include<iostream>using namespace std;double average(const int…
Q: 2. Write a function that has one parameter which is an array of type double with 50 elements. The…
A: #include <iostream> using namespace std; // Function to find the last negative element in the…
Q: C++ Coding: Arrays Implement ONE array of the English alphabet (26 characters). Cast and generate…
A: According to the question below the Complete Program: Program Output:
Q: c++ Write a function named “countTheSameAsLast” that accepts an array of pointers to class objects…
A: C++ codeCode screenshotOutput screenshot
Q: C++ Language Please add an execution chart for this code like the example below. I have provided…
A: As per the given example above the Execution Chart means the comment for each task in the program.…
Q: Implement a function named largerThanN that accepts three arguments: • an array of type int, • the…
A: void largerThanN(int array[], int l, int n) { cout << "The numbers that are larger than "…
Q: // New Function prototypes void showValues(const int *, int); // display 10 numbers in a line from…
A: #include <iostream> #include <iomanip> #include <cstdlib> #include <ctime>…
Q: Write the function fill which fills an array with a given value. Return the modified array. (Hint:…
A: 1)create a new array of size len 2) iterate over array 3) Put new value at each index 4) return…
Q: Write the function removedOdds which removed all of the odd numbers from a partially-filled array.…
A: In the function removeOdds, We are taking an array named finalarray[] and copying all the final…
Q: Given an array of integers, write a PHP function to find the maximum element in the array. PHP…
A: The following are steps that need to be taken for the given program:The function first checks…
AHPA #11: Changing Grades
*
* Create a C function (switcher) that will receive a pointer to the finalExams array, using only pointers look for D scores and boost them to C scores.
(ouput should be same as picture)
#include <stdio.h>
void switcher() {
}
int main(void) {
int finalExams[] = {90,82,65,79,67,82,94,64,88,78,92,61,96,83,74};
return 0;
}
Unlock instant AI solutions
Tap the button
to generate a solution
Click the button to generate
a solution
- AHPA #11: Changing Grades *use c programming language * Create a C function (switcher) that will receive a pointer to the finalExams array, using only pointers look for D scores and boost them to C scores. (ouput should be same as picture) #include <stdio.h> void switcher() { } int main(void) { int finalExams[] = {90,82,65,79,67,82,94,64,88,78,92,61,96,83,74}; return 0;}Part 2: Unroll Write a function called unroll, which takes in a square array of arrays (i.e. a grid with n rows and n columns). An input could look like this: const square = [ [1, 2, 3, 4], [5, 6, 7, 8], ]; [9, 10, 11, 12], [13, 14, 15, 16] unroll should take in such a square array and return a single array containing the values in the square. You should obtain the values by traversing the square in a spiral: from the top- left corner, move all the way to the right, then all the way down, then all the way to the left, then all the way up, and repeat. For the above example, unroll should return [1, 2, 3, 4, 8, 12, 16, 15, 14, 13, 9, 5, 6, 7, 11, 10].In C programming: Write a main() function using the following requirements:• Define a SIZE constant (the value is irrelevant, but for testing, you may want to keep it small enough – no bigger than 5)• Create an array of course pointers using SIZE• Dynamically allocate each element of the array• Call inputAllCourses()• Call printAllCourses().
- AHPA #10:The Secure Array(use C programming)• A programmer that you work with, Peter, is a jerk.• He is responsible for an array [theArray] that is a key part of an importantprogram and he maintains a sum of the array values at location [0] in the array.• He won't give you access to this array; however, your boss has told you that youneed to get input from the user and then place it into the array.• Each evening Peter will scan the code and remove any illegal references to hisarray.• Using pointers, access Peter's array without him knowing it and place threevalues that you got from the user (101, 63, 21) at locations 3, 6, and 9.Recalculate the sum value and update it. ( the output should be same as the picture)C++, Please add a function where it can display the median, the maximum number, the minimum number, in an array entered by the user. Code: #include<iostream> using namespace std; class Search_Dynamic_Array { public: Search_Dynamic_Array(); int getArrSize(); void getArray(); void setArrsize(int); void setArray(int*); int getSum(int*); private: int arr_size; int arr[]; }; Search_Dynamic_Array::Search_Dynamic_Array() { //ctor } int Search_Dynamic_Array::getArrSize() { return arr_size; } void Search_Dynamic_Array::getArray() { cout << "The elements of the array are: "; for(int i=0; i<arr_size; i++){ cout << arr[i] << " "; } } void Search_Dynamic_Array::setArrsize(int s) { arr_size=s; } void Search_Dynamic_Array::setArray(int a[]) { for(int i=0; i<arr_size; i++){ arr[i]=a[i]; } } int Search_Dynamic_Array::getSum(int a[]) { int sum; for(int i=0; i<arr_size; i++){ sum +=arr[i]; } return sum; } int main() { int s=1, a[s]; cout << "Enter the size of the…AHPA #11: Changing Grades *use c programming language * Create a C function (switcher) that will receive a pointer to the finalExams array, using only pointers look for D scores and boost them to C scores. (ouput should be same as picture) #include <stdio.h> void switcher() { } int main(void) { int finalExams[] = {90,82,65,79,67,82,94,64,88,78,92,61,96,83,74}; return 0;}
- 1- Write a user-defined function that accepts an array of integers. The function should generate the percentage each value in the array is of the total of all array values. Store the % value in another array. That array should also be declared as a formal parameter of the function. 2- In the main function, create a prompt that asks the user for inputs to the array. Ask the user to enter up to 20 values, and type -1 when done. (-1 is the sentinel value). It marks the end of the array. A user can put in any number of variables up to 20 (20 is the size of the array, it could be partially filled). 3- Display a table like the following example, showing each data value and what percentage each value is of the total of all array values. Do this by invoking the function in part 1.C++ Dynamic Array Project Part 2C++
- C++ Double Pointer: Can you draw picture of what this means : Food **table? struct Food { int expiration_date; string brand; } Food **table; What is this double pointer saying? I know its a 2D matrix but I don't understand what I'm dealing with here. Does the statement mean that we have an array of pointers of type Food and what is the other * mean? I'm confused.C++MIPS Assembly The program: Write a function in MIPS assembly that takes an array of integers and finds local minimum points. i.e., points that if the input entry is smaller than both adjacent entries. The output is an array of the same size of the input array. The output point is 1 if the corresponding input entry is a relative minimum, otherwise 0. (You should ignore the output array's boundary items, set to 0.) My code: # (Note: The first/last entry of the output array is always 0# since it's ignored, never be a local minimum.)# $a0: The base address of the input array# $a1: The base address of the output array with local minimum points# $a2: Size of arrayfind_local_minima:############################ Part 2: your code begins here ###la $t1, ($t2)la $t1, ($t2)move $a1, $s0 li $a2, 4jal find_local_minima print:ble $a2, 0, exitlw $a0, ($s0)li $v0, 1syscall addi $s0, $s0, 4addi $a2, $a2, -1 ############################ Part 2: your code ends here ###jr $ra I am not getting the correct…