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
Alla [95]
4 years ago
11

3 write a program to prompt the user for hours and rate per hour using raw_input to compute gross pay. use 35 hours and a rate o

f 2.75 per hour to test the program (the pay should be 96.25). you should use raw_input to read a string and float() to convert the string to a number. do not worry about error checking or bad user data.
Computers and Technology
1 answer:
bezimeni [28]4 years ago
4 0
JAVA programming was employed...

//IMPORT STATEMENT
import javax.swing.JOptionPane;

public class Payroll
{
  //VARIABLE DECLARATION
  double grossPay, hoursWorked, payRate;
  
  //INPUT STATEMENT
  hoursWorked = Double.paseDouble(JOptionPane.showInputDialog(Please   enter your hours worked.));
  payRate = Double.paseDouble(JOptionPane.showInputDialog(Please enter   the pay rate per hour.));
 
  //PROCESS STATEMENT
  grossPay = hoursWorked * payRate;
 
   //OUTPUT STATEMENT
  JOptionPane.showMessageDialog(null, grossPay);
}//End of class Payroll

In this program, we declared variables grossPay, hoursWorked, and payRate to double so that the user can input figures with decimal. Since the inputs have decimal, the output which is grossPay will come out with decimal.

But note that inputting numbers doesn't mean that they will be processed as double automatically! For the inputted values to become double, it is important to parse them first that is why the line "hoursWorked = Double.paseDouble(JOptionPane.showInputDialog(Please   enter your hours worked.));" and line "payRate = Double.paseDouble(JOptionPane.showInputDialog(Please enter   the pay rate per hour.));" were used.
You might be interested in
The Scratch blocks are organized into 9 color-coded categories. Select all that apply.
Ira Lisetskai [31]
Motion,control,operators,events,sound,loop,looks, more blocks, and I think sensing!
7 0
3 years ago
With working from home now becoming a norm what is an effective network for an organization to secure its internal resources acc
Umnica [9.8K]

Answer:

Always encrypt data never store anything in plain text someone could use wireshark to pull out a data packet and if the data is not encrypted, expect things to happen.

4 0
3 years ago
On Windows 7 or 8 How are the windows help and support options different when you press F1 when the desktop is active as opposed
Dominik [7]
It opens a different article depending on what program you on, to accommodate that program.
6 0
3 years ago
Ann wants to save her presentation so she can work on it later. Which device on her computer can store this data long term?
Julli [10]
I believe it would be A. Hard drive.
5 0
4 years ago
Read 2 more answers
Consider the following class definition.
erik [133]

Answer:

public int getX()

Explanation:

From the question, we understand that the value is to be accessed in other classes.

This implies that we make use of the public access modifier. Using the public modifier will let the instance variable be accessed from other classes.

Also, we understand the return type must be the variable type of x. x is defined as integer. So, the constructor becomes public x

Lastly, we include the constructor name; i.e. getX().

Hence, the constructor is: <em>public int getX()</em>

3 0
3 years ago
Other questions:
  • Jean-Ann works in the finance business. She analyzes insurance applications in order to determine the level of risk involved in
    11·1 answer
  • The English (or Shakespearean) sonnet form includes three quatrains and a couplet two quatrains and a couplet two quatrains and
    15·1 answer
  • Which pair of properties apply to both sound and electromagnetic waves?
    10·2 answers
  • Which of these tasks can be accomplished when the drop-down menu of the Bullets icon is clicked?
    14·1 answer
  • A function may return a pointer, but the programmer must ensure that the pointer:
    14·1 answer
  • A) A cable that is mainly used in the cable television network
    11·1 answer
  • Olivia started working last year. By April 15th, she will need to prepare and send the Federal government _____.
    15·2 answers
  • You have been asked to configure a client-side virtualization solution with three guest oss. Each one needs internet access. How
    8·1 answer
  • 1
    5·1 answer
  • Below you will find the requirements to identify the Account Diversity Grade of a user. Read the requirements carefully and iden
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!