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
cupoosta [38]
3 years ago
10

What is a power surge?

Computers and Technology
1 answer:
Damm [24]3 years ago
4 0
D. A spike of electricity. They are fast and have a short duration.
You might be interested in
On the Audio Tools contextual tab, which tab will control how the audio file appears, if it appears, on the slide
MrMuchimi
B is the correct answer
5 0
3 years ago
Read 2 more answers
Write a method named coinFlip that accepts as its parameter a string holding a file name, opens that file and reads its contents
V125BC [204]

Answer:

Here is the JAVA program:

import java.io.*;

import java.util.*;

public class Main {

public static void main(String[] args) throws FileNotFoundException{ //the start of main() function body, it throws an exception that indicates a failed  attempt to open the file

Scanner input = new Scanner(new File("file.txt")); //creates a Scanner object and a File object to open and scan through the file.txt    

coinFlip(input);    } //calls coinFlip method

public static void coinFlip(Scanner input) { //coinFlip method that accepts as its parameter a string input holding a file name

while(input.hasNextLine()) { //iterates through the input file checking if there is another line in the input file

Scanner scan = new Scanner(input.nextLine()); //creates a Scanner object

int head = 0; // stores count of number of heads

int count = 0; //stores count of  total number of tokens

while(scan.hasNext()) { //iterates through the sequence checking if there is another sequence in the input file

String token= scan.next(); // checks and returns the next token

if (token.equalsIgnoreCase("H")||token.equalsIgnoreCase("Heads")) { //compares H or Heads with the tokens in file ignoring lower case and upper case differences

           head++;                } //if a token i.e. any form of heads in file matches with the H or Heads then add 1 to the number of heads

           count++;            } //increment to 1 to compute total number of counts

double result = Percentage(head, count); //calls Percentage method passing number of heads and total counts to compute the percentage of heads

System.out.println(head + " heads " + "(" + result +"%)"); // prints the number of heads

if(result >= 50.00) { //if the percentage is greater or equal to 50

System.out.println("You win!");} //displays this message if above if condition is true

else //if the percentage is less than 50

{System.out.println("You lose!");}  }    } //displays this message if above if condition is false

public static double Percentage(int h, int total) { //method to compute the percentage of heads

double p = (double)h/total* 100; // divide number of heads with the total count and multiply the result by 100 to compute percentage

return p;    } } //returns result

Explanation:

The program is well explained in the comments mentioned with each line of the above code. I will explain how the method coinFlip  works.

Method coinFlip accepts a string holding a file name as its parameter. It opens that file and reads its contents as a sequence of tokens. Then it reads and scans through each token and the if condition statement:

if (token.equalsIgnoreCase("H")||token.equalsIgnoreCase("Heads"))

checks if the each token in the sequence stored in the file is equal to the H or Heads regardless of the case of the token. For example if the first token in the sequence is H then this if condition evaluates to true. Then the head++ statement increments the count of head by 1. After scanning each token in the sequence the variable count is also increased to 1.

If the token of the sequence is HeAds then this if condition evaluates to true because the lower or upper case difference is ignored due to equalsIgnoreCase method. Each time a head is found in the sequence the variable head is incremented to 1.

However if the token in the sequence is Tails then this if condition evaluates to false. Then the value of head variable is not incremented to 1. Next the count variable is incremented to 1 because this variable value is always incremented to 1 each time a token is scanned because count returns the total number of tokens and head returns total number of heads in the tokens.

Percentage method is used to return the percentage of the number of heads in the sequence. It takes head and count as parameters (h and total). Computes the percentage by this formula h/total* 100. If the result of this is greater than or equal to 50 then the message  You win is displayed otherwise message You lose! is displayed in output.

3 0
3 years ago
Dns (domain name system) servers translate all domain names into _____.
pshichka [43]
They translate them into ip addresses.
5 0
4 years ago
How many questions are on the ap computer science principles test
defon
Answer:
70.

Explanation:
The 2021 AP Computer Science Principles Exam is 2 hours long and includes approximately 70 multiple-choice questions. There will be three types of questions: Single-select questions (57 questions).

Hope this help’s!
Please give Brainliest!
5 0
2 years ago
what are all the computer shortcut keys for windows 10? including the shortcut keys to open the repair menu at start up for a la
Anettt [7]
Copy: Ctrl + C.
Cut: Ctrl + X.
Paste: Ctrl + V.
Maximize
Window
: F11 or
Windows
logo key + Up Arrow.
Task View:
Windows
logo key + Tab.
Switch between open apps:
Windows
logo key + D.
Shutdown options:
Windows
logo key + X.
Lock your
PC
Windows
logo key + L. This is the easiest way to access Windows 10 boot
options. All you need to do is hold down the Shift key on your
keyboard and restart the PC.
Open up the Start menu
and click on “Power” button to
open power options
7 0
3 years ago
Read 2 more answers
Other questions:
  • You need to set up a network that needs to span multibple buildings. For this reason, you want to use the cabling that supports
    10·1 answer
  • In object-oriented development, why is it necessary to use drivers and stubs in testing?
    9·1 answer
  • What is the difference between an IP address and an IP Packet?
    14·1 answer
  • Which commands are on the right-most side of the Title bar? (From Microsoft Word)
    9·1 answer
  • Agile methods typically use a ______ model, which represents a series of iterations, or revisions, which are based on user feedb
    7·1 answer
  • How are general-purpose reg
    9·1 answer
  • What happens when text is added to grouped objects that is larger than an object ?
    9·2 answers
  • 3. Program to find the sum of all even numbers from m to n, where m and n
    14·1 answer
  • Brian needs to see the space available to insert content on a slide in his presentation which feature of the presentation should
    10·1 answer
  • Requests to retrieve data written in a language such as SQL are called…
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!