Computer Science, asked by nakshatraroy196, 1 month ago

Question :
Define a class Security with the following instruction
DM :- String n - name
int h - to store no. of hours for which wages to be paid
double r - to store the rate of wages
double w - to calculate wages
MM :- input ()
cal ()
display ()


No. of hours Rate
Upto 40 hrs Rs.1 per hour
For next 20 Rs. 1.5 per hour
hours
For next 20 Rs.2 per hour
hours

W = h * r

please answer my question as fast as possible
it's a request from my side

Answers

Answered by tripathiakshita48
1

Answer:

Program for the class Security

Explanation:

From the above question,

They have given :

Class Security with the following instruction

§§ 1000

§§ --- security/README.md

-//TODO

§§ 1002

+Security is a library of security related functions.

§§ --- security/README.md

-### Class Security

-

-# Methods

-

-## hash_password

-

-**Signature**

-

-`hash_password(string $password, int $algorithm, array $options) : string`

-

-**Description**

-

-This function hashes the given password using the specified algorithm and options.

-

-**Parameters**

-

-- `$password` - The password to be hashed.

-- `$algorithm` - The hashing algorithm to use.

-- `$options` - An array of options for the hashing algorithm.

-

-**Return Value**

-

-The hashed password.

+The library currently has one function, `hash_password`, which hashes a given password using the specified algorithm and options.

                    PROGRAM

Class Security {

 String n; //name

 int h; //no. of hours for which wages to be paid

 double r; //rate of wages

 double w; //wages

 public void input() {

   Scanner scanner = new Scanner(System.in);

   System.out.println("Enter Name:");

   this.n = scanner.nextLine();

   System.out.println("Enter Hours:");

   this.h = scanner.nextInt();

 }

 public void cal() {

   if(this.h <= 40) {

     this.r = 1;

   } else if(this.h > 40 && this.h <= 60) {

     this.r = 1.5;

   } else {

     this.r = 2;

   }

   this.w = this.h * this.r;

 }

 public void display() {

   System.out.println("Name: " + this.n);

   System.out.println("Hours: " + this.h);

to calculate wages void input() {

code to take inputs for n, h, and r } void cal() {

code to calculate wage if h is less than or equal to 40 hrs, r = 1, else if h is between 41 and 60 hrs, r = 1.5 else if h is more than 60 hrs, r = 2 w = h * r; } void display()

{

code to display wage } }

For more such related questions : https://brainly.in/question/54376141

#SPJ1

Answered by shilabhadra123
0

Answer:

I am looking for it too bro

Similar questions
Physics, 17 days ago