answer.
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
umka21 [38]
2 years ago
3

NOTE: in mathematics, the square root of a negative number is not real; in Java therefore, passing such a value to the square ro

ot function returns a value known as NaN (not-a-number). Given a double variable named areaOfSquare write the necessary code to read in a value, the area of some square, into areaOfSquare and print out the length of the side of that square. HOWEVER: if any value read in is not valid input, just print the message "INVALID". ASSUME the availability of a variable, stdin, that references a Scanner object associated with standard input.
Computers and Technology
1 answer:
Anestetic [448]2 years ago
7 0

Answer:

// program in java.

import java.util.*;

// class definition

class Main

{// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read input

Scanner scr=new Scanner(System.in);

System.out.print("Enter area of square: ");

// read the area of square  

double areaOfSquare=scr.nextDouble();

// if area is negative

if(areaOfSquare<0)

{

// print Invalid

System.out.println("INVALID");

}

// else find side of the square and print it.

else

System.out.println("The side of the square is: "+Math.sqrt(areaOfSquare));

     

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read the area of square from user and assign it to variable "areaOfSquare". If the area entered by user is negative then print "INVALID" otherwise find the  side of the square with Math.sqrt() function and print it.

Output:

Enter area of square: -4                                                                                                  

INVALID

Enter area of square: 25                                                                                                  

The side of the square is: 5.0

You might be interested in
15. It is the process of capturing data or translating information to recording format
Helen [10]

Answer:

A Documentation, hope this helps.

5 0
2 years ago
The vast amount of data collected from Internet searches, social media posts, customer transactions, military
Brums [2.3K]

Answer:

A. Big Data

Explanation:

It is big data. The internet searches, customer transactions, social media posts, medical tests, weather sensors, military surveillance, and all the data source you are seeing around yourself forms together with the big data. And a big social media company gathers around so many petabytes of data each day. And there are so many such companies, plus all sorts like eLearning sites, etc. And all these together form the big data.

3 0
2 years ago
Information gets from sensory memory to short-term memory through the process of _________.
Alika [10]
What is referred to the description above is the term SELECTIVE ATTENTION. When there is selective attention, there are certain memories that are only selected and these are processed to become part of the short-term memory. Not everything that is being sensed is remembered.
3 0
2 years ago
Printers produce _____ output. Displays produce _____ output. A _____ is an audio output device that converts text to speech. Ma
sesenic [268]

Answer:

"Hard copy", "Soft copy", "voice synthesizer", "flat panel", "projector".

Explanation:

  1. The above-defined words will fill the above blanks. Then the above sentence above below meanings:-
  2. The hard copy is ab printed form of soft copy which is generated by the printer device.
  3. The soft copy is displayed on the monitor screen.
  4. The voice synthesizer is used to convert the text onto a speech.
  5. The flat-panel device has a low volume and weight. There is much display which is in this type.
  6. The projector is used to display on the wall.
8 0
2 years ago
You would like the user of a program to enter a customer’s last name. Write a statement thaUse the variables k, d, and s so that
mojhsa [17]

Answer:

1st question:

Use the variables k, d, and s so that they can read three different values from standard input an integer, a float, and a string respectively. On one line, print these variables in reverse order with exactly one space in between each. On a second line, print them in the original order with one space in between them.

Solution:

In Python:

k = input()  #prompts user to input value of k i.e. integer value

d = input()  #prompts user to input value of d i.e. float value

s = input()  #prompts user to input value of s i.e. a string

print (s, d, k)  #displays these variable values in reverse order

print (k, d, s)#displays these variable values in original order

In C++:

#include <iostream>    // to use input output functions

using namespace std;   //to identify objects like cin cout

int main() {    //start of main function

  int k;   //declare int type variable to store an integer value

  float d; //  declare float type variable to store a float value

  string s;   //  declare string type variable to store an integer value

  cin >> k >> d >> s;    //reads the value of k, d and s

  cout << s << " " << d << " " << k << endl;     //displays these variables values in reverse order

  cout << k << " " << d << " " << s << endl;   } // displays these variable values in original order

Explanation:

2nd question:

You would like the user of a program to enter a customer’s last name. Write a statement that asks user "Last Name:" and assigns input to a string variable called last_name.

Solution:

In Python:

last_name = input("Last Name:")

# input function is used to accept input from user and assign the input value to last_name variable

In C++:

string last_name;  //declares a string type variable named last_name

cout<<"Last Name: ";  // prompts user to enter last name by displaying this message Last Name:

cin>>last_name; // reads and assigns the input value to string variable last_name

The programs alongwith their outputs are attached.

6 0
2 years ago
Other questions:
  • When ____ occur during preliminary debugging, dummy print statements—statements that are temporarily inserted into the code to d
    9·1 answer
  • A form that dedicates a page for each item retrieved for a case; it allows investigators to add more detail about exactly what w
    10·1 answer
  • As in algebra, you can use brackets to override the order of operations Excel follows to perform formula calculations. True or f
    13·1 answer
  • Assume that you are testing the Orders database introduced in Watt (2014) - Appendix C. Discuss the problems and possible conseq
    12·1 answer
  • Which of the following image file formats uses lossy file compression?
    7·1 answer
  • Why do agriculture and natural resource systems vary from state to state?
    8·1 answer
  • They predicted another cold day in Seattle. They predicted another windy day in Seattle. Combine the sentences into one sentence
    8·1 answer
  • You work at a computer repair store. A customer is having trouble with their hard drives. The computer is not recognizing all th
    7·1 answer
  • All of the following are true of functions except: Group of answer choices They define specific tasks that can be used at many p
    5·1 answer
  • Even though Wordpress is basically free, what is the company trying to accomplish?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!