Create a class called payroll. instance variables are the name of the employee, the hours person worked and the hourly rate. make sure to include try-catch for the constructor, getter, setter methods. when creating an object, the name cannot be empty string, hours worked cannot be negative and cannot be greater than 56 hours. the hourly rate cannot be negative. also include a method called raise that increase the employee hourly rate. the raise cannot be negative. must use try catch

Answers

Answer 1

So creating code a class called payroll. and complementing with the information given in the edict, found that it will be:

Writing code in JAVA:

import java.util.Scanner;

public class payroll

{

   String name;

   double salary;

   double da;

   double hra;

   double pf;

   double grossSal;

   double netSal;    

   public Pay(String n, double s) {

       name = n;

       salary = s;

       da = 0;

       hra = 0;

       pf = 0;

       grossSal = 0;

       netSal = 0;

   }    

   void calculate() {

       da = salary * 15.0 / 100;

       hra = salary * 10.0 / 100;

       pf = salary * 12.0 / 100;

       grossSal = salary + da + hra;

       netSal = grossSal - pf;

   }    

   void display() {

       System.out.println("Employee Name: " + name);

       System.out.println("Salary: " + salary);

       System.out.println("Dearness Allowance: " + da);

       System.out.println("House Rent Allowance: " + hra);

       System.out.println("Provident Fund: " + pf);

       System.out.println("Gross Salary: " + grossSal);

       System.out.println("Net Salary: " + netSal);

   }    

   public static void main(String args[]) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter Employee Name: ");

       String empName = in.nextLine();

       System.out.print("Enter Salary: ");

       double empSal = in.nextDouble();        

      payroll = new Pay(empName, empSal);

       obj.calculate();

       obj.display();

   }

}

See more about JAVA code at brainly.com/question/12975450

#SPJ1

Create A Class Called Payroll. Instance Variables Are The Name Of The Employee, The Hours Person Worked

Related Questions

Mention at least five devices used for digitizing data

Answers

Answer:
1. Cloud Storage Solutions
2. Digital Communication Tools
3. Cloud ERP Systems
4. CRM Platforms
5. Digital Accounting Tools

For more information, please visit: https://www.gend.co/blog/the-digitisation-tools-with-the-biggest-impact-for-business?hs_amp=true

Hope this helps!!

Indexed variables for an array are stored wherever the computer finds memory for the first indexed variable, then the next one is stored next to the first if there is space, and someplace else if not. True False

Answers

Answer:

False

Explanation:

Q:

Indexed variables for an array are stored wherever the computer finds memory for the first indexed variable, then the next one is stored next to the first if there is space, and someplace else if not. T or F

A:

F

PLEASE HELP HURRY
For each of the following, identify the best tool for the conversation: e-mail, phone, or in person.

Your boss asked to see a draft of your next report.

You want to discuss an opportunity for promotion with a career mentor.

A coworker wants to share a meeting agenda with you.

A meeting is taking place in five minutes and you are not sure where the meeting is
being held.

Answers

A conversation is the exchange of ideas between two or more people. An email can be used to draft reports, and to share the meeting agenda, while an in-person discussion must be done for the promotion-related talks.

What is an e-mail?

E-mail is an electronic mail that involves sending and receiving textual information from one computer system to another. It is used for professional and academic use like sending a work report or sharing meetings and work-related queries.

To discuss an opportunity related to promotion, the person should have an in-person talk with a career mentor. Also to know the details about the meeting that will take place soon one must make a phone call instead of using email.

Therefore, the best tool for the conversation are:

E-mailIn-personE-mailPhone

Learn more about the conversation here:

https://brainly.com/question/10875655

#SPJ1

What sets Web pages apart from other documents is that they contain a special kind of text called ___, which is document text that is able to respond to user input and link to other objects.

Answers

The web pages contain a special kind of text that allowed to respond to the user input is termed hypertext.

What are web pages?

The web pages are given as the web server delivery with the displaying of the web browser. It is given with the HTML language and comprises several resources and information.

The web page document is accessed with the presence of the hypertext or the hyperlink that enables the user selection to respond to it.

Learn more about web pages, here:

https://brainly.com/question/9060926

#SPJ1

Which of the following statements about application programming interfaces are true? Select 3 options. Programmers can solve problems using APIs. Programmers can solve problems using APIs. Companies that have a lot of data use APIs to find the target audience. Companies that have a lot of data use APIs to find the target audience. APIs can only be created to be private. APIs can only be created to be private. Programmers can send their request to an API using any language they choose without following any rules. Programmers can send their request to an API using any language they choose without following any rules. APIs can be driven by data.

Answers

Application programming interfaces (APIs) help programmers solve problems, help to find the target audience, and are driven by data.

What are APIs?

APIs are the application programming interfaces that provide the access to program data and information found in the databases. They are used to help in setting the link between the new devices and between the device and humans.

APIs allow the interaction of the two applications and act as the messenger. They allow the sharing of the application data to a third party within the company.

Learn more about APIs here:

https://brainly.com/question/4140629

#SPJ1

If the default gateway is configured incorrectly on the host, what is the impact on communications?.

Answers

Answer:

There is no impact on communications.

Explanation:

A default gateway is only required to communicate with devices onanother network. The absence of a default gateway does not affect connectivity between devices on the same local network.

When creating a multipage website what are the two most important things to
remember?

A. Link your style sheet to each page and add an H1
B. Link your style sheet to each page and link all pages together
C. Link your style sheet to each page and add images
D. Link your style sheet to each page and style all elements

Answers

Answer:

B. Link your style sheet to each page and link all pages together

Explanation:

A. Link your style sheet to each page and add an H1

Not needed. Multipage websites don't require H1s to function

B. Link your style sheet to each page and link all pages together

Correct. Pages should be linked together so the website can be navigable.

C. Link your style sheet to each page and add images

Not needed. Multipage websites don't require images to function.

D. Link your style sheet to each page and style all elements

Not needed. You don't need to style every element.

How many bits do we have in the MAC address of an Ethernet card?

Answers

Answer: It is 6 bytes (48 bits) long

Detailed Explanation:

In a LAN, each node is assigned a physical address, also known as a MAC/Ethernet address. This address is unique to each of the nodes on the LAN and is 6 bytes (48 bits) long, which is burned on the Ethernet card (also known as the network interface card)

Question 1-4
Java, Visual Basic, Python and C++ are examples of what type of programming language?

Answers

Answer:

most useful at the system level (interacting with the operating system), like C.

Explanation:

Others are most useful at the system level (interacting with the operating system), like C. There are also high level languages used to create application programs. Such languages include C#, Java, C++, PHP, Visual Basic, Python, Ruby, Perl, JavaScript and others.

Write a function multiplication_tables which takes in as input an integer num, and prints out lists with the the first 10 multiples of all the numbers from 1 to num(inclusive).

Answers

The programming is done for the multiplication table that takes integer numbers and prints the table given in the picture.

What is computer programming?

The words "computer coding" and "computer programming" are sometimes used simultaneously. They do, however, differ in several ways.

Write a function multiplication tables which takes in as input an integer num, and prints out lists with the first 10 multiples of all the numbers from 1 to num(inclusive).

The programming is given below.

def multiplication_tables(num):

   for i in range(1, num+1):

       lst = []

       for j in range(1, 11):

           lst.append(i*j)

       print(lst)

# Testing the function here. ignore/remove the code below if not required

if _name_ == '__main__':

   n = int(input())

   multiplication_tables

Then the result will be given in the picture.

More about the computer programming link is given below.

https://brainly.com/question/14618533

#SPJ1

Pam wants to make a note for other programmers in her Python code. How should the line of code for the note begin?
Pam wants to make a note for other programmers in her Python code. How should the line of code for the note begin?
(A) note
(B) NOTE
(C) #
(D) --

Answers

Based on Pam's work, the line of code for the note should begin with  # sign.

What is # the sign about?

Note that in Python, comments are said to be shown or indicated through the use of a line starting with a # symbol.

Note also that  that # symbol  is one that also tells the computer that it should not  execute the statement that is found in that line.

Learn more about from

https://brainly.com/question/23275071

#SPJ1

Answer:

It is C.#

Explanation:

Pam wants to make a note for other programmers in her Python code. How should the line of code for the note begin?

A.

note

B.

NOTE

C.

#

D.

--

Assume a system has a TLB hit ratio of 99%. It requires 10 nanoseconds to access the TLB, and 90 nanoseconds to access main memory. What is the effective memory access time in nanoseconds for this system

Answers

Answer:

108.5

Explanation:

A (108.5)

Assume a system has a TLB hit ratio of 90%. It requires 15 nanoseconds to access the TLB, and 85 nanoseconds to access main memory. What is the effective memory access time in nanoseconds for this system?

A) 108.5

B) 100

C) 22

D) 176.5

disadvantages of computer network​

Answers

Answer:

It lacks robustness If a PC systems principle server separates, the whole framework would end up futile.

Explanation:

Luka is responsible for the translation of the computer program. Luka looks for errors during the stage of a computer program.

Answers

Answer:

He should check if a syntax error pops up to fix the code

Explanation:

A syntax error message pops up when the code is not proper

Answer:

He should check for any syntax error pop-ups in the console

Explanation:

Determine whether each device is an input device, an output device, or a storage device.

Answers

it would be, A C A A D A

Which software license does an individual's need in order to use database software for his /her personal use

Answers

Answer:

Single-user

Individual licenses

Explanation:

I'm Sorry If I got it wrong, but I believe that's the answer. Good luck  

Which of the following are exclusively associated with copyright protection

Answers

u got picture of the question?
You need a picture otherwise I can’t answer

Pls Help A table is a_______of rows and columns that provides a structure for presenting data​

Answers

Answer:

Graph or chart???

Explanation:

Open a Python interpreter. Python can show you the set of currently known names if you type dir(). While these values may vary from interpreter to interpreter, you should always have __name__ available. What is the value of __name__ in a Python interpreter

Answers

Answer:

Open a Python interpreter. Python can show you the set of currently known names if you type dir (). While these values may vary from interpreter to int … Write a method named

Explanation:

Open a Python interpreter. Python can show you the set of currently known names if you type dir (). While these values may vary from interpreter to int … Write a method named

The ____________ command / function is used in Python graphics and text-based programming code.

A. write()
B. format()
C. display()
D. print()
readline()

Answers

A. write()

2.4. Graphics

Graphics make programming more fun for many people. To fully introduce

graphics would involve many ideas that would be a distraction now. This section

A while loop is frequently used to ______________ data.

A. validate
B. correct
C. inspect
D. interpret

Answers

i believe the answer to your question is A but i’m not 100% sure

The scope of a variable is __________________

A. it is not possible to determine the scope of a variable in Python
B. all variables are available throughout the program
C. where it can be read or modified
D. before it is declared

Answers

Answer:

The scope of a variable is where it can be read or modified.

This function returns the length of a string:

A. length
B. len
C. size
D. lengthof

Answers

Answer:

The strlen() function calculates the length of a given string.The strlen() function is defined in string.h header file.

Explanation:

It doesn’t count null character ‘0’. Syntax: int strlen(const char *str); Parameter: str: It represents the string variable whose length we have to find. Return: This function returns the length of string passed.

why am I doing a PAT investigation ​

Answers

Answer:

personal appliance testing to ensure the device is free from electrical defects

Which statement best describes an advantage of using the Report Wizard instead of the Report button to create a report in Access?

Using the Report Wizard requires more steps.
Using the Report Wizard lets users add more data to the report.
The Report Wizard provides more choices.
The Report Wizard automatically adds all fields to the report.

Answers

The report wizard provides more choices. That’s the answer

How many passes will it take to find 30 using a binary search?
5, 10, 15, 20, 25, 30, 35
passes
1
3
4
2

Answers

Answer:

4 passes

Explanation:

Becky is preparing a document for her environmental studies project. She wants to check her document for spelling and grammar errors. Which function key command should she use?

A.

F1

B.

F2

C.

F5

D.

F7

E.

F12

Answers

According to what I know, I think it is F7.

2. As you have learned, ironically, a large part of sound production involves visual perception. How easy or difficult did you find it to work with Audacity and OpenShot? Why? What aspects of the programs do you think could be improved? Explain.

Answers

Answer: it is very easy to work with programs such as audacity, they are real game changers. Also, they are very helpful for editing and recording audio. They could make audacity’s auto tune more beginner friendly

What two Python data structures are already thread-safe, because they provide automatic support for synchronizing multiple readers and writers

Answers

Answer:

frozensets and tuple are safe for thread

Explanation:

Enter a reference to the remaining balance of payment 1 in cell b13. use the fill handle to copy the functions created in the prior steps down to complete the amortization table.

Answers

The steps described above are actions that are performed while editing an Excel Worksheet. See definitions below.

What is a reference in a Worksheet?

In a worksheet, a cell or range of cells that can be used to create a formula so that the values in those cells can be identified by the program in the worksheet to execute a calculation is referred to as Reference.

Functions on the other hand are formulas that have already been preset onto the worksheet and can be called up and used during a calculation or analysis.

A cell is the smallest unit in a worksheet.

It is to be noted that the Amortization Table indicated is not available, hence the general answer.

Learn more about worksheets at:
https://brainly.com/question/23501096

#SPJ4

Other Questions
What is the name of rover that was just sent to Mars in March of 2021? A.Spirit B.Curiosity C.Opportunity D.Perseverance In 1963 legislation was passed that changed how mental health services were delivered in the united states. It started the process of_____, the closing of large asylums, by providing for people to stay in their communities and be treated locally. The money required to start a business is referred to as What were the results of European colonization of Central Africa?Question 14 options:European countries made little economic gain from the coloniesEuropeans controlled the government of Central AfricaAfricans were forced to work on plantationsMillions of Africans died in the Congo due to mistreatment i asked for help on this Help! Simplify: 9log9(4) Explain how feudalism addresses the needs of society after the fall of the roman empire please give an non-copy answer. please give an accurate answer |x-1| if X>1 please help please A storage rental company charges $1 forthe first month and $25 per month for the nexttwo months. After three months, the cost is$20permonth. How much would it cost torent a unit for 10 months?A $151$B$171C$191D$211 244 people must be split into 4 equal groups. How many people in each group 19. The area of the square is half the area of the rectangle. Find x.2(x+4) Understanding Main IdeasUse the diagrams below to answer items 1-3.DiagramDiagramDiagram1. Diagram Aa. Type of fault:b. Stress Force:c. Movement Along Fault:2. Diagram Ba. Type of Fault:b. Stress Force:c. Movement Along Fault:3. Diagram Ca. Type of Fault:b. Stress Force:c. Movement Along Fault:0Earthquakes HELP I'LL GIVE BRAINLIEST!!! A mosquito flaps its wings 800 times per second, which produces the annoying 800 Hz buzz. How far does the sound travel between wing beats? The speed of sound in air is 340 m/s. Answer in units of m. :) calculate the number of particles of 285 grams of Al2O3 i do not understand this on english A 5. 00 l container contains ch4, h2, and xe at 35c with a total pressure of 1. 81 atm. If there are equal moles of each gas, what is the partial pressure of h2? Convert 29/30 to a decimal PLEASE HELP ASAP!!! I WILL GIVE BRAINLIEST TO THE RIGHT ANSWERIt is a Part A and Part B QuestionNote: please add the answer next to what part it's from so I can know which part was answered In a random sample survey of 80 students at Torreys middle school, 24 students said that math was their favorite subject. There are a total of 300 students at this middle school. Based on the survey, which value is the best estimate for the number of students who would say that math is their favorite subject?A.244B.90C.150D.72 Someone please help with this