Create a function which constructs a rectangular birthday cake, based on someone's name and age ! Build it out of strings in an array and makes sure to surround the birthday message with the character that fits the rule: • If the age is an even number, surround the message with "#". • If the age is an odd number, surround the message with
Q: Implement a single, complete C function named "count_vowels" that counts the number of lowercase…
A: Among the 26 alphabets present in the English language, there are 5 vowels and 21 consonants. "a",…
Q: Create a function that takes the dimensions of two triangles (as arrays) and checks if the first…
A: Algorithm - Takes Inputs from user. Now use the below logic - if(brick[0]+brick[1] <…
Q: Create a function that takes two numbers as arguments (num, length) and returns an array of…
A: FUNCTION EXPLANATION: Define a function multiple and this function will take two numbers ( num and…
Q: Write a function set_zero() that takes a numpy array and a limit number as parameters. Set the items…
A: Program Approach: Import NumPy module required for NumPy array. Create a NumPy array a Declare a…
Q: An array with an odd number of elements is said to be centered if all elements (except the middle…
A: Code and output is in step2.
Q: Write a function called double getAverage(int *array, int SIZE), where it accept the array as…
A: Question has asked to write a function in C++ called double getAverage(int *array, int SIZE)…
Q: Build a function that creates histograms. Every bar needs to be on a new line and its length…
A: 1. created the method with 2 arguments,1 array, and a special character 2. create the result string…
Q: Create a function that returns true if the first array can be nested inside the second. arr1 can be…
A: Introduction: In this question, we are asked to complete a canNest function for the given conditions…
Q: Write a function definition to replace all even values in an integer array with a 1, all odd values…
A: Write a function definition in C++ that accepts the array and its size as the parameters and then…
Q: Q3: write a program to pass a two dimensional array as a parameter to a function which is used to…
A: Note: since programming language is not mention we are provide solution in c programming . please…
Q: Create a function using Java: Number of Rows = 3-6 Number of Columns = 3-6 Function Name: hint…
A: Create a function using Java: Number of Rows = 3-6 Number of Columns = 3-6 Function Name:…
Q: C++ Create a function append(v, a, n) that adds to the end of vector v a copy of all the elements…
A: // C++ code to demonstrate copy of vector// by iterative…
Q: Write a function that determines who has won a game of tic-tac-toe. The function should receive a…
A: Program approach: Including header files. Declaring and defining the int checkWinner(char…
Q: Create a function that tests if a number is the exact upper bound of the factorial of n. If so,…
A: Codefunction isExact(n) { let a = 1; for (let i=1;i<=n;i++) { a *= i; if (n === a) return [n,…
Q: Write a function call it "calculates" (its name) that accepts an array of integers, its size, and…
A: As no programming language is mentioned, it is solved using basic C++
Q: Create a function that tweaks letters by one forward (+1) or backwards (-1) according to an array.
A: Start declare a function "tweakLetters()" with string and array as parameter declare an empty string…
Q: Create a function candyPrize with one input, an array of numbers. The function should add all the…
A: As no programming language is mentioned, it is solved using basic C++
Q: return
A: A function which will find the average of all elements of an array of integers. float average(int…
Q: Create a function in Javascript that takes two numbers as arguments (num, length) and returns an…
A: JavaScript Code for above : // required function for abovefunction ReqdFunction(num, length) {…
Q: In a one-dimensional array, one-year average daily temperature information of the city of Karabuk is…
A: To Do: To write a C program.
Q: Write a function that takes two arguments an array and the size of the array and retums a count of…
A: C Program used to answer this question.
Q: Write a function named swap ) that has 2 parameters which it will swap between any 2 values. Write a…
A: Ouput :-
Q: A football team plays a football game almost every month. It stores the number of goals scored per…
A: the solution for the above given question is given below:
Q: Write a function that finds the smallest element in an array of double values using the following…
A: Here is the program in C++: #include <iostream> using namespace std; double min(double…
Q: Build a function that creates histograms. Every bar needs to be on a new line and its length…
A: Coded using JavaScript.
Q: 1. Write function that swaps the values of two integer variables a. using pass by value and b. pass…
A: 1. a. The function to swap two integers by passing the values is shown below. void swap(int x, int…
Q: Create a function using Java: Number of Rows = 3-6 Number of Columns = 3-6 Function Name:…
A: boolean winInDiagonalFS(int[][] board, int piece) { int rows = board.length, columns =…
Q: Create a function that accepts a two dimensional array of integers and displays a) Row by row ( fix…
A: A required program is as follows, #include<stdio.h> #define r 3 #define c 4 /*Define a…
Q: Create a function that takes two numbers as arguments (number, length) and then returns the list of…
A: created the method 2 arguments created the variable for storing the result array for loop on the…
Q: Check test scores) The answers to a true-false test are as follows: T T F F T. Given a…
A: According to the Question below the Complete Solution: Program Output:
Q: A game rolls a die 10 times and counts how many times the number 5 or 6 shows up. If there are - a…
A: First of all use the random function to generate 10 dice values. Pass the values to the function.…
Q: Write a function that takes an int array as an input and finds the first and second odd numbers. You…
A: C++ Program for above : #include <iostream> using namespace std; //function to find first…
Q: Q3: write a program to pass a two dimensional array as a parameter to a function which is used to…
A: Program: // C++ Version 14#include <iostream>using namespace std; // Main functionint main()…
Q: 1) Create a array of Fahrenheit temperatures, as follows int fahr []=…
A: Program Instructions:Define the given array in code and calculate the size of the array.Use for loop…
Q: Create a function that takes a number that represents a person's programming language score, and…
A: Algorithm - Take input from user Use that input into the method argument. use the below logic…
Q: Typedef struct Complex { Double a; Double b; } COMP_t, *COMP;
A: While doing programming in any programming language, you need to use various variables to store…
Q: Write a function that takes a string and calculates the number of letters and digits within it.…
A: Algorithm - Take one string as input. Now use the below logic…
Q: 4) Write a function named "rotate_right" that takes as its arguments the following: (1) an array of…
A: According to the question below the solution: Output:
Q: Write a function named "location_of_largest" that takes as its arguments the following: (1) an…
A: We need to define the function "location_of_largest" that returns the index of the largest number in…
Q: Create a function that takes a number that represents a person's programming language score, and…
A: Since the programming language is not mentioned, I have done the code using JavaScript.
Q: Write a function that takes a string and calculates the number of letters and digits within it.…
A: In this problem we need to design the pHP program. Input - String Ouput - Array
Q: An array my_Array[] consisting ‘a’ s, ‘b’ s, and ‘c’s. The task is to write a function that arranges…
A: C++ Code: #include <iostream> using namespace std; int main () { const char size=7;…
Q: (a) Write a function number() that receives a string as its argument and returns a code number…
A: The character array is a collection of characters stored in a linear array data structure. The…
Q: Create a function using Java: Number of Rows = 3-6 Number of Columns = 3-6 Function Name:…
A:
Q: Write a function which will accept A and B (provided by the user). Write anonymous function which…
A: import required modules like numpy,matplotlib.pyplot,math ask user for inputs for values A,B by…
Q: Write a function definition to return the last index of a value in an array. 1. Accept the array of…
A: Given: To write the code in C++.
solve this question in python 3
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 4 images
- (Statistics) a. Write a C++ program that reads a list of double-precision grades from the keyboard into an array named grade. The grades are to be counted as they’re read, and entry is to be terminated when a negative value has been entered. After all grades have been input, your program should find and display the sum and average of the grades. The grades should then be listed with an asterisk (*) placed in front of each grade that’s below the average. b. Extend the program written for Exercise 1a to display each grade and its letter equivalent, using the following scale: Between90and100=AGreaterthanorequalto80andlessthan90=BGreaterthanorequalto70andlessthan80=CGreaterthanorequalto60andlessthan70=DLessthan60=F(List maintenance) The following letters are stored in an alphabet array: B, J, K, M, S, and Z. Write and test a function named adlet(), which accepts the alphabet array and a new letter as arguments, and then inserts the new letter in the correct alphabetical order in the array.(Numerical) a. Define an array with a maximum of 20 integer values, and fill the array with numbers input from the keyboard or assigned by the program. Then write a function named split() that reads the array and places all zeros or positive numbers in an array named positive and all negative numbers in an array named negative. Finally, have your program call a function that displays the values in both the positive and negative arrays. b. Extend the program written for Exercise 6a to sort the positive and negative arrays into ascending order before they’re displayed.
- (Data processing) The answers to a true-false test are as follows: T T F F T. Given a twodimensional answer array, in which each row corresponds to the answers provided on one test, write a function that accepts the two-dimensional array and number of tests as parameters and returns a one-dimensional array containing the grades for each test. (Each question is worth 5 points, so the maximum possible grade is 25.) Test your function with the following data:(Numerical) Write and test a function that returns the position of the largest and smallest values in an array of double-precision numbers.Write a findSpelling Function -PHP Write a function findSpellings($word, $allWords) that takes a string and an array of dictionary words as parameters. The function should return an array of possible spellings for a misspelled $word. One way to approach this is to use the soundex() Words that have the same soundex are spelled similarly. Return an array of words from $allWords that match the soundex for $word. I have most of the code. How do I append the $sound to the $mathcing array?
- """3. Write a function validSolution/ValidateSolution/valid_solution()that accepts a 2D array representing a Sudoku board, and returns trueif it is a valid solution, or false otherwise. The cells of the sudokuboard may also contain 0's, which will represent empty cells.Boards containing one or more zeroes are considered to be invalid solutions.The board is always 9 cells by 9 cells, and every cell only contains integersfrom 0 to 9. (More info at: http://en.wikipedia.org/wiki/Sudoku)""" # Using dict/hash-tablefrom collections import defaultdict def valid_solution_hashtable(board): for i in range(len(board)): dict_row = defaultdict(int) dict_col = defaultdict(int) for j in range(len(board[0])): value_row = board[i][j] value_col = board[j][i] if not value_row or value_col == 0: return False if value_row in dict_row: return False else: dict_row[value_row] += 1.Part 1 Write a function that takes an integer array and the size of the array The array is supposed to have 'N' integers in it, where N-1 integers are repeated even number of times and one integer is repeated odd number of times For example array = {1,5,5, 1,2,5,2,2,5}. 1 and 5 are repeated even number of times whereas 2 is odd number times. The function should find the element which is repeated odd number of times and return it. In the case of the example shown above, the function should return 2. int FindSingleElement(int arr[], int size) { } int main(int argc, char *argv[]) { return 0; } THIS IN C++.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.
- 5. Write a function which will find the average of all elements of an array of integers. Pass an array and a dimension (the number of elements), and return the value of the average as a float ( the return value). Test this function in the main program with the array: 5, 7, 3, 5, 6, 4.c++ Write a function named "location_of_largest" that takes as its arguments the following: (1) an array of integer values;(2) an integer that tells how many integer values are in the array. The function should return the subscript of the element containing the largest of the values in the array. Thus, for example, if the array that's passed to the function looks like this:58 26 90 34 71 then the function should return the integer 2 as its value. If there is more than one cell containing the largest of the values in the array, then the function should return the smallest of the subscripts of the cells containing the largest values. For example, if the array that's passed to the function is 58 | 26 | 91 | 34 | 70 | 91 | 88 then the largest value occurs in cells 2 and 5 , so the function should return the integer value 2.An array my_Array[] consisting ‘a’ s, ‘b’ s and ‘c’s. The task is to write a function that arranges the arraysuch that all ‘a’s are placed first, then all ‘b’s and then all ‘c’s in last.