


![/ driving progran int main int main () int ary[]={10, 11,7,13,15); int num, mul, sum,prime: input (&num) for ( int i=0; ǐくnun](http://img.homeworklib.com/questions/797220f0-b853-11ea-a08a-d9ba87395e09.png?x-oss-process=image/resize,w_560)

C+ using pointers 2. Determine the following information about each value in a list of positive...
(Please use C language, not C++) Determine the following information about each value in a list of positive integers. a. Is the value a multiple of 7, 11, or 13? b. Is the sum of the digits odd or even? (parameter output returns 0 for even, 1 for odd) c. Is the value a prime number? (parameter output returns 0 nonprime, 1 for prime) Use an output file for results. The goal is to implement both pass by value and...
3. [30pts] Determine the following information about a value passed in as a parameter. (a) Is the value a multiple of 7, 11 or 13? (b) The sign of the value (-1 if it is negative, 0 if it is 0 and 1 if the value is positive). You should write a function with three type int parameters, one input parameter (the value) and two other output parameters. The function should send back the answers to the two questions above...
PROGRAMMING IN C. 1) The first program will compute compounded interest. Suppose you invest $1000.00 at an interest rate of 2% per year. If the interest is computed at the end of each day, it is added to your account (i.e., the interest is compounded daily). Print what the account value will be at the end of each year for 20 years. Use data type double for money. For 365 days per year (ignore leap year), the daily interest rate...
Is Prime Number In this program, you will be using C++ programming constructs, such as functions. main.cpp Write a program that asks the user to enter a positive integer, and outputs a message indicating whether the integer is a prime number. If the user enters a negative integer, output an error message. isPrime Create a function called isPrime that contains one integer parameter, and returns a boolean result. If the integer input is a prime number, then this function returns...
Write a java application to input 2 positive integers X and Y such that X is less than Y. Then the program should do the following: 1. Output the sum of even integers between 1 and X. 2. Output the average of odd integers between 1 and Y. 3. Output the common divisors of X and Y.
20. [5 points] Rewrite the following ML. function using patterns fun factn. ifn-0 then 1 else n fact (n-1) 21. [S points) Using map function, write an ML function int2real of type int list real list that takes a list of integers and returns the same numbers converted to real. For example, if the input is [1,2,3], the output should be like [1.0,2.0,3.0 22. [5 points] Using foldr function, write a function duplist of type·a list 'a list that takes...
How to solve it using Python?
5. Write a function called no_squares which takes an input parameter N, a positive integer, and returns: 1 if N is not divisible by a square and has an even number of prime factors -1 if N is not divisible by a square and has an odd number of prime factors 0 if N is divisible by a square For example, no-squares (10) returns 1 (since 10 = 2x5), no-squares (30) returns-1 (since 30...
Please use Python
Exercise 1 Create a program named sentinel_loop using break. This program should implement functionality that is the same as the Part 1 tutorial example, except for the following differences: • • This program should count even and odd integers. This program should report counts of even and odd integers. Remember that even integers can be identified using the test condition: value % 2 == 0 Remember to test your code for appropriate behavior when the user signals...
Please Use C++ for coding
. . Note: The order that these functions are listed, do not reflect the order that they should be called. Your program must be fully functional. Submit all.cpp, input and output files for grading. Write a complete program that uses the functions listed below. Except for the printodd function, main should print the results after each function call to a file. Be sure to declare all necessary variables to properly call each function. Pay attention...
Please complete the following programming in C++ with clear explanations. Thanks! Primitive Types, Searching and Recursion a) Create a class Homework (in a file homework.h and homework.cpp). b) Create a function initialize_array that receives two parameters: an array of integers and the array size. Use a for loop and an if statement to put 1s in the odd positions of the array and 0s in the even positions. (Use pointers to pass an array of integers as parameter) c) Create...