Prime numbers can be generated by an algorithm known as the Sieve of Eratosthenes. The algorithm for this procedure is presented here. Write a program called primes.js that implements this algorithm. Have the program find and display all the prime numbers up to n = 150.
Sieve of Eratosthenes Algorithm
To Display All Prime Numbers Between 1 and n
Step 1: We need to start with all the numbers representing the range of numbers that are possible candidate primes. So, create an array of consecutive integers from 2 to n: (2,3,4,..n). I wouldn't hand-code this. I would use a loop to populate the array.
Step 2: At each step we select the smallest number and remove all it's multiples. So we'll start with an outer loop that goes from 2 to n. initially, let p equal 2, the first prime number.
Step 3: In an inner loop we need to iterate over all the numbers that are multiples of p, i.e for 2, that's 2,4,6,8 etc. Each time, setting it's value to false in the original array.
Step 4: Find the first number greater than p in the list that is not marked False. If there was no such number, stop. Otherwise, let p now equal this number( which is the next prime), and repeat from step 3.
When the algorithm terminates, all the numbers in the list that are not marked False are prime
Example: Let us take an example when n = 50. So we need to print all print numbers smaller than or equal to 50. We create list of all numbers from 2 to 50.
2 3 4 5 6 7 8 9 10
11 12 13 14 15 16 17 18 19 20
21 22 23 24 25 26 27 28 29 30
31 32 33 34 35 36 37 38 39 40
41 42 43 44 45 46 47 48 49 50

Answers

Answer 1

Answer:

const MAXNR=150;

let candidates = {};

for(let i=2; i<=MAXNR; i++) {

   candidates[i] = true;

}

for(let p=2; p <= MAXNR; p++) {

   if (candidates[p]) {

       process.stdout.write(`${p} `);

       // Now flag all multiples of p as false

       i=2;

       while(p*i <= MAXNR) {

           candidates[p*i] = false;

           i++;

       }

   }

}


Related Questions

What intangible benefits might an organization obtain from the development of an

information system?​

Answers

Answer:

The immaterial benefits stem from the development of an information system and cannot easily be measured in dollars or with confidence. Potential intangible advantages include a competitive need, timely information, improved planning and increased flexibility in organisation.

Explanation:

Intangible advantages

Take faster decisionsCompetitive needMore information timelyNew, better or more information availability.

Lower productivity and the lack of 'think outside' employees and managers as well as greater sales include the intangible costs of such an operational environment. All these factors improve when employees spend less of their time in addressing current methods of operation and are concerned about whether they will have a job or an employer in six months or a year. The automation level envisaged in this new system should enhance the overall efficiency of management. The operative controls and design functions should be simplified by tight system integrations with accessible automated database sources. However, it is difficult to describe the exact form of these simplifications.

Tangible costs of the new system include costs of analysis, design and construction of the system, such as the recruitment of contractors or new employees, and the assignment of existing staff. Also consideration shall be given to hardware, software purchased and operating costs. Intangible costs include disturbances to the current activities caused by development and deployment and potential adverse effects on the morals of employees.

While the new system may feel good in the long term, short-term stress and other negative consequences will still be present. In the way that Reliable does virtually everything, the system is the focus of a major change. An organisation's monumental change has widespread negative effects on operations and employees.

computer is an ............. machine because once a task is intitated computer proceeds on its own t ill its completion.​

Answers

Answer:

I think digital,versatile

computer is an electronic digital versatile machine because once a task is initiated computer proceeds on its own till its completation.

trình bày ngắn gọn hiểu biết của bản thân về mạng máy tính theo mô hình OSI hoặc TCP/IP

Answers

Answer:

OSI đề cập đến Kết nối hệ thống mở trong khi TCP / IP đề cập đến Giao thức điều khiển truyền. OSI theo cách tiếp cận dọc trong khi TCP / IP theo cách tiếp cận ngang. Mô hình OSI, lớp truyền tải, chỉ hướng kết nối trong khi mô hình TCP / IP là cả hướng kết nối và không kết nối.

Explanation:

dab

Solve the following linear program graphically (each line represents one unit). The feasible region is indicated by the shading and the corner points have been listed for you. Determine the objective function value at the corner points and indicate the optimal solution (if any). Minimize: Z

Answers

Answer:

(a): The value of the objective function at the corner points

[tex]Z = 10[/tex]

[tex]Z = 19[/tex]

[tex]Z = 15[/tex]

(b) The optimal solution is [tex](6,2)[/tex]

Explanation:

Given

[tex]Min\ Z = X_1 + 2X_2[/tex]

Subject to:

[tex]-2X_1 + 5X_2 \ge -2[/tex] ---- 1

[tex]X_1 + 4X_2 \le 27[/tex] ---- 2

[tex]8X_1 + 5X_2 \ge 58[/tex] --- 3

Solving (a): The value of the at the corner points

From the graph, the corner points are:

[tex](6,2)\ \ \ \ \ \ (11,4)\ \ \ \ \ \ \ \ (3,6)[/tex]

So, we have:

[tex](6,2)[/tex] ------- Corner point 1

[tex]Min\ Z = X_1 + 2X_2[/tex]

[tex]Z = 6 + 2 * 2[/tex]

[tex]Z = 6 + 4[/tex]

[tex]Z = 10[/tex]

[tex](11,4)[/tex] ------ Corner point 2

[tex]Min\ Z = X_1 + 2X_2[/tex]

[tex]Z = 11 + 2 * 4[/tex]

[tex]Z = 11 + 8[/tex]

[tex]Z = 19[/tex]

[tex](3,6)[/tex] --- Corner point 3

[tex]Min\ Z = X_1 + 2X_2[/tex]

[tex]Z = 3 + 2 * 6[/tex]

[tex]Z = 3 + 12[/tex]

[tex]Z = 15[/tex]

Solving (b): The optimal solution

Since we are to minimize Z, the optimal solution is at the corner point that gives the least value

In (a), the least value of Z is: [tex]Z = 10[/tex]

So, the optimal solution is at: corner point 1

[tex](6,2)[/tex]

What are interpersonal skills for non-technical user

Answers

Answer:Non-Technical Skills ('NTS') are interpersonal skills which include: communication skills; leadership skills; team-work skills; decision-making skills; and situation-awareness skills.

Explanation:

Questions to ask people on how corona has affected the religion sectors​

Answers

Answer:

bcoz of corona all churches and temples are closed and pilgrimage are cancelled

Create a program that simulates a race between several vehicles. Design and implement an inheritance hierarchy that includes Vehicle as an abstract superclass and several subclasses

Answers

Answer:

Explanation:

The following program is written in Java. Since there was not much information provided in the question I created a Vehicle superclass with a couple of subclasses for the different types of vehicles (motorcycle, sedan, truck). Each one having its own unique attributes. The vehicle class also has an attribute for the position of the vehicle in the race.

class Vehicle {

   int year, wheels, position;

   public Vehicle(int year, int wheels, int position) {

       this.year = year;

       this.wheels = wheels;

       this.position = position;

   }

   public int getYear() {

       return year;

   }

   public void setYear(int year) {

       this.year = year;

   }

   public int getWheels() {

       return wheels;

   }

   public void setWheels(int wheels) {

       this.wheels = wheels;

   }

   public int getPosition() {

       return position;

   }

   public void setPosition(int position) {

       this.position = position;

   }

}

class Motorcycle extends Vehicle {

   String manufacturer;

   double speed;

   public Motorcycle(int year, int wheels, int position) {

       super(year, wheels, position);

   }

   public Motorcycle(int year, int wheels, int position, String manufacturer, double speed) {

       super(year, wheels, position);

       this.manufacturer = manufacturer;

       this.speed = speed;

   }

   public String getManufacturer() {

       return manufacturer;

   }

   public void setManufacturer(String manufacturer) {

       this.manufacturer = manufacturer;

   }

   public double getSpeed() {

       return speed;

   }

   public void setSpeed(double speed) {

       this.speed = speed;

   }

}

class Sedan extends Vehicle {

   int passengers;

   String manufacturer;

   double speed;

   public Sedan(int year, int wheels, int position) {

       super(year, wheels, position);

   }

   public Sedan(int year, int wheels, int position, int passengers, String manufacturer, double speed) {

       super(year, wheels, position);

       this.passengers = passengers;

       this.manufacturer = manufacturer;

       this.speed = speed;

   }

   public int getPassengers() {

       return passengers;

   }

   public void setPassengers(int passengers) {

       this.passengers = passengers;

   }

   public String getManufacturer() {

       return manufacturer;

   }

   public void setManufacturer(String manufacturer) {

       this.manufacturer = manufacturer;

   }

   public double getSpeed() {

       return speed;

   }

   public void setSpeed(double speed) {

       this.speed = speed;

   }

}

class Truck extends Vehicle {

   int passengers;

   String manufacturer;

   double speed;

   public Truck(int year, int wheels, int position) {

       super(year, wheels, position);

   }

   public Truck(int year, int wheels, int position, int passengers, String manufacturer, double speed) {

       super(year, wheels, position);

       this.passengers = passengers;

       this.manufacturer = manufacturer;

       this.speed = speed;

   }

   public int getPassengers() {

       return passengers;

   }

   public void setPassengers(int passengers) {

       this.passengers = passengers;

   }

   public String getManufacturer() {

       return manufacturer;

   }

   public void setManufacturer(String manufacturer) {

       this.manufacturer = manufacturer;

   }

   public double getSpeed() {

       return speed;

   }

   public void setSpeed(double speed) {

       this.speed = speed;

   }

}

discuss three ways in which the local government should promote safe and healthy living​

Answers

Answer:

1. Secure drinkable water

2. Promote organic products through the provision of subsidiaries

3. Create a place for bioproducts to be sold

Explanation:

Whether drinking, domestic, food production, or for leisure purposes, safe and readily available water is important for public health. Better water supply and sanitation and improved water resource management can boost economic growth for countries and can make a significant contribution towards reduced poverty.some of the claimed benefits of organic food:

Without the use of pesticides and chemical products, organic farming does not toxic residues poison land, water, and air. Sustainable land and resource use in organic farming. Crop rotation promotes healthy and fertile soil.

In conventional farming, the use of pesticides contaminates runoff, which is a natural part of the water cycle. In groundwater, surface water, and rainfall, pesticide residues are found. This means that in food produced with pesticides, contamination may not be isolated, but also affect the environment.

Create a place for bioproducts to be sold

Biologics offer farmers, shippers, food processors, food retailers, and consumers a wide range of benefits. Biocontrols can also help protect the turf, ornamentals, and forests in addition to food use. They can also be used for disease and harm controls in public health, i.e., mosquitoes and the control of ticks.

The benefits of the use of biologicals in farming applications tend to be more direct, though they are indirect. The list includes benefits to crop quality and yield which help farmers supply consumer products worldwide with healthy and affordable fruit and vegetables. Biocontrols also allow farmers in their fields to maintain positive populations of insects (natural predators) through their highly-target modes of action, reducing their reliance on conventional chemical pesticides.

what are the functions of the windows button, Task View and Search Box? give me short answer

Answers

Answer:

Windows button = You can see a Start Menu

Task view = You can view your Tasks

Search Box = You can search any app you want in an instance

Design a function char maxChar (char,char)- to return the smallest character from the arguments.
in java please please​

Answers

Answer:

Following are the program to the given question:

public class Main//defining Main method

{

   char maxChar (char x1,char x2)//defining a method maxChar that takes two char parameter

   {

       if(x1<x2)//use if to compare char value

       {

           return x1;//return first char value

       }

       else//else block

       {

           return x2;//return second char value

       }

       

   }

public static void main(String[] args)//defining main method

{

    char x1,x2;//defining char variable

    x1='d';//use char to hold value

    x2='a';//use char to hold value

    Main ob=new Main();//creating class Object

 System.out.println(ob.maxChar(x1,x2));//calling method and prints its return value

}

}

Output:

a

Explanation:

In this code, a method "maxChar" is defined that holds two char variable "x1,x2" in its parameters, and use if conditional statement that checks the parameter value and print its return value.

In the main method, two char variable is declared that hold char value and passing the value in the method and prints its return value.  

Find the basic period and basic frequency of the function g(t)=8cos(10πt)+sin(15πt)

Answers

Answer:

The period is

[tex]\frac{2\pi}{5} [/tex]

The frequency is

[tex] \frac{5}{2\pi} [/tex]

Explanation:

The period of both functions will be LCM of both period.

The period of cos is

[tex] \frac{\pi}{5} [/tex]

The period of sin is

[tex] \frac{2\pi}{15} [/tex]

Let convert each into degrees.

[tex] \frac{\pi}{5} = 36[/tex]

[tex] \frac{2\pi}{15} = 24[/tex]

Find the least common multiple between 36 and 24, which is 72.

Convert 72 into radians

[tex]72 = \frac{2\pi}{5} [/tex]

The period is 2pi/5.

The frequency is equal to

1/period.

so the frequency is

[tex] \frac{1}{ \frac{2\pi}{5} } = \frac{5}{2\pi} [/tex]

To access a ___ library, you will need a computer and Internet access.

Answers

To access an online library, you will need a computer and an internet connection.

What are online libraries?

Online libraries are digital collections of books, journals, and other materials that are available to users through a web browser.

With a computer and internet access, users can browse, search, and read or download materials from the online library. Many online libraries also offer features such as personalized user accounts, bookmarking, and citation tools.

Online libraries have become increasingly popular as more content becomes available in digital format, making it easier and more convenient for people to access information from anywhere with an internet connection.

Read more about online library here:

https://brainly.com/question/20406929

#SPJ1

3. State whether the given statements are true or false. a. The computer is called a data processor because it can store, process, and retrieve data whenever needed. b. Modern processors run so fast in term of megahertz (MHz). c. If millions of calculations are to be performed, a computer will perform every calculation with the same accuracy. d. It is very safe to store data and information on the computer independently. e. If some electrical or electronic damages occur, there are no any chances of data loss or damage f. The output devices of the computer like monitor, printer, speaker, etc. can store meaningful information, g. The input devices can display the output after processing. h. Students can also use computer as their learning tools.​

Answers

Answer:

a,b,c,d,f,g are true only e is false

Think Critically 5-1 Creating Flexible Storage.
It's been 6 months since the disk crash at CSM Tech Publishing, and the owner is breathing a little easier because you installed a fault-tolerant solution to prevent loss of time and data if a disk crashes in the future. Business is good, and the current solution is starting to get low on disk space. In addition, the owner has some other needs that might require more disk space, and he wants to keep the data on separate volumes. He wants a flexible solution in which drives and volumes aren't restricted in their configuration. He also wants to be able to add storage space to existing volumes easily without having to reconfigure existing drives. He has the budget to add a storage enclosure system that can contain up to 10 HDDs. Which Windows feature can accommodate these needs, and how does it work?

Answers

Answer:

The Storage Spaces feature in Windows

Explanation:

The Storage Spaces feature can be used here. This feature was initiated in Windows server 2012 and allows the user store his files on the cloud or virtual storage. This makes it possible to have a flexible storage as there is a storage pool which is updated with more storage capacity as it decreases. The feature also offers storage security, backing up files to other disks to protect against total loss of data on a failed disk.

A python code only runs the except block when _____. Group of answer choices all the statements in the try block are executed an error occurs in the preceding try block the programmer manually calls the except block an error occurs anywhere in the code

Answers

Answer:

Python only running exception block when try block fails

Explanation:

i do cyber security and i was learning this in high school

In Python, try and except statements are used to catch and manage exceptions. Statements that can generate exceptions were placed within the try clause, while statements that handle the exception are put within the except clause.

An exception should be caught by except block, which is used to test code for errors that are specified in the "try" block. The content of the "except" block is executed if such a fault/error appears.In Python, the exception block only runs when an error occurs in the try block.

Therefore, the answer is "try block fails ".

Learn more:

brainly.com/question/19154398

Create a list of lists, named hamsplits, such that hamsplits[i] is a list of all the words in the i-th sentence of the text. The sentences should be stored in the order that they appear, and so should the words within each sentence. Regarding how to break up the text into sentences and how to store the words, the guidelines are as follows: Sentences end with '.', '?', and '!'. You should convert all letters to lowercase. For each word, strip out any punctuation. For instance, in the text above, the first and last sentences would be: hamsplits[0] == ['and', 'can', 'you', 'by', ..., 'dangerous', 'lunacy'] hamsplits[-1] == ['madness', 'in', 'great', ..., 'not', 'unwatchd', 'go']

Answers

Answer:

Explanation:

The following code is written in Python. It takes in a story as a parameter and splits it into sentences. Then it adds those sentences into the list of lists called hamsplits, cleaned up and in lowercase. A test case is used in the picture below and called so that it shows an output of the sentence in the second element of the hamsplits list.

def Brainly(story):

   story_split = re.split('[.?!]', story.lower())

   hamsplits = []

   for sentence in story_split:

       hamsplits.append(sentence.split(' '))

   for list in hamsplits:

       for word in list:

           if word == '':

               list.remove(word)

or Java,
program to perform this computa
3.
Isaac Newton devised a clever method to casily approximate the square root of a number without having
to use a calculator that has the square root function. Describe this method with illustration​

Answers

Answer:

The illustration in Java is as follows:

import java.util.*;

import java.lang.Math.*;

class Main{

public static void main (String[] args){

 Scanner input = new Scanner(System.in);

 double num, root, temp;

 num = input.nextDouble();

 temp = num;

 while (true){

  root = 0.5 * ( (num / temp)+temp);

  if (Math.abs(root - temp) < 0.00001){

   break;   }

  temp = root;  }

 System.out.println("Root: "+root);

}}

Explanation:

This declares all necessary variables

 double num, root, temp;

This gets input for num (i.e the number whose square root is to be calculated)

 num = input.nextDouble();

This saves the input number to temp

 temp = num;

This loop is repeated until it is exited from within the loop

 while (true){

Calculate temporary square root

  root = 0.5 * ( (num / temp)+temp);

The loop is exited, if the absolute difference between the root and temp is less than 0.00001

  if (Math.abs(root - temp) < 0.00001){

   break;   }

Save the calculated root to temp

  temp = root;  }

This prints the calculated root

 System.out.println("Root: "+root);

A technician is able to connect to a web however, the technician receives the error, when alternating to access a different web Page cannot be displayed. Which command line tools would be BEST to identify the root cause of the connection problem?

Answers

Answer:

nslookup

Explanation:

Nslookup command is considered as one of the most popular command-line software for a Domain Name System probing. It is a network administration command-line tool that is available for the operating systems of many computer. It is mainly used for troubleshooting the DNS problems.

Thus, in the context, the technician receives the error "Web page cannot be displayed" when he alternates to access different web page, the nslookup command is the best command tool to find the root cause of the connection problem.

(Ramanujan's Taxi) Srinivasa Ramanujan indian mathematician who became famous for his intuition for numbers. When the English mathemematician G.H. Hardy came ot visit him in the hospital one day, Hardy remarked that the number if his taxi was 1729, a rather dull number. To which Ramanujan replied, "No, Hardy! It is a very interesting number. It is the smallest number expressible as the sum of two cubes in two different ways." Verify this claim by writing a program Ramanujan.java that takes a command-line argument N and prints out all integers less than or equal to N that can be expressed as the sum of two cubes in two different ways. In other words, find distinct positive integers a, b, c, and d such that а3 + b3 = c3 - d3. Hint: Use four nested for loops, with these bounds on the loop variables: 0 < a < 3√N, a < b < 3√N - a3, a < c < 3√N and c < d < 3√N - C3; do not explicitly compute cube roots, and instead use x . x *x < y in place of х < Math.cbrt (y).
$ javac Ramanujan.java
$ java Ramanujan 40000
1729 = 1"3 + 12^3 = 9^3 + 10"3
4104 = 2^3 + 16^3 = 9^3 + 15^3
13832 = 2^3 + 24^3 = 18^3 + 20^3
39312 = 2^3 + 34^3 = 15^3 + 33^3
32832 = 4^3 + 32^3 = 18^3 + 30^3
20683 = 10^3 + 27^3 = 19^3 + 24^3

Answers

Answer:

Here the code is given as follows,

Explanation:

Code:

public class Ramanujan {  

   public static void main(String[] args) {  

       // check cmd argument

       int n = Integer.parseInt(args[0]);  

       // checking a^3 + b^3 = c^3 + d^3  

       // outer loop

       for (int a = 1; (a*a*a) <= n; a++) {  

           int a3 = a*a*a;  

           // no solution is possible, since upcoming a values are more

           if (a3 > n)  

               break;  

           // avoid duplicate

           for (int b = a; (b * b * b) <= (n - a3); b++) {  

               int b3 = b*b*b;  

               if (a3 + b3 > n)

                   break;  

               // avoid duplicates

               for (int c = a + 1; (c*c*c) <= n; c++) {  

                   int c3 = c*c*c;  

                   if (c3 > a3 + b3)

                       break;  

                   // avoid duplicates

                   for (int d = c; (d * d * d) <= (n - c3); d++) {  

                       int d3 = d*d*d;  

                       if (c3 + d3 > a3 + b3)  

                           break;  

                       if (c3 + d3 == a3 + b3) {

                           System.out.print((a3+b3) + " = ");

                           System.out.print(a + "^3 + " + b + "^3 = ");  

                           System.out.print(c + "^3 + " + d + "^3");  

                           System.out.println();

                       }

                   }

               }

           }

       }

   }

}

My iPhone XR screen is popping out. Is it because I dropped it?

Answers

Answer:

Yes that is most likely why your screen is popping out.

Explanation:

Most likely

Information systems cannot solve some business problems. Give three examples and explain why technology cannot help

Answers

Answer:

The following are brief descriptions or the three examples of the declaration presented.

Explanation:

The information capable of supplying just the data in a method to achieve the following objectives. However, the machine cannot decide about the company.Technology is unable to document as well as to adapt it according to the scenario, everything remains to be accomplished by hand.Individuals must thus recognize but instead capitalize mostly on regions of opportunity.

Marketing có phải là bán hàng hay không? Giải thích?

Answers

Answer:

Sự khác biệt giữa bán hàng và tiếp thị là bán hàng tập trung vào làm việc trực tiếp với khách hàng tiềm năng để khiến họ chuyển đổi, trong khi tiếp thị tập trung vào việc khơi dậy sự quan tâm đến sản phẩm của bạn.

Answer:

Marketing không phải là bán hàngg

Explanation:

Nó là công cụ hỗ trợ cho việc bán hàng

bao bì chủ động active packaging và bao bì thông minh intelligent packaging khác biệt như thế nào

Answers

answer:

yes....................

which of the following indicates that the loop should stop when the value in the quantity variable is less than the number 50​

Answers

Answer:

while (quantity >= 50)

Explanation:

Required

Stop when quantity is less than 50

To do this, we make use of a while statement and the syntax is:

while (condition){ }

If the loop should stop when quantity is less than 50; then it means the loop would continue when quantity is greater or equal to 50

So, we have:

while (quantity >= 50)

which of the following is an example of how science can solve social problems?
It can reduce the frequency of severe weather conditions.
It can control the time and day when cyclones happen.
It can identify the sources of polluted water.
It can stop excessive rain from occurring.

Answers

Answer:

It can identify the sources of polluted water.

Explanation:

Science can be defined as a branch of intellectual and practical study which systematically observe a body of fact in relation to the structure and behavior of non-living and living organisms (animals, plants and humans) in the natural world through experiments.

A scientific method can be defined as a research method that typically involves the use of experimental and mathematical techniques which comprises of a series of steps such as systematic observation, measurement, and analysis to formulate, test and modify a hypothesis.

An example of how science can solve social problems is that it can identify the sources of polluted water through research, conducting an experiment or simulation of the pollution by using a computer software application.

In conclusion, science is a field of knowledge that typically involves the process of applying, creating and managing practical or scientific knowledge to solve problems and improve human life.

Answer:

It can identify the sources of polluted water.

Explanation:

Which of the following statements describes a limitation of using a computer simulation to model a real-world object or system?

a. Computer simulations can only be built after the real-world object or system has been created.
b. Computer simulations only run on very powerful computers that are not available to the general public.
c. Computer simulations usually make some simplifying assumptions about the real-world object or system being modeled.

Answers

Answer:

The answer is "Option c".

Explanation:

Computer simulation, use of a machine to simulate a system's vibration signals by another modeled system's behaviors. A simulator employs a computer program to generate a mathematical model or representation of a true system. It usually gives a lot of simplifications concerning the physical image or system that is modeled, so this statement describes the limitation of using a computer simulation in modeling a real-world object or process.

Please answer

NO LINKS​

Answers

Answer:

Please find the attached file for the complete solution:

Explanation:

A network technician is planning to update the firmware on a router on the network. The technician has downloaded the file from the vendor's website. Before installing the firmware update, which of the following steps should the technician perform to ensure file integrity?

a. Perform antivirus and anti-malware scans of the file.
b. Perform a hash on the file for comparison with the vendor’s hash.
c. Download the file a second time and compare the version numbers.
d. Compare the hash of the file to the previous firmware update.

Answers

Answer: B. Perform a hash on the file for comparison with the vendor’s hash.

Explanation:

Before installing the firmware update, the step that the technician should perform to ensure file integrity is to perform a hash on the file for comparison with the vendor’s hash.

Hashing refers to the algorithm that is used for the calculation of a string value from a file. Hashes are helpful in the identification of a threat on a machine and when a user wants to query the network for the existence of a certain file.

A compound Boolean expression created with the __________ operator is true only if
both of its subexpressions are true.
a. and
b. or
c. not
d. both

Answers

Answer:

the answer is AND

Explanation:

The condition is " both of its sunexpressions are true"

So OR us not the answer. Not and Borh are not the proper Boolean language.

Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a VendingMachine object that performs the following operations:

Purchases input number of drinks
Restocks input number of bottles
Reports inventory
The VendingMachine is found in VendingMachine.java. A VendingMachine's initial inventory is 20 drinks.

Ex: If the input is:

5 2
the output is:

Inventory: 17 bottles

Need this answer in java! !!!!!!!!!!!!

Answers

Answer:

import java.util.Scanner;

class Main {

 public static void main (String args[])

 {

   Scanner input = new Scanner(System.in);

   VendingMachine machine = new VendingMachine(20);

   System.out.print("Enter nr to purchase: ");

   int nrPurchased = input.nextInt();

   System.out.print("Enter nr to re-stock: ");

   int nrRestock = input.nextInt();

   machine.Transaction(nrPurchased, nrRestock);

   input.close();

 }

}

class VendingMachine {

 private int inventory;

 public VendingMachine(int initialInventory) {

   inventory = initialInventory;

 }

 public void Transaction(int nrToBuy, int nrToRestock) {

   inventory += nrToRestock - nrToBuy;

   System.out.printf("Inventory: %d bottles.\n", inventory);

 }

}

The program is an illustration of a sequential program, and it does not require loops, iterations and branches.

The program in java, where comments are used to explain each line is as follows:

import java.util.Scanner;

class Main {

public static void main (String args[]){

   //This creates a scanner object

  Scanner input = new Scanner(System.in);

  //This gets input for the number of purchases

  int Purchased = input.nextInt();

  //This gets input for the number of restocks

  int Restock = input.nextInt();

  //This calculates and prints the inventory

System.out.print("Inventory: "+(20 - Purchased + Restock)+" bottles");

}

}

At the end of the program, the net inventory is printed.

Read more about similar programs at:

https://brainly.com/question/22851981

Other Questions
Please help me with solving these. Thank you very much. Have a great day! What determines the strength of a dipole dipole force? When you close a file, what happens to the Undo History list for that file? 7)8)13x + 1/9x + 3A) 6C) -7B) 8D) 7)C)I tion 9 of 1010 PointsTwo sides of a triangle have lengths 4 and 8. Which of the Two sides of the triangle have lengths of 4 and 8. Which of the following can NOT be the length of the third side?A. 7B. 4C. 5D. 6 cng thc o hm ca ln(u) = ? Which two sentences in this excerpt from John F. Kennedy's inaugural address demonstrate the use of antithesis as a rhetorical device? Who was a powerful sultan in the Ottoman Empire? write 5 idioms on happy, sad and unforgettable moment . 3. Holding hands in public is uncomfortable for Blake. Reese does not know thisabout Blake and tries to hold hands while walking in the hallway one day atschool. Blake gets really angry and storms off away from Reese. Blake realizesthis boundary was never communicated with Reese but now Reese knows. SinceBlake reacted so badly when Reese tried to hold hands, Blake doesn't really needto say anything.True or false? hey guys ... just want to make this answer sure... subtract 2x+3x+6 from 3x+5x+7=? A)x+2x+1 or B)x+8x+13 Select all the correct answers..Which three statements provide reasons that scientists are considering renewable sources of energy?re...Most renewable resources are clean and nonpolluting.Renewable resources can be replenished.O Renewable sources are conventional resources.Most renewable resources are easily available in nature.All renewable resources are cost effective.ResetResetNext E)The parallelogram WXYZ belwo is a rhombus. Find the measure ofangles 1, 2, 3, 4 and 5 given that angle WZY is 60w2314Answer:60 what living things can be found in mangrove forest and tropical rainforest Big Corporation receives management consulting services from its 95 percent owned subsidiary, Small Inc. For the year 20X8, Small billed Big $140,000. Small's labor cost and other associated costs for the employees providing services to Big totaled $121,000 in 20X8. Big reported $2,567,000 of income from its own separate operations for 20X8, and Small reported net income of $695,000.Based on the preceding information, what amount of consolidated net income should be reported in 20X8?a. $3,262,000b. $4,050,000c. $3,254,100d. $3,122,000 An investigation is an example ofA. BiasB. PseudoscienceC. Inquiry D. The scientific method A baseball is hit and its height at different one-second intervals is recorded (See attachment) Prepare a dialogue between two friends including the importance of water resources and possibility of hydropower generation in our country The graph below shows the solution to which system of inequalities? profession in medical are not practiced for money but for public welfare