Write an application that throws and catches an ArithmeticException when you attempt to take the square root of a negative value. Prompt the user for an input value and try the Math.sqrt() method on it. The application either displays the square root or catches the thrown Exception and displays an appropriate message.

Answers

Answer 1

Answer:

Sample output:

Enter the number: 25

The square root of 25 is: 5

Enter the number: -25

The square root of 25 is: Nan

Explanation:

Here the code is given as follows,


Related Questions

Consider a network that is a rooted tree, with the root as its source, the leaves as its sinks, and all the edges directed along the paths from the root to the leaves. Design an efficient algorithm for finding a maximum flow in such a network. What is the time efficiency of your algorithm

Answers

Answer:

please mark me brainlist

Explanation:

Instructions
Create a multimedia project that contains the text element and all the contents that you have studied about that element

Answers

Answer:

iiiio888887776558777u765

g Add a throw statement to the processNumbers function that throws the message "An element in the list is not a number." if one of the elements in toProcess is not a number. Hint: The function isNaN() returns true if the parameter is not a number.

Answers

Answer and Explanation:

function processNumbers(alist){

var Ourarray= new array(alist);

Ourarray.foreach(

if(isNaN()){

Console.log( "An element in the list is not a number."};

break;

}

}

processNumbers(alist)

From the above, we have defined a function that takes an array parameter(the following array variable will make sure of that). We test each element in the array using foreach array function. The for each function runs the if statement and if isNan is true for each of the elements in the array.

Write the following numbers in binary. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 46. 55. 61.​

Answers

0 1 10 11
Explanaition:

Alexis received an email message from an unknown sender that included an attachment.

If she opens the attachment, what kind of malicious software might be activated, and what are the consequences?


Opening the attachment would release a worm, which would infect her system with a virus.


Opening the attachment would release a worm, which would infect her system with spyware.


Opening the attachment would release an active worm, which would infect her system with adware.


Opening the attachment would release a passive worm, which would infect her system with adware.

Answers

Answer:

Opening the attachment would release a worm, which would infect her system with a virus.

Answer:  B. Opening the attachment would release a worm, which would infect her system with a virus.

A good machine should have the mechanical advantage of......?​

Answers

Answer:

The ideal mechanical advantage (IMA) of an inclined plane is the length of the incline divided by the vertical rise, the so-called run-to-rise ratio. The mechanical advantage increases as the slope of the incline decreases, but then the load will have to be moved a greater distance.

Explanation:

3. Coaxial/telephone cable sends
during the data transmission
signal

Answers

Answer:

high frequency signal.

T
N
O
?
You can insert only the row
only to
True or false

Answers

false

Explanation:

good luck bro

have a great day

Answer:

false

Explanation:

e) Point out the errors( if any) and correct them:-
class simple
{
inta,b,c;
double sumNumber
{
int d = a + b + c;
double e = d/5.6;
return e;
}
void show Number()
{
a = 10, b = 20, c=5;
System.out.println(d);
double f = sumNumber(a,b,c);
System.out.print(e);
}
}​

Answers

Explanation:

double e-d/5.6;is wrong it should return to c

JavaFX application for the Sublime Sandwich Shop. The user can order sandwiches by using list boxes and the application displays the price. Each sandwich should allow a choice of at least three main ingredients (chicken, for example) at three different prices. The user should also be able to choose between three different bread types. Use CheckBoxes for additional ingredients - lettuce, tomato, etc.
Create an ArrayList to hold all of the sandwiches associated with an order. Display information about all the sandwiches that were ordered.

Answers

Answer:

package GUI;  

import java.awt.*;  

import java.awt.event.*;  

import javax.swing.*;

// Class SandwichShop definition

public class SandwichShop

{

// Creates a string array for sandwich ingredients  

String sandwichIngredients [] = {"Chicken", "Mutton", "Veg"};

// Creates a string array for bread types

String breadTypes[] = {"Bloomer", "Cob", "Plait"};

// Container object declared

JFrame jf;

JPanel p1, p2, p3, p4, mainP;

// Component object declared

JList ingredient, bread;

JLabel ingL, breadL, amountL;

JTextField amountT;

JButton amountB, exitB;

// Default constructor definition

SandwichShop()

{

// Creates frame

jf = new JFrame("Sandwich Shop");

// Creates panels

p1 = new JPanel();

p2 = new JPanel();

p3 = new JPanel();

p4 = new JPanel();

mainP = new JPanel();

// Creates list box and adds string array

ingredient = new JList<String>(sandwichIngredients);

bread = new JList<String>(breadTypes);

// Creates labels

ingL = new JLabel("Select Sandwich Ingredients");

breadL = new JLabel("Select Bread Types");

amountL = new JLabel("Amount: ");

// Creates text field

amountT = new JTextField(5);

// Creates buttons

amountB = new JButton("Check Amount");

exitB = new JButton("Exit");

// Adds components to panels

p1.add(ingL);

p1.add(ingredient);

p2.add(breadL);

p2.add(bread);

p3.add(amountL);

p3.add(amountT);

p4.add(amountB);

p4.add(exitB);

// Adds panels to main panel

mainP.add(p1);

mainP.add(p2);

mainP.add(p3);

mainP.add(p4);

// Set the main panel layout to 4 rows and 1 column

mainP.setLayout(new GridLayout(4, 1));

// Adds main panel to frame

jf.add(mainP);

// Sets the frame visible property to true

jf.setVisible(true);

// Set the size of the frame to width 400 and height 150

jf.setSize(400, 300);

// Registers action listener to exit button using anonymous class

exitB.addActionListener(new ActionListener()

{

// Overrides the actionPerformed() method

public void actionPerformed(ActionEvent ae)

{

System.exit(0);

}// End of method

});// End of anonymous class

// Registers action listener to amount button using anonymous class

amountB.addActionListener(new ActionListener()

{

// Overrides the actionPerformed() method

public void actionPerformed(ActionEvent ae)

{

// Extracts index of the selected item from the list box

int indexIngredient = ingredient.getSelectedIndex();

int indexBread = bread.getSelectedIndex();

// Checks if ingredient index is 0 and bread index is 0

// then set the amount 100 in text field

if(indexIngredient == 0 && indexBread == 0)

amountT.setText("100");

// Checks if ingredient index is 0 and bread index is 1

// then set the amount 120 in text field

if(indexIngredient == 0 && indexBread == 1)

amountT.setText("120");

// Checks if ingredient index is 0 and bread index is 2

// then set the amount 160 in text field

if(indexIngredient == 0 && indexBread == 2)

amountT.setText("160");

// Checks if ingredient index is 1 and bread index is 0

// then set the amount 190 in text field

if(indexIngredient == 1 && indexBread == 0)

amountT.setText("190");

// Checks if ingredient index is 1 and bread index is 1

// then set the amount 205 in text field

if(indexIngredient == 1 && indexBread == 1)

amountT.setText("205");

// Checks if ingredient index is 1 and bread index is 2

// then set the amount 210 in text field

if(indexIngredient == 1 && indexBread == 2)

amountT.setText("210");

// Checks if ingredient index is 2 and bread index is 0

// then set the amount 97 in text field

if(indexIngredient == 2 && indexBread == 0)

amountT.setText("97");

// Checks if ingredient index is 2 and bread index is 1

// then set the amount 85 in text field

if(indexIngredient == 2 && indexBread == 1)

amountT.setText("85");

// Checks if ingredient index is 2 and bread index is 2

// then set the amount 70 in text field

if(indexIngredient == 2 && indexBread == 2)

amountT.setText("70");

}// End of method

});// End of anonymous class

}// End of default constructor

// main function definition

public static void main(String[] args)

{

// Creates an anonymous object by calling default constructor

new SandwichShop();

}// End of main method

}// End of class

Output:

3. Which property is used to select full Row of data grid view
a) Select Mode b) Mode Selection c) Selection Mode d) Mode Select

Answers

Answer:

I think a is correct answer.

list two ways to insert a chart in powerpoint

Answers

Answer:

1st way: On the Insert tab, in the Illustrations group, click Chart. In the Insert Chart dialog box, click a chart, and then click OK.

2nd way: Click INSERT > Chart. Click the chart type and then double-click the chart you want.

What do you do if your computer dies/malfunctions? Reboot (Restart) Shut Down Recovery CD and Recover your system Call a person to fix it​

Answers

Answer:

Restart

Explanation:

Simply I may restart my pc if it dies/malfunctions. I'll not restart immediately, I'll wait for an hour and do restart my computer. If it doesn't work then maybe I'll Call a person to fix it.

Mary has been locked out of her account after failing to correctly enter her password three times. As the system administrator, you need to unlock her account. Which of the following commands would unlock Mary's account assuming that you are using pam_faillock.so module?

a. faillock --reset --user mary
b. pam_faillock --unlock --user mary
c. pam_faillock --reset --user mary
d. faillock --unlock --user mary

Answers

Oh hey lol yea yea lol I got the money back to me put on the phone so you know

what is IBM 1401 used for? Write your opinion.​

Answers

Explanation:

The 1401 was a “stored program computer,” allowing programmers to write (and share) applications loaded into the machine from punched cards or magnetic tape, all without the need to physically reconfigure the machine for each task.

Select the scenario that describes a top-down approach to data warehouse design.


Cathy’s Cards and Gifts, which has three stores, creates data marts for its sales, marketing, and delivery departments to study the possibility of establishing a new store.


Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.


Cynthia’s Florals, which is dealing with debt, creates new data marts for the service, delivery, and sales departments to develop a strategy to stay in business.


Connor’s Meat Market, which just opened, creates data marts to track the sale of each of the following meats: beef, pork, lamb, and fish.

Answers

Answer:

Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.

The scenario defines a top-down approach to data warehouse design as "Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed".

What is a top-down approach to data warehouse design?

In the "Top-Down" method system, a data warehouse exists defined as a subject-oriented, time-variant, non-volatile, and integrated data storage for the entire business data from various sources exist validated, reformatted, and saved in a normalized (up to 3NF) database as the data warehouse.

Therefore, the correct answer is option b) Crawford's Fabrics, which wants to expand its operations, combines data from the purchasing and sales departments into a central database, to be divided into new data marts as needed.

To learn more about warehouse design

https://brainly.com/question/25885061

#SPJ2

can somebody help what's wrong with this code
asap~

Answers

Answer:

There's a + missing to concatenate your variable to your string.

consider l= 5 ,r= 11. you must determine the sum of the values of the function in the range L to R . you have to calculate sum = lrf(x) in python coding

Answers

def summation (num1, num2):

i = 0

for x in range (num1 : num2 + 1):

i += x

return i

print ( summation(l, r))

What is the easiest way to deploy a C++ program to a user’s computer? a. Copy the source code to the user’s computer and then compile it b. Create a batch file that copies the program to the user’s computer and then run it c. Copy the executable file to the user’s computer d. Create an installer program and then run it on the user’s computer

Answers

Answer:

c. Copy the executable file to the user’s computer

Explanation:

When you run a c++ program, an executable file (.exe) is created in the same directory with the source file.

To deploy this program on another system, you need to transfer the executable file from the original system where the program was executed to the new system.

The program will work fine without errors.

However, do not mistake the executable file for the source file. The source file ends in .cpp.

Why are data silos problematic?

Answers

Answer:

Hampers collaboration

Resource wastage

Lack of data integrity

Explanation:

Data silos comes into play When different departments of an orgainiziations independently collects data needed for its operations. The finance, HR, administrative departments and so on collects their data and keeps it to themselves. As a result there is a repetitive and needless gathering and storage of already existing data, that is the data required by one group will have to be gathered again while it currently exists with another group. This leads to inefficient resource management and wastage. This practice also leads to data integrity as data stored differently across departments becomes inconsistent and less accurate over time. Team work and collaboration is gradually eroded as each group continues to hold on to its resources which poses a problem towards organizational growth.

Write a program named lastname_firstname_cities.py that works with information about large cities. Your program will open the cities.txt downloadfile. Each line in the file has the name of a city, its country, and its population. The first few lines of the file look like this:

Answers

Answer and Explanation:

Open your text editor and open new file. Save new file file as lastname_firstname_cities.py. The program will open the file cities.txt downloadfile hence :

dfile= open(cities.txt, "r")

If we write this into our lastname_firstname_cities.py file it will open our cities.txt downloadfile in read mode and text mode(by default unless we specify binary mode which is for images)

Write a C program that will load entries from a file containing details of books and prints them.

Program Requirements:
a. Load file containing details of books
b. Print out all the books Required approach:

1. Design a struct/class that can hold the details of an individual book.
2. Dynamically allocate an array of these objects. The size should be the number of book entries from the input file given by the user.
3. Load all of the book entries into this array of objects before printing

Answers

Answer:

........

Explanation:

. Write programming code in C++ for school-based grading system

Answers

Explanation:

The grade must be calculated based on following pattern:

Average Mark RangeGrade91-100A181-90A271-80B161-70B251-60C141-50C233-40D21-32E10-20E2

Calculate Grade of Student in C++

To calculate grade of a student on the basis of total marks in C++ programming, you have to ask from user to enter marks obtained in 5 subjects. Now add marks of all the 5 subjects and divide it by 5 to get average mark. And based on this average mark, find grade as per the table given above:

// C++ Program to Find Grade of Student // -------codescracker.com------- #include<iostream> using namespace std; int main() { int i; float mark, sum=0, avg; cout<<"Enter Marks obtained in 5 Subjects: "; for(i=0; i<5; i++)

who is considered as the father of computer science?​

Answers

Charles Babbage is known as father of computer science because he designed the original programmable computer .

I hope it helps and if you want to have good answer follow me, I will be your second sight on your any problems♥️♥️

Which one is the result of the output given by a computer
I​

Answers

Explanation:

Instruction , data and information all of these.

Kamal plans to offer new, more favorable contracts to business customers who are now receiving a discount and use wireless services. Determine whether each customer should receive a new contract as follows:
a. In cell 15, enter a formula using the AND function that tests whether the Wireless value is equal to "Y" and whether the Discount value is equal to "Y".
b. Fill the range 16:118 with the formula in cell 15.

Answers

Solution :

'AND" operation is a logical operation and is used in logical connective combining two statements and in truth tables.

Using AND operation verifies whether the outcome P and Q is true only when both the P as well as Q are true.  If one of the P or Q is not true, then outcome result will be false.

In the context, Kamal wishes to offer a new and more favorable contracts to the business customers who use a wireless services and receive a discount.

Therefore, using the AND operation of the customers as :

Customer     Wireless     Discount     Outcome

   A                   N                   N             FALSE

   B                   Y                   N             FALSE

  C                   N                   Y              FALSE

   D                   Y                   Y             TRUE

   

Chất xơ có nhiều trong thực phẩm nào?

Answers

Answer:

Quả lê Quả lê là một loại trái cây phổ biến vừa ngon vừa bổ dưỡng. ...

Quả dâu tây. Dâu tây là loại quả cực kỳ ngon. ...

Quả bơ Quả bơ khác hơn so với hầu hết các loại trái cây. ...

Quả táo. ...

Quả mâm xôi. ...

Quả chuối. ...

Cà rốt. ...

Củ cải đường.

Differentiate between TCP Reno and TCP Tahoe.

Answers

Answer:

They have different words

Explanation:

I hope it helps choose me the brainest

Pick a web browser (a leading one or perhaps a lesser-known one that you use) and examine the Privacy and Security features and settings. These can usually be found in the settings/options area of the browser. Identify the web browser you are analyzing and answer the following questions/prompts:
1. List and explain/discuss the privacy and security features that the browser has to offer.
2. How do these privacy and security features protect individuals?
3. How do these privacy and security features affect what businesses can do on the Internet in terms of gathering customer data?

Answers

Solution :

Chrome web browser

The Chrome web browser uses a range of privacy and security settings for its customers. They include several security indicators as well as malware protection. Chrome uses the sandboxing technology, which prevents the harmful viruses and Trojans from reaching the computers.

Chrome provides a safe browsing by giving us an alert whenever we try to browse some harmful web sites.  It also warns you if we use a username and password combination which has been compromised in any data leak.

Chrome also serves to protect the individuals :

It provides a features of Ad blocking.

When we want to browse safely without being recognized or without storing any credentials, Chrome provides an Incognito mode.

Many businesses can be done on the internet using Chrome platform that is safe and authenticate to gather and collect data and information.

Explain the purpose of the open() and close() operations.

Answers

Answer:

The open() operation notifies the system that the named file is about to become active. The close() operation notifies the system that the named file is no longer in active use by the user who issued the close operation.

Other Questions
To what extent is Ghana said to be a nation. Author Ken Yabuki wrote a magazine article based on ____ recent visit to IcelandSelect one:a. his b. hec. himd. himself What do you think has been the most important invention in history and why a particle P moves in a straight line such that, t s after leaving a point O, its velocity v ms^-1 is given by v=36t - 3t^2 for t>_ 0 1) find the value of t when the velocity of P stops increasing2)find the value of t when P comes to instaneous rest3) find the distance of P from O when P is at instaneous rest4) find the speed of P when P is again at O 1. In the past, Sam cashed his paycheck each month at Ready Cash, a check cashing service thatcharges a 5% fee. He recently opened a checking account at Bank of America so he can nowdeposit and/or cash his paycheck without a fee. If Sam is making $28,500 per year, how much willhe save by not going to Ready Cash anymore? Imagery is when the author uses words to create "mental images" for the reader.TrueFalse A. 4B.-1/4C. 4D. 1/4 What are the cause of global warming? A normal cost system applies overhead to jobs ________. multiple choice by multiplying a predetermined overhead rate by the estimated amount of the allocation base incurred by the job by multiplying a predetermined overhead rate by the actual amount of the allocation base incurred by the job using the actual amount of overhead caused by each job using the normal amount of overhead caused by each job My mother lives around me Far awayr 4. What did Colonel Johnson want after the Marines won Mount Suribachi? Jim has become particularly interested in the genetic basis of cancer and has spent considerable time reading published papers about oncogenes. He learned that as early as 1972 researchers suggested that mutations in proto-oncogenes caused by carcinogens can convert them to oncogenes. He asked you to answer a couple of questions about this because he did not have the biology background to totally understand. Jim learned that some cancer cells produce more growth-stimulating proteins than others. What would you give him as a plausible explanation Discuss the scaled index addressing mode and comments on the following instructions?a) MOV BX, [CX+5*AX]b) MOV [DX5*DI+30H], CX In right triangle ABC a.30b.45c.60d.75 All of the following statements are TRUE about a cardiac arrest EXCEPT:A. Cardiac arrest happens primarily to older individuals with a history of cardiac disease.B. Cardiac arrest is an electrical disturbance and abrupt loss of heart function.C. A heart attack can trigger an electrical disturbance in the heart.D. Using an AED for a cardiac arrest can improve the chance of survival to restart the heart's electrical rhythm. true or falseif we have more doctors than needed our country can develop in every fielda)trueb)false If A = -x + 2x - x + 1 and B = x + 5, find A + B. Choose the word that has the different main stress from that of the others.1. A. caring B. approach C. attract D. confide2. A. supportive B. determine C. sacrifice D. contractual What effect does asking rhetorical questions like this one have on an audience? Check all that apply. 5. How could looking at the canopy help determine the difference between a forest and awoodland?