1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
liubo4ka [24]
3 years ago
13

The function below takes two numeric parameters. The first parameter specifies the number of hours a person worked and the secon

d the number of dollars that they earn each hour. Compute the value of their weekly pay check. Any time worked beyond 40 hours, is considered overtime. Any overtime earns double pay (but only on the hours beyond the first 40). (python)
Function:

def compute_pay_with_overtime(hours_worked, hourly_rate)
Computers and Technology
1 answer:
Triss [41]3 years ago
6 0

Answer:

def calculate_pay(total_worked_hours, rate_per_hour):

   if total_worked_hours > 40:

       return (40 * rate_per_hour) + ((total_worked_hours - 40) * 2 * rate_per_hour)

   else:

       return total_worked_hours * rate_per_hour

Explanation:

  • Create the calculate_pay function that takes 2 parameters.
  • Inside the function check whether the total_worked_hours is greater than 40 and then return the pay by calculating with the help of formula for work over 40 hours.
  • Otherwise return the pay by multiplying the total_worked_hours with rate_per_hour.
You might be interested in
Which type of vulnerability scan mimics the work of a threat actor who has already exploited a vulnerability and compromised cre
Vilka [71]

There are different type of vulnerability scan. The type of vulnerability scan mimics the work of a threat actor is called Credential Vulnerability Scan.

Credential Vulnerability Scan is known to be a scan in which there is a valid authentication of credentials Example are usernames and passwords etc. are known to be supplied to the vulnerability scanner to mimic the work of a threat actor that has these credentials.

They are known to be very slow but can give an in-depth insight into the system by accessing a wide range of the installed software  

Learn more from

brainly.com/question/14728460

5 0
2 years ago
Mohammad plans to visit a cave over the weekend with his friends. He wants to take photos inside of the cave. What piece of equi
Alborosie
A camera strap
Its the only one that makes sense
7 0
2 years ago
Read 2 more answers
Strlen("seven"); what is the output?
Leokris [45]

Answer:

A is your answer hope this helps

4 0
3 years ago
This program involves working with a set of discrete data (grades) and determining their average (arithmetic mean), median, and
Inga [223]

Answer:

#include <iostream>

#include <iomanip>

#include <cmath>

using namespace std;

// function declarations

double getAverage(int* grades, int size);

double getMedian(int* grades, int size);

int getMode(int* grades, int size);

double getSd(int* grades, int size);

int main()

{

// Declaring variables

int size, val;

// setting the precision to two decimal places

std::cout << std::setprecision(2) << std::fixed;

// Getting the input entered by the user

cout << "How many grades you wnat to enter :";

cin >> size;

// Creating array dynamically

int* grades = new int[size];

/* Getting the inputs entered by the user

* and populate those values into array

*/

for (int i = 0; i < size;)

{

while (true)

{

cout << "Enter the grade#" << i + 1 << ":";

cin >> val;

if (val < 0)

{

cout << "** Invalid.Must be greater than zero. **" << endl;

continue;

}

else

{

grades[i] = val;

i++;

break;

}

}

}

// calling the functions

double avg = getAverage(grades, size);

double median = getMedian(grades, size);

int mode = getMode(grades, size);

double sd = getSd(grades, size);

cout << "Average :" << avg << endl;

cout << "Median :" << median << endl;

cout << "Mode :" << mode << endl;

cout << "Standard Deviation :" << sd << endl;

return 0;

}

// This function calculates the average of grades

double getAverage(int* grades, int size)

{

double sum = 0.0;

// calculating the sum of res[] array elements

for (int i = 0; i < size; i++)

{

// calculating the sum

sum += grades[i];

}

// calculating the average

double avg = sum / size;

return avg;

}

// This function calculates the median of grades

double getMedian(int* grades, int size)

{

// This Logic will Sort the Array of elements in Ascending order

int temp;

int middle;

double median;

for (int i = 0; i < size; i++)

{

for (int j = i + 1; j < size; j++)

{

if (grades[i] > grades[j])

{

temp = grades[i];

grades[i] = grades[j];

grades[j] = temp;

}

}

}

if (size % 2 == 0)

{

middle = size / 2;

median = (float)(grades[middle - 1] + grades[middle]) / 2.0;

}

else

{

middle = (size + 1) / 2;

median = grades[middle];

}

return median;

}

// This function calculates the mode of grades

int getMode(int* grades, int size)

{

int counter1 = 0, counter2, modevalue;

for (int i = 0; i < size; i++)

{

counter2 = 0;

for (int j = i; j < size; j++)

{

if (*(grades + i) == *(grades + j))

{

counter2++;

}

if (counter2 > counter1)

{

counter1 = counter2;

modevalue = *(grades + i);

}

}

}

if (counter1 > 1)

return modevalue;

else

return -1;

}

// This function calculates the standard deviation of grades

double getSd(int* grades, int size)

{

int sum_of_squares = 0, standard_deviation;

double variance;

double avg = getAverage(grades, size);

/* This loop Calculating the sum of

* square of eeach element in the array

*/

for (int i = 0; i < size; i++)

{

/* Calculating the sum of square of

* each element in the array

*/

sum_of_squares += pow((grades[i] - avg), 2);

}

// calculating the variance of an array

variance = ((double)sum_of_squares / (size - 1));

// calculating the standard deviation of an array

standard_deviation = sqrt(variance);

return standard_deviation;

}

Explanation:

3 0
3 years ago
All of the following can result from seismic waves EXCEPT
serg [7]
Volcanoes. They're formed when magma rises through the earth's crust to the surface, and cannot be caused by waves.
7 0
3 years ago
Other questions:
  • PLEASE HELPP!! WILL MARK BRAINLIEST!!~~~~~
    11·1 answer
  • Which implementation has the worst time complexity?
    5·1 answer
  • The grade of a metric bolt is designated by
    8·1 answer
  • Name the months that have 30 days​
    6·2 answers
  • You are planning trip to South America and and are worried about your devices with private keys being stolen. So you decide to s
    9·1 answer
  • Blair is the director of information systems at a marketing firm. She creates a set of guidelines that dictate everything an emp
    12·1 answer
  • Generally speaking, problems are rarely caused by motherboards. However, there are some instances in which a motherboard can fai
    12·1 answer
  • What is the output by the code system.out.print(8-4+2);
    13·1 answer
  • 10. List three adaptations of wind-pollinated plants to promote pollination.<br>​
    12·1 answer
  • The getElementById DOM Method do?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!