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
OlgaM077 [116]
2 years ago
10

Create a Python program to solve a simple pay calculation.

Computers and Technology
1 answer:
Travka [436]2 years ago
6 0

Answer:

def weeklyPaid(hours_worked, wage):  

   if hours_worked > 40:  

       return 40 * wage + (hours_worked - 40) * wage * 1.5

   else:  

       return hours_worked * wage  

 

 

hours_worked = 50

wage = 100

 

pay = weeklyPaid(hours_worked, wage)  

 

print(f"Total gross pay: Rs.{pay:.2f} ")

Explanation:

provides gross pay

You might be interested in
BRAINLIEST Which function will add a name to a list of baseball players in Python?
Tju [1.3M]

Answer: Append()

Explanation:

8 0
2 years ago
Read 2 more answers
Write a RainFall class that stores the total rainfall for each of 12 months into an array of doubles. The program should have me
RSB [31]

Answer:

Explanation:

The code provided worked for the most part, it had some gramatical errors in when printing out the information as well as repeated values. I fixed and reorganized the printed information so that it is well formatted. The only thing that was missing from the code was the input validation to make sure that no negative values were passed. I added this within the getMonths() method so that it repeats the question until the user inputs a valid value. The program was tested and the output can be seen in the attached image below.

import java.io.*;

import java.util.*;

class Rainfall

{

   Scanner in = new Scanner(System.in);

   private int month = 12;

   private double total = 0;

   private double average;

   private double standard_deviation;

   private double largest;

   private double smallest;

   private double months[];

   public Rainfall()

   {

       months = new double[12];

   }

   public void setMonths()

   {

       for(int n=1; n <= month; n++)

       {

           int answer = 0;

           while (true) {

               System.out.println("Enter the rainfall (in inches) for month #" + n + ":" );

               answer = in.nextInt();

               if (answer > 0) {

                   months[n-1] = answer;

                   break;

               }

           }

       }

   }

   public void getTotal()

   {

       total = 0;

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

       {

           total = total + months[i];

       }

       System.out.println("The total rainfall for the year is " + total);

   }

   public void getAverage()

   {

       average = total/12;

       System.out.println("The average monthly rainfall is " + average);

   }

   public void getLargest()

   {

       double largest = 0;

       int largeind = 0;

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

       {

           if (months[i] > largest)

           {

               largest = months[i];

               largeind = i;

           }

       }

       System.out.println("The largest amount of rainfall was " + largest +

               " inches in month " + (largeind + 1));

   }

   public void getSmallest()

   {

       double smallest = Double.MAX_VALUE;

       int smallind = 0;

       for(int n = 0; n < month; n++)

       {

           if (months[n] < smallest)

           {

               smallest = months[n];

               smallind = n;

           }

       }

       System.out.println("The smallest amount of rainfall was " + smallest +

               " inches in month " + (smallind + 1));

   }

   public static void main(String[] args)

   {

       Rainfall r = new Rainfall();

       r.setMonths();

       r.getTotal();

       r.getSmallest();

       r.getLargest();

       r.getAverage();

   }

}

8 0
2 years ago
When typing an outline, you can move a point from a lower level to a higher level by changing the list level from the outline me
Arte-miy333 [17]
A shift+Tab
I hope it’s work
6 0
2 years ago
True or false
Semmy [17]
It’s false I hope this helped you
3 0
2 years ago
1. Name the program in which you can draw and colour pictures.​
babymother [125]

Answer:

Photoshop- if this is for school I THINK, but I use Procreate for IOS

Explanation:

4 0
2 years ago
Other questions:
  • Many malware attacks are ____ attacks, which involve more than one type of malware and/or more than one type of transmission met
    6·1 answer
  • It is either snoming or below freezing
    10·1 answer
  • Who is the CEO of Quora?
    15·1 answer
  • How to determine if the function f(x) = x^2 + 3 from real numbers to real numbers is Injective, surjective, or bijective
    13·1 answer
  • 3. Find the product of (a² +3a+5) x (a+7)​
    7·1 answer
  • Which cost of purchasing a franchise would you still have if you start your own business​
    12·1 answer
  • What is the difference between the web and the internet?
    14·1 answer
  • In French class, Blue puts on a visor and the environment changes to that of a café in Paris. Which of the following terms descr
    12·2 answers
  • What are some example of popular music for teenagers
    8·2 answers
  • I am stuck on these 2 questions. Can someone help me please?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!