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
Mademuasel [1]
3 years ago
8

Write a program that demonstrates the class by creating a Payroll object, then asking the user to enter the data for an employee

.
Computers and Technology
1 answer:
AlexFokin [52]3 years ago
8 0

Answer:

import java.util.Scanner;

public class Payroll {

   //set variable field

   private String name;

   private int idNumber;

   private double hourlyRate;

   private int hoursWorked;

   private double grossPay;

   //methods to get values of private class variables

   public String getName()

    {

        return name;

    }

   public int getIdNumber()

   {

      return idNumber;

   }

   public double getHourlyRate()

   {

       return hourlyRate;

   }

   public int getHoursWorked()

   {

       return hoursWorked;

   }

   public double getGrossPay()

   {

      return hoursWorked * hourlyRate;

   }

   //methods to initialize or change the private class values.

   public void setName( String nameGiven)

   {

       name = nameGiven;

   }

   public void setIdNumber(int idNumberGiven)

   {

       idNumber = idNumberGiven;

   }

   public void setHourlyRate(double rateGiven)

   {

       hourlyRate = rateGiven;

   }

   public void setHoursWorked(int hoursGiven)

   {

      hoursWorked = hoursGiven;

   }

   //Constructors

   public Payroll(String nameGiven, int idNumberGiven, double rateGiven, int hoursGiven)

   {

       name = nameGiven;

       idNumber = idNumberGiven;

       hourlyRate = rateGiven;

        hoursWorked = hoursGiven;

   }

 

   public static void main(String[] args)

   {

       double userGrossPay;

       String userEmplName;

       int userIdNum;

       double userRate;

       int userHours;

       Scanner scanner = new Scanner(System.in);

       System.out.print("Enter employee's name:");

       userEmplName = scanner.nextLine();

      System.out.print("Enter employee's ID number:");

       userIdNum = scanner.nextInt();

       System.out.print("Enter hourly rate:");

       userRate = scanner.nextDouble();

       System.out.print("Enter number of hours worked:");

       userHours = scanner.nextInt();

        Payroll payroll1 = new Payroll(userEmplName, userIdNum, userRate, userHours);

 

      payroll1.setName(userEmplName);

       payroll1.setIdNumber(userIdNum);

       payroll1.setHourlyRate(userRate);

       payroll1.setHoursWorked(userHours);

 

       System.out.printf(userEmplName + ", employee number " + userIdNum + ", made $%.2f in gross pay.\n", payroll1.getGrossPay());

}

}

Explanation:

The class "Payroll" is used to hold data of employees to be paid. the main function creates an instance of the class "payroll1", sets the name, id-number, hourly rate, and hours worked by the employee, then prints on screen the details of the payroll1 object.

You might be interested in
Which best describes an advantage of conceptual notes? They are great for studying vocabulary terms. They help students memorize
larisa86 [58]

Answer:

They make it easy to quickly see relationships between ideas.

Explanation:

A concept is an idea or a principle that could be used to understand an abstract notion. A conceptual note is one that makes the relationship between ideas easily discernible.

Without breaking much sweat or reading too deeply, the reader would find it easier to easily determine the relationship between ideas and how they relate to the subject matter. Conceptual notes can be taken on a laptop or paper.

5 0
3 years ago
Read 2 more answers
Overview: For the final project in this course, you will assume the role of a training manager at a cybersecurity firm needing t
Free_Kalibri [48]

<u>Solution and Explanation:</u>

<u>INTRODUCTION </u>

A) Introduction Cybersecurity should be a priority for all businesses so that they can protect their information systems and data assets. Organizations all over the world have been experiencing cyber-attacks. Types of cybercrime include identity theft, ransomware, denial of service attacks, botnets, phishing and social engineering (Khanse, 2014).

Cybersecurity threats exist from both external sources and from within a company. Cybersecurity issues will have impacted businesses financially to the tune of $6 trillion dollars per year worldwide, which is double the amount since 2013. Cybercrime is projected to be more profitable than the global illegal drug trade (Morgan, 2017). CyberLeet Technologies can safeguard businesses against these threats by strictly adhering to the core tenets of cybersecurity which are confidentiality, availability and integrity. CyberLeet will ensure these tenets by identifying vulnerabilities in client systems, implementing data security policies and utilizing threat detection monitoring.

B) Your Role at CyberLeet The role of an information security analyst at CyberLeet Technologies is to enforce the cybersecurity tenets of confidentiality, integrity and availability. This will be accomplished by performing risk assessments of its client’s software, hardware and networks. The analyst must plan and implement security measures to protect client systems, networks and data. Finally, the role includes helping the client engage in security awareness training for its employees (New England College, 2017). The CyberLeet information security analyst will perform job functions which uphold the basic tenets of cybersecurity. The analyst will perform vulnerability assessments of the client systems to ensure the cybersecurity principle of availability. He or she will monitor the client network and systems to safeguard the cybersecurity tenet of confidentiality. Also, the analyst will safeguard the cybersecurity tenet of integrity by protecting client data through the use of data encryption. Other tasks that will be performed include malware analysis, enhancement of security standards, and investigation and documentation of any security breaches. The ultimate goal of an information security analyst at CyberLeet Technologies is to uphold the cybersecurity tenets of confidentiality, integrity and availability by protecting its client systems’ assets, networks and data from cyberattacks.

C) Purpose of This Manual The purpose of this manual is to train new CyberLeet information security analyst recruits about their job duties. These duties include understanding that their client’s organization is subject to information security issues and the fundamental core cybersecurity tenets of confidentiality, integrity and availability must be applied to develop security measures (Henderson, 2017). These threat mitigation security measures include the development of cybersecurity policies including password policies, acceptable use policies, employee training policies, and basic user polices. It is imperative that information security analysts apply the principles and practices outlined in this manual and provide high-quality services to the client. Failure to do so could result in the client experiencing cyber-attacks ranging from malware, phishing, denial of service and ransomware (Khanse, 2014).

CORE TENENTS OF CYBER SECURITY

A) Confidentiality One of the core tenets of cybersecurity is confidentiality. Confidentiality is the preservation of private and proprietary information, such as customer data or health records. Only authorized users should be able access protected information, while unauthorized users should be blocked. Information security requires control on access to protected information (Henderson, 2017). An example of enforcing confidentiality includes the restriction of access to company assets and information via the use authentication and authorization techniques.

B) Integrity The core tenet of integrity is the guarding against improper modification of data or system information. Data integrity is maintained when information remains unchanged during storage, transmission and usage (Henderson, 2017). An example of maintaining system integrity is the prevention of malware which can corrupt computer files. An example of maintain data integrity is the proper encryption of data prior to transmission between systems, to prevent unauthorized access and manipulation.

C) Availability The core tenet of availability is the accessibility of users to systems and data. Availability is maintained when all components of the information system are working properly. Problems in the information system could make it impossible to access information, thereby making the information unavailable (Henderson, 2017).

 

8 0
3 years ago
Tp-24 What should you do before starting an inboard gasoline engine
Minchanka [31]

Before starting an inboard gasoline engine, you should remove the engine cover completely to let the engine air out. Next is to change the fuel filter or the water separator. Marine fuel filters and water separators help draw water from the boat fuel, therefore protecting the motor from the water. If water were to get in, it could cause serious problems.

You should also consider changing the engine oil. This is especially so if the motor boat has been sitting around for a while. The fourth step is to change the oil filter. It is recommended that the oil filter is changed every 100 hours or every season. Other steps include;

Recharge the battery.

Refuel your boat.

Check the cooling system.

4 0
3 years ago
FILL IN THE BLANK
Gwar [14]

Answer:

search

Explanation:

4 0
3 years ago
What is a return statement used for?
Aleonysh [2.5K]

Answer:

Exiting a function

Explanation:

Return simply returns a specified value at the end of a def function (if you're in python). It does not print or do anything else. You could set variables equal to a def function that returns or you could put the def function in a print statement to print the returned value.

4 0
3 years ago
Other questions:
  • ______ devices are high-performance storage servers that are individually connected to a network to provide storage for the comp
    5·1 answer
  • How do headphones work? (From pc)
    8·1 answer
  • A flat-panel detector is exposed with nothing between the x-ray tube and detector. 5 images were acquired on 5 different days us
    6·1 answer
  • Jason Has A Science Video Project, As He Creats His Project, He Saves, Then Comes Back A Minute Later. The File Is Now Unreadabl
    8·2 answers
  • What are the letter that go under each note?
    10·2 answers
  • Array Challenge Have the function ArrayChallenge (arr) take the array of numbers stored in arr and return the string true if any
    9·1 answer
  • What are 3 similarities and 3 differences between live theatre and film/videos -Drama Class
    13·1 answer
  • Pleasee help meeeeeeeeee I’m stuckk!!!!
    14·2 answers
  • Do laws ever change to help enforce cyber hacking crimes
    5·2 answers
  • What is the answer ????​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!