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
prisoha [69]
1 year ago
10

Do you guys answer questions about cyber security?

Computers and Technology
1 answer:
olganol [36]1 year ago
5 0

Answer:

yes

Explanation:

let's hear your question first.

You might be interested in
Problem 2 Write a method that (a) returns an int[] , (b) takes in two sorted arrays (in descending order) and (c) returns an int
Galina-37 [17]

Answer:

Following are the Program in the Java Programming Language.

//define class

public class Main

{

//define function to merge and sort array

public static int[] sort_Array(int[] a, int[] b)

{

//set integer variable and initialize values

int x = 0, y = 0, k = 0, num = 0;

int n = a.length;

int n1 = b.length;

//set integer type array

int[] ar = new int[n+n1];

//set while loop

while (x<n && y <n1)

{

num++;

num++;

//set if conditional statement

if (a[x] > b[y])

ar[k++] = a[x++];

else

ar[k++] = b[y++];

num++;

}

//set the while loop

while (x < n)

{

num++;

ar[k++] = a[x++];

}

//set the while loop

while (y < n1)

{

num++;

ar[k++] = b[y++];

}

//print the total compares done

System.out.println("Number of compares done: " + n);

//return array

return ar;

}

//define main method

public static void main(String[] args)

{

//declaration and the initialization of array

int[] a = new int[]{18,16, 15, 6, 2};

int[] b = new int[]{13, 12, 11, 7, 1};

int[] ar;

//call function

ar = sort_Array(a, b);

//print message

System.out.println("\nThe resultant array is: \n");

//set for loop to print array

for(int x=0; x<ar.length; x++)

{

System.out.print(ar[x] + " ");

}

}

}

<u>Output</u>:

Number of compares done: 5

The resultant array is:

18 16 15 13 12 11 7 6 2 1

Explanation:

Here, we define a class "Main" inside the class, define a function "sort_Array()"and pass two integer type array argument "a" and "b".

  • Set four integer type variables "x", "y", "k", and "num" and initialize them to 0.
  • Set two integer type array "n", "n1" and initialize them the length of the array then, set integer type array variable "ar".
  • Set the while loop then, set if conditional statement then, agin set while loop to sort array in descending order.
  • Then, print the number of compares and return the value of the variable "ar".

Finally, define the main method inside it, we set two integer type array variable and initialize elements in them then, set the for loop to print the sorted elements of the array.

4 0
2 years ago
What keyboard key can you press to limit the angle of the line when using the pencil tool?
leva [86]
F6,p hope that helps :)
6 0
3 years ago
Write a program that calculates payments for loan system. Implement for both client and Server. - The client sends loan informat
egoroff_w [7]

Answer:

Check the explanation

Explanation:

//Define the class.

public class Loan implements java.io.Serializable {

 

//Define the variables.

private static final long serialVersionUID = 1L;

private double annualInterestRate;

private int numberOfYears;

private double loanAmount;

private java.util.Date loanDate;

//Define the default constructor.

public Loan() {

this(2.5, 1, 1000);

}

//Define the multi argument constructor.

protected Loan(double annualInterestRate, int numberOfYears,

double loanAmount) {

this.annualInterestRate = annualInterestRate;

this.numberOfYears = numberOfYears;

this.loanAmount = loanAmount;

loanDate = new java.util.Date();

}

//Define the getter and setter method.

public double getAnnualInterestRate() {

return annualInterestRate;

}

public void setAnnualInterestRate(double annualInterestRate) {

this.annualInterestRate = annualInterestRate;

}

public int getNumberOfYears() {

return numberOfYears;

}

public void setNumberOfYears(int numberOfYears) {

this.numberOfYears = numberOfYears;

}

public double getLoanAmount() {

return loanAmount;

}

public void setLoanAmount(double loanAmount) {

this.loanAmount = loanAmount;

}

//Define the method to compute the monthly payment.

public double getMonthlyPayment() {

double monthlyInterestRate = annualInterestRate / 1200;

double monthlyPayment = loanAmount * monthlyInterestRate / (1 -

(Math.pow(1 / (1 + monthlyInterestRate), numberOfYears * 12)));

return monthlyPayment;  

}

//Define the method to get the total payment.

public double getTotalPayment() {

double totalPayment = getMonthlyPayment() * numberOfYears * 12;

return totalPayment;  

}

public java.util.Date getLoanDate() {

return loanDate;

}

}

//Define the client class.

public class ClientLoan extends Application {

 

//Create the server object.

ServerLoan serverLoan;

 

//Declare the variables.

int y;

double r, a, mp=0, tp=0;

String result,d1;

 

//Create the button.

Button b = new Button("Submit");

 

//Define the method stage.

public void start(Stage primaryStage) throws Exception {

 

TimeZone.setDefault(TimeZone.getTimeZone("EST"));

TimeZone.getDefault();

d1 = "Server Started at " +new Date();

 

//Create the GUI.

Label l1=new Label("Annual Interest Rate");

Label l2 = new Label("Number Of Years:");

Label l3 = new Label("Loan Amount");

TextField t1=new TextField();

TextField t2=new TextField();

TextField t3=new TextField();

TextArea ta = new TextArea();

 

//Add the components in the gridpane.

GridPane root = new GridPane();

root.addRow(0, l1, t1);

root.addRow(1, l2, t2, b);

root.addRow(5,l3, t3);

root.addRow(6, ta);

 

//Add gridpane and text area to vbox.

VBox vb = new VBox(root, ta);

 

//Add vbox to the scene.

Scene scene=new Scene(vb,400,250);

 

//Add button click event.

b.setOnAction(value -> {

 

//Get the user input from the text field.

r = Double.parseDouble(t1.getText());

y = Integer.parseInt(t2.getText());

a = Double.parseDouble(t3.getText());

 

//Create the loan class object.

Loan obj = new Loan(r, y, a);

 

//Call the method to compute the results.

mp = obj.getMonthlyPayment();

tp = obj.getTotalPayment();

 

//Format the results.

result = "Annual Interest Rate: "+ r+"\n"+

"Number of Years: "+y+"\n"+

"Loan Amount: "+a+"\n"+

"monthlyPayment: "+mp+"\n"+

"totalPayment: "+tp;

 

//Add the result to the textarea.

ta.setText(result);

 

//Create an object of the server class.

serverLoan = new ServerLoan(this);

});

 

//Set the scene to the stage.

//Set the stage title.

//Make the scene visible.

primaryStage.setScene(scene);

primaryStage.setTitle("ClientLoan");

primaryStage.show();

}

 

//Define the main method lauch the application.

public static void main(String args[])

{  

launch(args);

}

 

//Define the server class.

class ServerLoan extends Stage {

 

//Create the client loan object.

ClientLoan parent;

 

//Create the stage object.

Stage subStage;

 

//Create the text area.

TextArea ta = new TextArea();

 

//Define the constructor.

private ServerLoan(ClientLoan aThis) {

 

//Get the time in desired timezone.

TimeZone.setDefault(TimeZone.getTimeZone("EST"));

TimeZone.getDefault();

 

//Format the date with message.

String d2 = "Connected to client at " +new Date();

 

//Initialize the object.

parent = aThis;

 

//Add the date and the result to

//the text area.

ta.setText(d1);

ta.appendText("\n"+ d2);

ta.appendText("\n"+result);

 

//Create the grouppane.

GridPane root = new GridPane();

 

//Add text area to the group pane.

root.addRow(0, ta);

 

//Initialise the stage object.

subStage = new Stage();

 

//Add gridpane to the scene.

Scene scene = new Scene(root, 400, 200);

 

//Set the scene to the stage.

//Set the stage title.

//Make the scene visible.

subStage.setScene(scene);

subStage.setTitle("ServerLoan");

subStage.show();

}

}

}

Kindly check the Output in the attached image below.

4 0
3 years ago
Read 2 more answers
Plz I need help 30 points
Kisachek [45]

hey mate your ans

in the picture

8 0
2 years ago
To delete a comment, right click the comment and then select the ____ command.
aleksandrvk [35]

delete command is your answer i tink

8 0
3 years ago
Read 2 more answers
Other questions:
  • A user complains that his computer automatically reboots after a short period of time. Which of the following computer component
    13·1 answer
  • Microsoft word's spell checker?
    10·1 answer
  • The following equations estimate the calories burned when exercising (source): Men: Calories = ( (Age x 0.2017) — (Weight x 0.09
    11·1 answer
  • Which of the following is an accurate definition of a computer system? A computer system consists of the operating system that t
    6·1 answer
  • _________________ ___________________ is an encrypted code that a person, website, or organization attaches to an electronic mes
    9·1 answer
  • Write a function nexthour that receives one integer argument, which is an hour of the day, and returns the next hour. This assum
    6·1 answer
  • Clasifica los documentos comerciales en activo, pasivo o patrimonial para cada operacion:
    14·1 answer
  • Writing a function that implements a loop to collect a set amount of data. The function should use the serial object, the record
    9·1 answer
  • what could a company do if it was using a commercial wan and a vulnerability appered thst allowed attackers
    11·1 answer
  • If person A creates an image with a creative common license. Person B then uses the image on his website. Who own the image and
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!