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
dalvyx [7]
4 years ago
12

Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay the hourly rate for the hou

rs up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75).
Computers and Technology
1 answer:
Nuetrik [128]4 years ago
5 0

Answer:

Following is the program in the python language

hr = input("input hours:") #Read input by user

h1 = float(hr)

rate =input("Input Rate:") #Read RATE BY USER

r1 = float(rate) #CONVERT INTO FLOAT

if h1 <= 40: #check condition

   t=h1 * r1

   print (t) #DISPLAY

else :#else block

   t1=(40 * r1) + (h1 -40) * r1 * 1.5

   print('The pay is :')

   print(t1)#DISPLAY

Output:

input hours:45

Input Rate:10.50

The pay is :

498.75

Explanation:

Following are the description of program

  • Read the value of hour in the "hr" variable and convert into the float value in the "h1" variable .
  • Read the value of rate in the " rate" variable and convert into the float value in the "r1" variable .
  • After that check the condition of hour if block if the hour is less then or equal to 40 then it multiplied h1 *t1 otherwise else block will be executed and print the value of pay .

You might be interested in
You are using a device that reads the physical addresses contained in incoming data that travels along network cables. Based on
GuDViN [60]

You are using a device that reads the physical addresses contained in incoming data that travels along network cables. Based on the physical address that it reads, the device then forwards the data out one of its ports to reach the destination device. The type of device you are using is router.

<h3>What is Router?</h3>

A router is an hardware device that is used in transferring information or data from a system to another.

The data can also be transfered from one computer networks to another.

Router makes it easier for more than one device to be connected easily without difficult Internet access.

Therefore, The type of device you are using that reads incoming data that travels along network cables is router.

Learn more on router below

brainly.com/question/24812743

#SPJ1

3 0
2 years ago
What is the function of ctrl+Q​
vlabodo [156]

Answer:

Ctrl+Q is used to remove a paragraph's formatting

Explanation:

Hope that's the answer you're looking for!

5 0
3 years ago
How do you create a logo on Adobe illustrator
artcher [175]
Idk idk idk idk if dub
7 0
3 years ago
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
3 years ago
When you enable user access control (uac)
SVEN [57.7K]
The UAC is on by default. So, you don't need to turn it on unless someone else turned it off.

The UAC has four modes.

The lowest mode is the off position. If the UAC is off, no UAC prompt will pop up when doing administrative tasks.

6 0
3 years ago
Other questions:
  • When seeking information on the internet about a variety of subjects, the most useful place to look would be
    8·2 answers
  • Jana keeps receiving friend requests from strangers on a social media site. This is making her uncomfortable.
    15·2 answers
  • The most efficient way to perform data entry is to keep your hands on the keyboard and press _______ to move to the next cell in
    14·1 answer
  • A computer lab has two printers. Printer I handles 40% of all the jobs. Its printing time is Exponential with the mean of 2 minu
    8·1 answer
  • Write a Python program that reads the CSV file, compares the population estimates of every row for 2010 and 2017 and computes th
    10·1 answer
  • Given the strings s1 and s2 that are of the same length, create a new string consisting of the first character of s1 followed by
    12·1 answer
  • What did major networks do to combat audience erosion in the 1990s?
    15·1 answer
  • ____ the styles allows the designer to start from a known baseline, confident that no unwanted styles will creep in from any bro
    6·1 answer
  • Write a method that determines the total number of chars in each string of an array.
    12·1 answer
  • Write a program to find the sum of first 10 even numbers in qbasic​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!