Write a function named findSales that has two arguments: unit price (type double) and quantity sold (type int). The function will calculate and return the net sales. If the quantity sold is over 20, then the company gives 15% discount.
Write a function named findSales that has two arguments: unit price (type double) and quantity sold (type int). The function will calculate and return the net sales. If the quantity sold is over 20, t...
Python Assignment: Write a function named AddEm that has two arguments. The function returns the value of adding numbers starting from the first arguments, with increments of 1 ending and including the second argument. if 1st argument is less than the second argument use a while loop to generate the return value. Otherwise, return 0
PYTHON QUESTION PLEASE!!
Write a function named problem3 that accepts two strings as the
arguments, returns the characters that occur in both strings. Test
case: the arguments are “apple@123” and “banana@#345”, your program
should return “a@3”.
Write a function named problem3 that accepts two strings as the arguments, returns the characters that occur in both strings. (20 pts) Test case: the arguments are "apple@123” and “banana@#345”, your program should return "a@3".
Write a function named stats, that takes an array and the number of elements in the array as arguments. It must compute and print the minimum value in the array, maximum value in the array and the average value of all the values inside the array. Your function MUST be named stats Your function has two parameters in the following order: an array of type double The number of elements in the array, type int Your function should NOT return...
1. Write a statement that calls a function named showSquare, passing the value 10 as an argument. 2. Write the function prototype for a function called showSquare. The function should have a single parameter variable of the int data type and areturn type of void. 3. Write the function prototype for a function called showScoreswith a parameter list containing four integer variables and a return type of void. 4. Look at the following function definition: double getGrossPay(int hoursWorked, double payRate)...
Write a function template named summarray, with two parameters: and array called are and an int holding the number of elements in arr. The function should return the sum of the elements in arr. this template must work for double or int arrays. Show a sample function call to the template function you wrote. What would you have to do to use the templates sumArray function with an array of objects of a custom class?
(10 pts) Define a two-dimensional array named temp with three rows and four columns of type int such that the first row is initialized to 6, 8, 12, 9; the second row is initialized to 10, 13, 6, 16; and the third row is initialized to 27, 5, 10, 20. (10 pts) Consider the following declarations, and see p.566: enum brands = { GM, FORD, TOYOTA, BMW, KIA }; const int N_BRANDS = 5; const int COLOR_TYPES = 6; double...
25. (15 pes) Write the C++ code for a function that receives three double numbers. The function should calculate the average of the three numbers and them returm the result. Name the function conm Name the fornal parameters aumi, nu compAverage function. In addition, write a statement that invokes the compAverage f assigns its arguments: 14.50, 18.72, and S3.1 function and its return value to a double variable named answer. Use the following mumbers as the 26, (5 pts) Write...
A class named Part has two fields: category (int) and cost (double). Write a single Comparable compareTo method that orders Part objects by ascending categories and by ascending cost within each category For example: . . . . 2 12.96 2 45.12 2 87.00 2 100.38 2 253.93 . . . . 10 34.12 10 34.98 10 294.23 10 3467.89 . . . .
a) Declare and instantiate an array named scores of twenty-five elements of type int. (b)Write a statement that declares an array namedstreetAddress that contains exactly eighty elements of typechar. 2. In a single statement: declare, create and initialize an arraynamed a of ten elements of type int with the values of the elements (starting with the first) set to 10, 20,..., 100 respectively. 3. Declare an array reference variable, week, and initialize it to an array containing the strings "mon",...
1. Define a structure named StockItem with two string fields, supplier and productName and one int field, catalogNumber. Then define a structure named Customer with string fields name, streetAddress, city, postalCode, phone. Assume that structures named Date and Money have already been defined (representing a date and a monetary amount respectively. Finally, define a structure named Purchase that has these fields: buyer of type Customer, itemSold of type StockItem, dateOfSale of type Date, paid of type Money, returnable of type...