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
katrin2010 [14]
1 year ago
12

In a certain game, a player may have the opportunity to attempt a bonus round to earn extra points. In a typical game, a player

is given 1 to 4 bonus round attempts. For each attempt, the player typically earns the extra points 70% of the time and does not earn the extra points 30% of the time. The following code segment can be used to simulate the bonus round.
success - 0
attempts - RANDOM 1, 4
REPEAT attempts TIMES
IF (RANDOM 110 s 7
success - success + 1
DISPLAY "The player had"
DISPLAY attempts
DISPLAY "bonus round attempts and"
DISPLAY success
DISPLAY "of them earned extra points."
Which of the following is not a possible output of this simulation?
А. The player had 1 bonus round attempts and 1 of them earned extra points.
B The player had 2 bonus round attempts and of them earned extra points.
С The player had 3 bonus round attempts and 7 of them earned extra points.
D The player had 4 bonus round attempts and 3 of them earned extra points.
Computers and Technology
1 answer:
Assoli18 [71]1 year ago
8 0

Answer:

С The player had 3 bonus round attempts and 7 of them earned extra points.

Explanation:

Given

See attachment for correct code segment

Required

Which of the options is not possible?

From the question, we understand that:

attempts \to [1,4] --- attempt can only assume values 1, 2, 3 and 4

The following "if statement" is repeated three times

<em>IF RANDOM[1,10] <= 7:</em>

<em>    success = success + 1</em>

This implies that the maximum value of the success variable is 3

The first printed value is the attempt variable

The second printed value is the success variable.

From the list of given options, (a), (b) and (d) are within the correct range of the two variable.

While (c) is out of range because the value printed for variable success is 7 (and 7 is greater than the expected maximum of 3)

You might be interested in
Every employee of your company has a Google account. Your operational team needs to manage a large number of instances on Comput
Blizzard [7]

Answer:

Generate the fresh set of SSH keys. Offer every member of the team that private key. Customize the public key as a public SSH key for a project in the Cloud Platform project as well as require public SSH keys for each instance

Explanation:

Almost many person seems to have a google profile at their corporation. The vast amount of incidents on Compute Machine have to be handled by the operating staff. Any team member just requires operational accessibility towards the network. The safety department needs to ensure that credentials are distributed in such an administratively efficient way and have to be prepared to recognize that has accessed the specified case.

So, they are creating the latest key set for SSH. Offer every members of the team their private key. Customize its public key as just a public SSH key for such a program in the Cloud Platform project as well as require public SSH keys for each instance.

7 0
2 years ago
How would you categorize the software that runs on mobile devices? Break down these apps into at least three basic categories an
I am Lyosha [343]

Mobile software is an App that can be downloaded to a mobile device and used to execute specific tasks. Once the app is initiated, it runs inside the operating system until it is been closed by the user. These are small, individual software units which can work as a browser, game, shopping app, calculator and more.


There are mainly 3 types of mobile apps:

Native applications, Hybrid applications, and Web applications.


Native Applications:

Native applications are developed to be used on a particular platform or device. They exist on the device and are accessed through icons on the device. Native apps are written for specific Operating System, which means a separate source code is written for each OS, such as iOS, Android, Linux, and Windows, this means, a native Android software will not work on a windows platform, because the Windows platform does not have the source code to operate the software, however, the advantages of native applications is that they can take the full advantage all features in the devices’


Web Application:

Web application (Web app) is a client-server software application, in which the client runs in a web browser. It is stored on a remote server and delivered over the Internet through a browser interface. It is not designed for a specific type of device or an operating system, which means it can be accessed from several devices. Web applications commonly use a combination of server-side script (ASP, PHP, etc) and client-side script (HTML, Javascript, etc.) to be developed.


Hybrid Applications:

Hybrid applications have the characteristic of both web applications and native applications. They combine the elements of both native and Web applications. They are developed using HTML, CSS, and Javascript, and then wrapped into a native application using platforms like Cordova. Since they are designed for various platforms, they don’t require different source codes like native apps, Web application development is obviously faster, simpler and rapid.

5 0
2 years ago
Read 2 more answers
In a certain game, a player may have the opportunity to attempt a bonus round to earn extra points. In a typical game, a player
Assoli18 [71]

Answer:

С The player had 3 bonus round attempts and 7 of them earned extra points.

Explanation:

Given

See attachment for correct code segment

Required

Which of the options is not possible?

From the question, we understand that:

attempts \to [1,4] --- attempt can only assume values 1, 2, 3 and 4

The following "if statement" is repeated three times

<em>IF RANDOM[1,10] <= 7:</em>

<em>    success = success + 1</em>

This implies that the maximum value of the success variable is 3

The first printed value is the attempt variable

The second printed value is the success variable.

From the list of given options, (a), (b) and (d) are within the correct range of the two variable.

While (c) is out of range because the value printed for variable success is 7 (and 7 is greater than the expected maximum of 3)

8 0
1 year ago
Employees at a store are paid daily wages according to the following rules.
Eva8 [605]

Answer:

See explaination

Explanation:

public class Payroll

{

private int[] itemsSold;

private double[] wages;

//constructor is just kept for demonstrating the code output

public Payroll()

{

itemsSold = new int[] {48,50,37,62,38,70,55,37,64,60};

wages = new double[10];

}

/*

to compute Bonus Threshold, you have to find sum Of Items Sold, highest and lowest

deduct highest and lowest from sum Of Items Sold and then divide by number of items -2

to find the bonus Threshold

*/

public double computeBonusThreshold()

{

int highest = itemsSold[0];

int lowest = itemsSold[0];

int sumOfItemsSold = itemsSold[0];

double bonusThreshold =0;

//iterate over items , find sum of items sold and highest and lowest

for (int i = 1; i < itemsSold.length ; i++)

{

sumOfItemsSold += itemsSold[i];

if(itemsSold[i] > highest)

highest = itemsSold[i];

if(itemsSold[i] < lowest )

lowest = itemsSold[i];

}

bonusThreshold = (sumOfItemsSold - lowest - highest ) / (itemsSold.length -2.0);

return bonusThreshold;

}

/*

Compute wages as asked, wage for an employee is fixed wage added with itemSold * perItemWage

When an employee sold items more than bonus Threshold Items then he will get extra 10%

*/

public void computeWages(double fixedWage, double perItemWage)

{

double bonusThresholdForWages = computeBonusThreshold();

for (int i = 0; i < wages.length ; i++)

{

wages[i] = fixedWage + ( itemsSold[i] * perItemWage);

if(itemsSold[i] > bonusThresholdForWages)

{

wages[i] = wages[i] * 1.1 ; //which is 10 % extra of current wage of employee

}

}

}

/*

Method to show itemsold, wages for the employee

*/

public void printWages()

{

for (int i = 0; i < wages.length ; i++)

{

System.out.printf("Employee =%d , ItemsSold = %d, Wage = %.2f\n",i,itemsSold[i], wages[i]);

}

}

}

=========main.java======

public class Main

{

public static void main(String[] args) {

//create an object of payroll class, where itemsSolds are hard coded for demo

Payroll payroll = new Payroll();

System.out.println("Bonus threshold items are : " + payroll.computeBonusThreshold());

//call computeWages which will internally class bonus threshold as well

payroll.computeWages(10.0,1.5);

payroll.printWages();

}

}

See attachment for screenshot of codes for indentation.

4 0
2 years ago
Write a program whose input is a string which contains a character and a phrase, and whose output indicates the number of times
Svet_ta [14]

Answer:

import java.util.Scanner;

public class NumberOfOccurences {

public static void main(String[] args) {

 // Create an object of the Scanner class to allow for user inputs

 Scanner input = new Scanner(System.in);

 // Prompt user to enter text

 System.out.println("Please enter the phrase");

 // Store text in a variable

 String phrase = input.nextLine();

 // Prompt user to enter character to be checked

 System.out.println("Please enter the character to check");

 // Store character in a char variable

 char character = input.next().charAt(0);

 // Create and initialize a variable count to zero

 // count will hold the number of occurrences of the character in the phrase

 int count = 0;

 // Loop through each of the character in the string text

 // At every cycle of the loop, compare the character of the string

 // with the character to be checked.

 // If they match, count is incremented

 for (int i = 0; i < phrase.length(); i++) {

  if (phrase.charAt(i) == character) {

   count++;

  }

 }

 // Print out the number of occurrences due to count

 System.out.println(character + " appears this many times " + count);

}

}

Explanation:

The source code file has been attached to this response and has been saved as "NumberOfOccurrences.java". Please download the file and go through the code including the comment. Pay attention to the comments for readability and understandability.

Hope this helps!

Download java
5 0
1 year ago
Other questions:
  • CAPTCHAs can be used as a form of signature to create a valid contract in e-commerce. True False
    6·2 answers
  • In the State of Florida, the penalties for DUI become progressively more severe depending upon the number of convictions and the
    6·3 answers
  • Which element of the word program window contains buttons for saving a document and for undoing, redoing, and repeating a change
    5·1 answer
  • Any software or program that comes in many forms and is designed to disrupt the normal operation of a computer by allowing an un
    13·1 answer
  • Rupa would like to quickly insert a table into her document without having to worry about formatting the data in the table. Whic
    5·2 answers
  • Because of the density of vehicle in urban areas, you should ____.
    8·2 answers
  • In step 4 of the CSMA/CA protocol, a station that successfully transmits a frame begins the CSMA/CA protocol for a second frame
    9·1 answer
  • A common fallacy is to use MIPS (millions of instructions per second) to compare the performance of two different processors, an
    15·1 answer
  • In order to avoid slipping in the shop, your footwear should ___________.
    10·1 answer
  • Write a class named Employee that has private data members for an employee's name, ID_number, salary, and email_address. It shou
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!