Write a program that will print out statistics for coin tosses. the user will input either an "h" for heads or a "t"

Answers

Answer 1
01f or(int i=0;i<TOTAL_TOSS;i++)

02 {

03   System.out.print("Toss number "+i+". Please enter h for heads, and t for tails: ");

04   toss=scan.nextInt();

05   if(toss==1)

06   {

07       HeadCount++;

08   }

09   else

10   {

11      TailsCount++;

12   }

13}


you can work with that

Related Questions

what is the difference between a router and a modem

Answers

A router is a device that allows numerous computers to join a network. A modem is a device that provides access to the Internet. 

What is Pseudo-code? Write a Pseudo-code to determine a student’s final grade and indicate whether it is passing or failing. The final grade is calculated as the average of five marks. (Passing criteria is Grade >=50 )

Answers

Pseudo-code is a method of outlining/designing a program before actually using the programming language to code it. Again, Pseudo-code is not the actual programming language but it can include keywords from the language itself along with general words to describe what the particular purpose of that code is for. For example, the Pseudo code for this example would be: 1.) Collect Students grades with I/O operation (either from file or from user) 2.) Get average of students grades, average is Students grades divided by 5. 3.) Use comparative operators in your language to check if average is greater than or equal to 50. 4.) Display Students passing/failing status with I/O operation. 5.) End program or repeat for next user.

How can you differentiate between standard and protocol? Write at least on example of each of these terminologies?

Answers

Both protocol and standard define set of rules used by  two or more parties to interact between themselves.
The difference is that a standard is a formalized protocol accepted by most of the parties that implement it. Standards have exact and detailed specification regarding the network and define guidelines that specify the communication between the parties, 
Examples for protocols are: hyper-text transfer protocol (HTTP), file transfer protocol (FTP) ,transmission control protocol / internet protocol (TCP/IP)...
Examples for standards: IEEE 802.3, IEEE 802.7, IEEE 802.11,..

The programming interface between an application program and the dbms is usually provided by the

Answers

The Data Access API.

Write a java program (non-gui preferred) that has a method named atomic(). demonstrate in the program how two threads can, sometimes, invoke atomic() concurrently. create a second version of the program in which the two threads cannot invoke atomic concurrently.

Answers

Let's create a static counter shared by the two threads. The atomic method will increment, then decrement the counter. If concurrent invocations happen, the counter may hit 2, otherwise it should be 1.

public class HelloRunnable implements Runnable {

    public static int counter = 0;

    public static void atomic() {
        int value = ++counter;
        System.out.printf("%d ", value);
        counter = value - 1;
    }
    
    public void run() {
        int iter = 0;
        while(iter++ < 1000) {
            atomic();
        }
    }

    public static void main(String[] args) {
        (new Thread(new HelloRunnable())).start();
        (new Thread(new HelloRunnable())).start();
    }
}

You'll see an irregular pattern of 1's and 2's. Now if you add the synchronized keyword to atomic(), it'll be 1's only, because only one thread will enter atomic() at a time.

ie.:

    public synchronized static void atomic() {

Sending packets with false ip source addresses is called ____. ip address spoofing a port scanning attack a ip address scanning attack none of the above.

Answers

Sending packets with false IP source addresses is called IP address spoofing 

While working independently, you need to weigh your options on a topic. You research and analyze the topic so you can ensure your resolution is the best for everyone. What is this processed called?

Conflict resolution

Decision-making

Negotiation

Verbal communication

Answers

i think this process would be Decision-Making, because the scenario is that you have to decide on what topic you are going to pick, based on research and what you think would be the best resolution. I don't think that Conflict resolution would be correct because there is no conflict and neither Negotiation nor Verbal Communication have anything to do with this, so i believe it's safe to assume the correct answer would be Decision Making.

While working independently, you need to weigh your options on a topic. The process is called Decision-making. The correct option is b.

What is decision-making?

Identifying a decision, acquiring data, and weighing potential solutions are all steps in the decision-making process. You can make more careful, intelligent decisions by organising pertinent information and outlining alternatives by following a step-by-step decision-making process.

The situation is that you must select a topic based on your study and what you believe to be the best course of action. Since there is no conflict and neither verbal nor written communication is relevant, I don't think that conflict resolution would be the right response. Therefore, it seems safe to infer that the right response is decision-making.

Therefore, the correct option is b, Decision-making.

To learn more about decision-making, refer to the link:

https://brainly.com/question/13244895

#SPJ2

What type of malware is heavily dependent on a user in order to spread?
a. rootkit
b. virus
c. worm
d. trojan?

Answers

Hello There!

The correct answer is in fact B. Virus.

Hope This Helps You!
Good Luck :) 

- Hannah ❤

Malware analysis is used by incident responders and security experts to: Discover the origin of an attack. Sort incidents according to their severity. Boost the process of incident response's effectiveness. Thus, option B is correct.

What malware is dependent on a user in order to spread?

Clicking links in emails, messaging applications, or social network posts that lead to fraudulent websites. By hiding in the HTML of hijacked websites, sometimes known as drive-by downloads, viruses can be downloaded as soon as the page loads in your browser.

A file or piece of code that can almost perform whatever action an attacker desires can be delivered over a network and can infect, investigate, steal, or conduct. Additionally, there are many ways to infect computers due to the wide variety of viruses.

Therefore, using network drives or external hard drives that are infected with your device.

Learn more about malware here:

https://brainly.com/question/14276107

#SPJ2

A pie chart with one more slices offset is referred to as a

Answers

A Pie Chart is what it is called

A technology _____ begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is replaced by a newer, substantially better technology.
a. hierarchy
b. process
c. continuum
d. lockout
e. cycle

Answers

A technology cycle begins with the birth of a new technology and ends when that technology reaches its limits and dies as it is replaced by a newer, substantially better technology.

The combination of two or more technologies or data feeds into a single, integrated tool is referred to as a _____.
a. interleave
b. trackback
c. hyperlink
d. mash-up
e. folksonomy

Answers

mash-up, I believe, is the correct answer.

There are three bloodborne pathogens to which healthcare workers in the US are most likely to be exposed. Which ones are these? A. Human Immunodeficiency Virus (HIV), Hepatitis B virus, and Hepatitis C virus B. Zika, Hepatitis B virus, and Hepatitis C virus C. Ebola, Hepatitis B virus, and Hepatitis C virus D. Human Immunodeficiency Virus (HIV), Hepatitis B virus, and Ebola

Answers

The answer is A: HIV, Hepatitis B, and Hepatitis C

Most healthcare workers are exposed to the above in one of the ways below:

1. Needle sticks and other sharps.

2. Contact of mucous membrane and skin exposures.

The estimation of HIV infections alone, from sharps is roughly about 1 in 300 health workers. The chance of becoming infected with HBV from sharps is estimated to be about 6 and 30%. Health workers should be extra cautious and take advantage of the available work practices to prevent exposure to blood or body fluids.


Answer:

A

Explanation:

The person who receives financial protection from a life insurance plan is called a:

Answers

The answer to this question is A. Beneficiary
Payer is the person who buy the insurance (not necessarily for themselves only, can be given to their family or friends). Insured can not only be a person, but it also can be an object (such as cars). And the giver is the company who provide the insurance service for the payer.
I believe it's called being a beneficiary.

A preformatted text box inserted via the text box button on the insert tab is a _______. select one:

a. inline object formatted with square text wrapping

b. floating object formatted with square text wrapping

c. inline object formatted with tight text wrapping

d. floating object formatted with tight text wrapping

Answers

The answer is that it is inline object formatted with square text wrapping as its text will flow in the outline square of the given object to be around it that's why it is in line and not to be considered as a floating object formatted with tight or square text wrapping.

If a ps/2 keyboard does not work on your system and yet you know the keyboard is good, what is the best solution?

Answers

Do you have drivers installed for that keyboard on your ps2?

which is not a factor that leads to technological advancement?

a) inflation rate

b) new methods

c) advanced devices

d) desire for productivity

Answers

The inflation rate is the rate of increase in aggregate prices (things becoming more expensive over time), primarily driven by an increase in the money supply. The effect of inflation on an economy is debatable, and can have positive and negative implications. It generally moves very closely with a growth in the money supply, so that real prices are not heavily affected by inflation in the long-run.
Inflation is not related to technological advancement, but the nominal change in prices. 

New methods, advanced devices, and firms' incentive to become more productive all logically contribute to more advanced technology. 

The answer is A) inflation rate

In Microsoft Word, when you highlight existing text you want to replace, you are in



A.automatic mode.

B.basic mode.

C.typeover mode.

D.insert mode.

Answers

The correct answer is C. Typeover mode

This is when you select a text and can then type over it and it automatically replaces it with what you're writing. It also creates a little box that lets you edit the selected part easily if that's what you need with things like bold or italic or change the text color.

If amperage goes down and voltage remains the same what happens to resistance

Answers

V=I*R, so R=V/I

From looking at the formula: if I goes down, R will go up.

From thinking about it:  if less current is drawn from a battery and it is still healthy (ie., the voltage remains the same), it has to be because the resistance increased.

Float_abs - return bit-level equivalent of absolute value of f for * floating point argument f. * both the argument and result are passed as unsigned int's, but * they are to be interpreted as the bit-level representations of * single-precision floating point values. * when argument is nan, return argument.. * legal ops: any integer/unsigned operations incl. ||, &&. also if, while * max ops: 10 * rating: 2

Answers

Final answer:

In computer science, finding the bit-level absolute value of a floating-point number involves identifying and possibly changing the sign bit using bitwise operations. If the number is NaN, it is returned unchanged. The key operations involve the use of masks and bitwise AND.

Explanation:

The student's question is related to Computer Science, specifically the topic of floating-point numbers and their representation in binary form. When working with floating-point arithmetic at the bit level, the goal is to find the absolute value of a given floating-point number represented as an unsigned int. This involves manipulating the bits of the floating-point number such that, if the number is not a NaN (Not a Number), only the sign bit of the number is changed (if necessary) to ensure the value is non-negative.

To accomplish this using bit-level operations:

First, identify the sign bit of the floating-point representation. In IEEE 754 format for single-precision numbers, this is the most significant bit.Next, use bitwise operations to clear the sign bit, effectively taking the absolute value.If the original number was NaN, ensure that the outcome does not change as NaN has no sign.

The operation to clear the sign bit typically involves using a mask with all bits set to 1 except the sign bit. By using a bitwise AND operation with this mask, the result will have the sign bit cleared without modifying any other bits of the representation.

What pointer appears when pointing to a hyperlink

Answers

Your answer would be: a hand pointer.

Answer: hand

Explanation: The hand pointer appears when pointing to a hyperlink, like that found in a help window displayed by the Tell Me box. When you click a link a browser window opens.

What do you click to create a new presentation in Normal view? A. Section B. Blank Presentation C. Layout D. New Slide

Answers

B. Blank presentation, this way you have a normal view presentation but you can also add your own features.

The answer is B. Blank Presentation.  With this option, you are able to adjust the presentation to anyway you want to deliver it.

Write the definition of a function add, that receives two int parameters and returns their sum. python

Answers

def Add(a, b):
    return a+b

Following are the method program to the given question:

Program Explanation:

Defining a method "add" that takes two integer variables "a,b" in the parameter.Inside the method, a return keyword is used that adds and return parameter value.Outside the method, two integer variable "a, b" is defined that use int with the input method to input value.After input value, a print method is defined that calls the method and prints its calculated value with the message.

Program:

def add(a,b):#defining a method add that takes two parameter  

   return a+b#using return keyword that adds parameter value

a=int(input("Enter first number: "))#defining integer variable a that inputs value

b=int(input("Enter second number: "))#defining integer variable b that inputs value

print('Sum: ',add(a,b))#using print method that calls method and prints its calculated value with message

Output:

Please find the attached file.

Learn more:

brainly.com/question/13314892

(Java) Can anyone help me with this question ???

Answers

Your print function is too specific. It should be more like:

for( int i = 0; i < data.length; i++ )
    System.out.print( data[ i ] );


append() would be something like:

int[] c = new int[ a.length + b.length ];
int j = 0;
for( int i = 0; i < a.length; i++ )
    c[ i ] = a[ i ];

for( int i = j; i < ( b.length + a.length ); i++ )
    c[ i ] = b[ i ];
return( c );

When using a template to compose a memorandum which key on the keyboard moves the cursor to the next field
Caps lock tab shift ctrl

Answers

The tab key moves the cursor to the next field in the tab order, which is set by the programmer.

While a computer is running the operating system remains in memory. true or false?

Answers

While a computer is running the operating system remains in memory is true.

Which of the following questions would be most helpful in determining the market structure of a specific market? A. How far are goods shipped? B. How similar are the products? C. How many people want to buy? D. How are the corporations organized?

Answers

B. how similar are the products?

Martin wants to calculate integer multiples up to 10 for a list of numbers. For example, he needs to multiply the first number in a list, list[0], by 1, 2, 3, etc., up to 10. What should he use?

Answers

A for loop.






----------------------------

"1. how do you prevent unauthorized personnel from accessing your cisco device through the console port? "

Answers

The device should be physically protected. This means it should be located in special room (server room) in which access will have only authorized personnel. \
Second thing is to use password protection. With password protection everyone who wants to configure the CISCO device will have to authorize him/herself.
Final answer:

To prevent unauthorized access to a Cisco device through the console port, set a strong password and implement physical security measures to control access to the device.

Explanation:

To prevent unauthorized personnel from accessing your Cisco device through the console port, you should take several security measures. First, configure a password for console access. This can be done by entering the Cisco device’s global configuration mode, using the command line 'configure terminal', and then setting a password with 'line console 0' followed by 'password YOUR_PASSWORD' and 'login'.

Additionally, it's crucial to use a strong password that is both secure and easy to remember. Using a passphrase made up of a collection of words is a good practice, such as 'correcthorsebatterystaple', which is more secure than complex but shorter passwords.

Lastly, ensure that physical security measures are in place to restrict access to the device itself. This can involve keeping networking devices in locked rooms or cabinets, and maintaining a registry of authorized personnel who have physical access to these devices.

Sql server comes with a complete set of reference manuals and help information called ____________________________________.

Answers

The manuals are called "Books Online." These allow the user to better understand the functionality of SQL Server and how to create data management tools. In other terms, this is the "knowledge base" for SQL and how to effectively use it when creating databases.

Write a for loop to print all num_vals elements of array hourlytemp. separate elements with a comma and space. ex: if hourlytemp = {90, 92, 94, 95}, print: 90, 92, 94, 95 note that the last element is not followed by a comma, space, or newline.

Answers

import java.util.Scanner; public class PrintWithComma { public static void main (String [] args) { final int NUM_VALS = 4; int[] hourlyTemp = new int[NUM_VALS]; int i = 0; hourlyTemp[0] = 90; hourlyTemp[1] = 92; hourlyTemp[2] = 94; hourlyTemp[3] = 95; /* Answer */ System.out.println(""); return; } }
Other Questions
Find the vertices and foci of the hyperbola with equation (x+1)^2/16-(y+5)^2/9=1 Importance of history Talia wants to write the equation of the graphed line in point-slope form. These are the steps she plans to use: Step 1: Choose a point on the line, such as (2, 5). Step 2: Choose another point on the line, such as (1, 3). Step 3: Count units to determine the slope ratio. The line runs 1 unit to the right and rises 2 units up, so the slope is . Step 4: Substitute those values into the point-slope form. y y1 = m(x x1) y 3 = (x 1) Which of Talias steps is incorrect? Step 1 is incorrect because it uses a point that is not on the line. Step 2 is incorrect because it uses a point that is not on the line. Step 3 is incorrect because it shows an incorrect ratio for the slope. Step 4 is incorrect because it shows an incorrect substitution of (1, 3) into the point-slope form. What is the difference between the nucleotides used in dna replication during the pcr and the nucleotides used during dna duplication within the cell? four main parts of a spiral galaxy Sodium metal reacts with water to form aqueous sodium hydroxide and hydrogen gas. which equation below best describes the balanced equation for this reaction? na + h2o naoh (aq) + h2 (g) 2na + 2h2o 2naoh (aq) + h2 (g) na + h2o naoh (aq) + h (g) 2na + h2o na2oh (aq) + h (g) s + h2o soh (aq) + h (g) 3x - 8y + 2x - 5 - 5y Find two numbers whose product is 20 and whose sum is 12 Kalaysha is reading a passage using the strategies she learned with collaborative strategic reading. she has just encountered a "clunk." what has just happened? A container holds 6 gallon of juice how many in pints The general reaction of carboxylic acid derivatives is __________. Which of the following explains an incentive for an indentured servant to come to America? Solve for PQ 4x+19=2x+32 What is the meaning of life? What makes this world so great? Is there something to look forward to in the future? People who are colored blind most likely have deficiencies in their:rodsconeslensoptic nerveoccipital lobe An 8 foot length of 4 inch wide crown molding costs $16. How much will it cost to buy 40 feet of crown molding? This tribe migrated across Africa bringing iron technology with it Beliefs to the right of center generally oppose ____ in society Which of the following usually takes one full year to complete A. An ACT course B. An extracurricular activity C. A dual enrollment course D. An AP course What is the slope of the line passing through the points (1, 7) and (4, 1)?2nd picture is the choices I have. Steam Workshop Downloader