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
Novay_Z [31]
2 years ago
10

A programmer is creating an algorithm that will be used to turn on the motor to open the gate in a parking garage. The specifica

tions for the algorithm are as follows. The gate should not open when the time is outside of business hours. The motor should not turn on unless the gate sensor is activated. The motor should not turn on if the gate is already open. Which of the following algorithms can be used to open the gate under the appropriate conditions?
Computers and Technology
1 answer:
Mars2501 [29]2 years ago
5 0

The algorithm which can be used to open the gate under the appropriate conditions is:

  1. Check if the time is during business hours.
  2. If Yes, check if the gate sensor is activated.
  3. If Yes, check if the gate is open.
  4. If it is No, turn on the motor.

<h3>What is an algorithm?</h3>

An algorithm can be defined as a standard formula (procedures) which comprises a set of finite steps and instructions that is typically used for solving a problem on a computer under the appropriate conditions.

This ultimately implies that, an algorithm is a standard, logical formula (procedures) containing the step-by-step rules and instructions for performing a specific task or proffering a solution to a specific problem on a computer system.

In this scenario, the algorithm which can be used to open the gate under the appropriate conditions is:

  1. Check if the time is during business hours.
  2. If Yes, check if the gate sensor is activated.
  3. If Yes, check if the gate is open.
  4. If it is No, turn on the motor.

Read more on algorithm here: brainly.com/question/24793921

You might be interested in
Data that are collected on large populations of individuals and stored in databases are referred to as _____.
xz_007 [3.2K]
The answer is statistics
4 0
3 years ago
Write a program that inputs a text file. The program should print the unique words in the file in alphabetical order. Uppercase
satela [25.4K]

Answer:

Read the file and save it to a variable as a string, split the string variable and cast it to a set object using the set function to get the unique words in the file. Then use the max function with the key attribute to use regular expression module "re" to compare the first letter of each item to return in a list comprehension or append to a list.

Explanation:

The open function is used to import a file in python, the split string method splits the string to a list of items and the set function removes any duplicates of a word or item.

Using the for loop statement, iterate over the items and compare and return the items in alphabetical order with the 're' search method getting the item with uppercase letters with higher precedence than lowercase.

5 0
3 years ago
Write a program that: program starts; declares and initializes to .06625 constant float variable NJSALES_TAX; declares and initi
FromTheMoon [43]

Answer:

Written in C++

#include<iostream>

using namespace std;

int main() {

const float SALES_TAX = 0.06625;

int total = 1000;

cout<<"Total: ";

cin>>total;

float grand_total = 0;

grand_total = total + total * SALES_TAX;

if (grand_total <= 1000) {

cout<<"Grand total is less than or equal to 1000 it is $";

printf("%.2f", grand_total);  

}

else if (grand_total > 1000 && grand_total <= 2000 ) {

cout<<"Grand total is more than 1000 less than or equal to 2000 it is $";

printf("%.2f", grand_total);  

}

else {

cout<<"Grand total is greater than 2000 it is $";

printf("%.2f", grand_total);  

}

cout<<"\nProgram finished!";

return 0;

}

Explanation:

<em>I've added the full source code as an attachment where I use comments to explain difficult lines</em>

Download cpp
5 0
4 years ago
Which answer best describes an unsubsidized federal loan?
soldi70 [24.7K]

The answer is you are responsible for paying all the interest that accumulates on your loan. <span>For unsubsidized loans, the interest accumulates while you are in school, and 6 months after you graduate (or drop out) you will start paying on your loans. </span>

6 0
3 years ago
Consider two medical tests, A and B for a virus. Test A is 95% effective at recognizing the virus when it is present but has a 1
finlep [7]

Answer:

Test B.

Explanation:

Test A - 95% effective with 10% false positive rate.

Test B -90% effective with 5% false positive rate.

Test A and B are independent methods.

One of the tests is carried out on a person and turns out to be positive.

To calculate the effectiveness of the test,

  Test A = Effectiveness in  percentage divided  by the false positive rate.

                   95/10 = 9.5

 

  Test B  = Effectiveness in  percentage divided  by the false positive rate.

                   90/5 = 18.

   

Test B has a higher effective rate than Test A.

Therefore Test B is more indicative of a positive result than Test A.

8 0
4 years ago
Other questions:
  • Hen pointing to a tool on the ribbon, a ______ appears, displaying information about the tool.
    7·1 answer
  • The outstanding disk requests are for tracks 6,10,4,20,36,8, and 40 in that order. Assume that the seek time speed is 5 msec/tra
    14·1 answer
  • Eric is working on a computer that has a device driver error. Eric can find the name of the device driver however the actual dev
    8·1 answer
  • • Write a program to find the maximum, minimum, and average score of players. The input to the program is a file containing play
    9·1 answer
  • What does Mishler mean by the foreground-background interaction? How can this affect the photographs, based on the examples in t
    14·2 answers
  • Bill's manager has asked him to send all staff members the directions for checking out the new projector. In one to two sentence
    14·2 answers
  • Assume that we have an application with a total of 500,000 instructions where 20% of them are the load/store instructions with a
    14·1 answer
  • The information that’s displayed in a datalist control is defined by _____.
    10·1 answer
  • Though there are no specific federal laws for cyberbullying, in some cases cyberbullying
    6·1 answer
  • List and briefly explain four common template elements
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!