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
Gnesinka [82]
2 years ago
13

Select the correct text in the passage.

Computers and Technology
1 answer:
sergejj [24]2 years ago
5 0

Answer:

2. Scientists use seismometers to measure the earthquake activity that occurs beneath a volcano. They then predict the eruption of that volcano.

Explanation:

The options are:

1. Before a volcano erupts, earthquake activity beneath the volcano decreases.2. Scientists use seismometers to measure the earthquake activity that occurs beneath a volcano. They then predict the eruption of that volcano.3. When a volcano erupts, the amount of carbon dioxide and sulfur dioxide emitted decreases. 4.Scientists measure the amount of these gases to determine the amount of magma present in the volcanic reservoir.

The answer is certainly 2. as seismometers are being used to find out the details of the earthquake activities which occur inside a volcano. And with this information, the volcanologists then predict the eruption of that particular volcano. Hence, the 2nd option does not have any factual errors, and all the others have factual errors.

You might be interested in
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
Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
harina [27]

Answer:

One of the strategies to avoid nested conditional is to use logical expressions such as the use of AND & operator.

One strategy is to use an  interface class with a method. That method can be created to be used for a common functionality or purpose. This is also called strategy design pattern. You can move the chunk of conditional statement to that method. Then each class can implement that interface class and use that shared method according to their own required task by creating objects of sub classes and call that common method for any such object. This is called polymorphism.

Explanation:

Nested conditionals refers to the use of if or else if statement inside another if or else if statement or you can simply say a condition inside another condition. For example:

if( condition1) {  

//executes when condition1 evaluates to true

 if(condition2) {

//executes when condition1  and condition2 evaluate to true

 }  else if(condition3) {

 //when condition1 is true and condition3 is true

} else {

 //condition1  is true but neither condition2 nor conditions3 are true

}  }

The deeply nested conditionals make the program difficult to understand or read if the nested conditionals are not indented properly. Also the debugging gets difficult when the program has a lot of nested conditionals.

So in order to avoid nested conditionals some strategies are used such as using a switch statement.

Here i will give an example of one of the strategies i have mentioned in the answer.

Using Logical Expressions:

A strategy to avoid nested conditionals is to use logical expressions with logical operators such as AND operator. The above described example of nested conditionals can be written as:

if(condition1 && condition2){  //this executes only when both condition1 and condition2 are true

} else if(condition1 && condition3) {

this executes only when both condition1 and condition3 are true

} else if(condition1 ){

//condition1  is true but neither condtion2 nor condtion3 are true  }

This can further be modified to one conditional as:

if(!condition3){

// when  condition1 and condition2 are true

}

else

// condition3 is true

Now lets take a simple example of deciding to go to school or not based on some conditions.

if (temperature< 40){

  if (busArrived=="yes")   {

      if (!sick)       {

          if (homework=="done")           {

              printf("Go to school.");

          }

      }     

  }

}

This uses nested conditionals. This can be changed to a single conditional using AND logical operator.

if ((temperature <40) && (busArrived=="yes") &&

(!sick) && (homework=="done"))

{    cout<<"Go to school."; }

6 0
2 years ago
Enter a formula in cell G5 that calculates the difference between the attendance totals for 2018 and 2017. Copy the formula to t
Allushta [10]
This is done by a very simple formula: the only thing you need to type is =x-y where x is the cell that contains the total of 2018 and y being the cell that contains the total for 2017. If both are numeric values you can use the formula = A1-B1 and get your result. Your <span>cells don't have to be in the same order as your formula.</span>
4 0
2 years ago
(NumberFormatException)Write the bin2Dec(String binaryString) method to convert a binary string into a decimal number. Implement
tresset_1 [31]

The following program will be used that prompts the user to enter a binary number as a string and displays decimal equivalent of the string.

<u>Explanation:</u>

NumberFormat.java

import java.util.Scanner;

public class NumberFormat{

public static void main(String[] args) {

      Scanner scan = new Scanner(System.in);

      try{

      System.out.println("Enter a binary string:");

      String s = scan.next();

      int integerValue = bin2Dec(Integer.parseInt(s));

      System.out.println("The decimal value of "+s+" is "+integerValue);

      }

      catch(NumberFormatException e){

          System.out.println(e);

      }

  }  

  public static int bin2Dec(int binaryNumber) throws NumberFormatException{

  int decimal = 0;

  int p = 0;

  try{

  while(true){

  if(binaryNumber == 0){

  break;

  } else {

  int temp = binaryNumber%10;

  decimal += temp*Math.pow(2, p);

  binaryNumber = binaryNumber/10;

  p++;

  }

  }

  }

  catch(NumberFormatException e){

      throw new NumberFormatException("Invalid binary number");

  }

  return decimal;

  }

}

Output:

Enter a binary string:

1011000101

The decimal value of 1011000101 is 709

5 0
2 years ago
What does the following function return? void index_of_smallest(const double all, int startindex, int numberOfSlots); A. a doubl
Flauer [41]

Answer:

nothing

Explanation:

Because the return type of the function is void. void means does not return any thing.

The syntax of the function:

type name( argument_1, argument_2,......)

{

  statement;

}

in the declaration the type define the return type of the function.

it can be int, float, double, char, void etc.

For example:

int count( int index);

the return type of above function is int. So, it return integer.

similarly,

void count(int index);

it return type is void. So, it does not return any thing.

7 0
2 years ago
Other questions:
  • Marissa works at a company that makes perfume. She noticed many samples of the perfume were not passing inspection. She conducte
    6·2 answers
  • A domain's ____ settings must be configured correctly so that the mail transfer agent (mta) can establish a connection with a re
    15·1 answer
  • Grabar microphone audio icon_person click each item to hear a list of vocabulary words from the lesson. then, record yourself sa
    7·2 answers
  • . When you have multiple graphics positioned on a page, you can _______________ them so that they are a single graphic instead o
    9·1 answer
  • The function below takes two arguments, a dictionary called dog_dictionary and a list of dog names (strings) adopted_dog_names.
    8·1 answer
  • You're the sole IT employee at your company. Most of the computers in your fleet are Windows machines. Your boss wants you to se
    11·1 answer
  • Jennifer has written a short story for children. What should be her last step before she submits the story for publication?
    11·1 answer
  • Which statement is true about the purpose of a work in process constraint?
    15·1 answer
  • When adopting and implementing a Software as a Service (SaaS) platform such as Salesforce for your business, which responsibilit
    7·1 answer
  • You are an IT manager at Gigantic Life Insurance. You have a new desktop support person starting today whose experience is limit
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!