Java Script Create a function that calculates the number of different squares in an n *n square grid. Check the Resources tab. Examples numberSquares (2)→ 5 numberSquares (4) ➡ 30 numberSquares (5) → 55
Q: PYTHON HOMEWORK QUESTION def area(side1, side2): return side1 * side2 s1 = 12 s2 = 6 Select…
A: Here, a function area is defined which is accepting 2 arguments and then returning the area by…
Q: • Write a C# code that contains an integer array whose size is 6. • The following method o will…
A: Hi there..!! Lets analyze what information is given to us and what is expected out of it.…
Q: Sum of two squares def sum_of_two_squares(n): Some positive integers can be expressed as a sum of…
A: Given:- Sum of two squaresdef sum_of_two_squares(n):Some positive integers can be expressed as a sum…
Q: python The intent of this program is to manage a set of contacts. Each contact will have data…
A: Actually, python is a easiest programming language. It is a dynamically typed programming language.
Q: JAVA LANGUAGE Body Mass Index Version 2.0 by CodeChum Admin Recall that according to the National…
A: Algorithm: Start Read height and weight Calculate bmi=703*(weight / (height * height)) Print bmi If…
Q: Cyclops numbers def is_cyclops(n): A nonnegative integer is said to be a cyclops number if it…
A: Given: Cyclops numbersdef is_cyclops(n):A nonnegative integer is said to be a cyclops number if it…
Q: PYTHON CODING This function takes a list of points and then returns a new list of points, which…
A: def solution_path(points): temp=points # adding starting point\ path=[points[0]] #…
Q: Sum of two squares def sum_of_two_squares(n): Some positive integers can be expressed as a sum of…
A: Python code: def sum_of_squares(n): sq = int(n ** 0.5) for a in range(sq, 0, -1): temp…
Q: Design an intelligent number editor system, a menu driven application having following methods. use…
A: Given, insert Number in Specific Position // this will insert number in an array in midinsert…
Q: JAVA Script | A Happy Year is the year with only distinct digits. Create a function that takes an…
A: Algorithm - Take one integer as input. Now use the below logic if(count==1) return false;…
Q: In Java scripts A number is called a Disarium when the sum of its digits in their respective order…
A: Algorithm - create a new method with one argument n. Now create a variable to store the number and…
Q: X275: Recursion Programming Exercise: Check Palindrome Write a recursive function named…
A: Palindrome: A word or phrase that reads the same backward as forward.
Q: This function takes a list of points and returns the total distance of the path that results from…
A: I have implemented the given requirements as per the specification. The code is as follows: from…
Q: Visual Basic is a tool that allows you to * develop application in O Graphical User Interface O…
A: VB IDE stands for Visual Basic Integrated Development Environment. It is a software application that…
Q: Please code in python Forbidden concepts: recursion, custom classes Create a program that…
A: # program to get name and category they belong on babsis of parental income # class class Student:…
Q: Write a menu driven program which has following options: 1. Factorial 2. Prime or not 3. Odd or even…
A: Here in the first two lines header statements are written for getting the input and printing the…
Q: JAVA PROGRAM THIS PROGRAM MUST WORK IN HYPERGRADE. The output should DISPLAY the following: Enter…
A: The Java program "NameSearcher" searches popular boy and girl names. Users may input a name to check…
Q: ternoon could you solve this exercise with c # is an exercise to solve with codes with the…
A: It is defined as a process or set of rules to be followed in calculations or other problem-solving…
Q: Problem Description The hailstone sequence is defined as the integer sequence that results from…
A: Python programming language : Python is a programming language that Guido van Rossum created in the…
Q: Java - Functions with 1D Arrays Create a program that asks the user for the size of an integer array…
A: Step-1: StartStep-2: Declare variable size and take input from userStep-3: Declare an array arr of…
Q: JAVA Script | A Happy Year is the year with only distinct digits. Create a function that takes an…
A: Algorithm - Take one integer as input. Now use the below logic if(count==1) return false;…
Q: ING Chess Moves Mapper using Shortest path algorithm As the title indicates, you will need to…
A: It is defined as a interpreted, object-oriented, high-level programming language with dynamic…
Q: Object Orientation Please use Arrays or ArrayLists where appropriate Implement a…
A: Time Complexity: O(n) Space Complexity: O(1) Algorithmic Paradigm: Divide and conquer.…
Q: Create a menu system program using Function: Menu System 1 – converting ft to inch 2 – Area of a…
A: As per our guidelines we are supposed to answer only one question. Kindly repost other questions as…
Q: Code Example 4-1 def get_username(first, last): s = first + "." + last return s.lower()…
A: Ans: Code Example 4-1 def get_username(first, last): s = first + "." + last return s.lower()…
Q: VA CODE PLEASE FINAL EXAM Part 3 Instructions: Create a java program that asks & accepts input from…
A: Step 1: Declare class Main. Define the main() method. Invoke the main1() method. Step 2: Declare two…
Q: class Main { // this function will return the number elements in the given range…
A: In the getArrayElemsInRange() method – Take an array to store the numbers of the range. Use a loop…
Q: X274: Recursion Programming Exercise: Cannonballs Spherical objects, such as cannonballs, can be…
A: the program is given below:-
Q: Python question Application: Python Fragment Formulation (Q1 – Q4) In this group of questions you…
A: As per Bartleby rules we can answer only first 3 subparts. I request you to post question 4…
Q: eries: A triangle number counts the objects that can form an equilateral triangle. The nth triangle…
A: code : #include<iostream>using namespace std;int main(){ int n,i=1; cout<<"Enter…
Q: Write a function to determine the resultant force vector R of the two forces F₁ and F2 applied to…
A: The required function is def force_vec(F1, F2, theta1, theta2): R = np.array([0, 0]) # For…
Q: C Program Removing Elements in an Array Make a program that creates an array by asking the size n of…
A: Step-1: Start Step-2: Declare variables n, i, j, element, index Step-3: Take the input array size…
Step by step
Solved in 3 steps with 1 images
- CodeWorkout Gym Course Q Search kola shreya@ columbusstate.edu Search exercises... X274: Recursion Programming Exercise: Cannonballs X274: Recursion Programming Exercise: Cannonballs Spherical objects, such as cannonballs, can be stacked to form a pyramid with one cannonball at the top, sitting on top of a square composed of four cannonballs, sitting on top of a square composed of nine. cannonballs, and so forth. Given the following recursive function signature, write a recursive function that takes as its argument the height of a pyramid of cannonballs and returns the number of cannonballs it contains. Examples: cannonball(2) -> 5 Your Answwer: 1 public int cannonball(int height) { 3. 4} Check my answer! Reset Next exercise FeedbackCyclops numbersdef is_cyclops(n):A nonnegative integer is said to be a cyclops number if it consists of an odd number of digits so that the middle (more poetically, the “eye”) digit is a zero, and all other digits of that number are nonzero. This function should determine whether its parameter integer n is a cyclops number, and return either True or False accordingly n Expected result 0 True 101 True 98053 True 777888999 False 1056 False 675409820 FalseC++ language Write a menu driven program which has following options:1. Factorial2. Prime or not3. Odd or even4. ExitOnce a menu is selected, the appropriate action should be taken and once this action is finished,the menu should reappear. Unless the user selects the ‘Exit’ option the program should continueto work.Note: Consider array of random numbers from user to find Prime Numbers/Odd/Even and userentered value for factorial.
- Computer Science C# Programming Object Orientation Please use Arrays or ArrayLists where appropriate Implement a menu driven program that has some operations for a food truck. A food truck has multiple food items as well as a menu which contains a selection of the food items which will be sold for that day. A maximum of 10 food items can appear on the menu for any day. For each food item keep a code, description, category, price and quantity in stock (code, description and category are not usually changed). Create a comma delimited text file called "items.txt" for 15 or more food items, indicating the item's description, category, price and quantity in stock. Read all the food items from the text file “Items.txt” Display all the food items available for this food truck. Continuously prompt the user for a food item’s code to be placed on the menu until the menu is full or the user enters -1. Note that only food items which have a positive quantity in stock may be added to…C programming language questionVisual Basic is a tool that allows you to * develop application in Graphical User Interface Character User Interface O Real time loop repeats a group of statements for each item in a collection of objects or for each element of an array. O While loop. O Do while loop. O For each loop. *
- C++ programming Chapter(s) Covered: Chapter 1-8 Concepts tested by the program: Working with one dimensional parallel arrays Use of functions Use of loops and conditional statements Project Description The Lo Shu Magic Square is a grid with 3 rows and 3 columnsshown below. The Lo Shu Magic Square has the following properties: The grid contains the numbers 1 – 9 exactly. Each number 1 – 9must not be used more than once. So, if you were to add up thenumbers used, The sum of each row, each column and each diagonal all add upto the same number, Write a program that simulates a magic square using 3 onedimensional parallel arrays of integer type. Each one the arrays corresponds to a row of the magicsquare. The program asks the user to enter the values of the magicsquare row by row and informs the user if the grid is a magicsquare or not. See the sample outputs for more clarification. Project Specifications Input for this project: Values of the grid (row by row) Output for this…class Main { // this function will return the number elements in the given range public static int getCountInRange(int[] array, int lower, int upper) { int count = 0; // to count the numbers // this loop will count the numbers in the range for (int i = 0; i < array.length; i++) { // if element is in the range if (array[i] >= lower && array[i] <= upper) count++; } return count; } public static void main(String[] args) { // array int array[] = {1,2,3,4,5,6,7,8,9,0}; // ower and upper range int lower = 1, upper = 9; // throwing an exception…C++
- C++ LANGUAGE Create a menu system program using Function: Menu System 1 – converting ft to inch 2 – Area of a circle 3 – Exit C++ LANGUAGE Discussion Array Store the 12 numbers in an arrayNum by using input. Then output the 12 numbers on array. Example: 4 – 6 – 7 – 8 – 9 – 5 – 3 - 1- 22 – 2 – 33 - 8 upload your screenshot of the codes and output.C Program Removing Elements in an Array Make a program that creates an array by asking the size n of the array and n integer inputs. Example: Input size of array: 5 Array elements: 1 2 3 4 5 After creating the array, you need to prompt the user again to pick m number of elements to remove. If the input is invalid, prompt the user to try again. An input is invalid if it meets either one of these criteria: Greater than size n of the array Negative number Example: Number of elements to remove: -2 Invalid number. Try again: 3 After a valid input, prompt the user for the valid indices to remove. An index is valid if it is within the range of the array size. Output the array elements after a valid index input and consider the new size of the array after. Example: Index (1): 2 Array elements: 1 2 4 5 Index (2): 4 Invalid index! Try again. Index (2): 0 Array elements: 2 4 5 Index (3): 2 Array elements: 2 4 After everything, print FINISHED! Input 1. Size of array 2.…Please code in python Forbidden concepts: recursion, custom classes Create a program that takes a university student’s name, their 1st parent’s income, and their second parent’s income. If the average income between the parents is $40,000 or below, then it would put them into a Tuition Grant list. If it’s above, then it would be a Full Tuition Required list. Once the university admission officer has completed inputting all the students, the program will end and print out the two lists.