Answer:
#Implementation of Queue class
class Queue
#Implementation of _init_
def _init_(self, limit=10):
#calculate the self.data
self.data = [None] * limit
self.head = -1
self.tail = -1
#Implementation of enqueue function
def enqueue(self, val):
#check self.head - self.tail is equal to 1
if self.head - self.tail == 1:
raise NotImplementedError
#check len(self.data) - 1 is equal to elf.tail
if len(self.data) - 1 == self.tail and self.head == 0:
raise NotImplementedError
#check self.head is equal to -1
if self.head == -1 and self.tail == -1:
self.data[0] = val
self.head = 0
self.tail = 0
else:
#check len(self.data) - 1 is equal to self.tail
if len(self.data) - 1 == self.tail and self.head != 0:
self.tail = -1
self.data[self.tail + 1] = val
#increment the self.tail value
self.tail = self.tail + 1
#Implementation of dequeue method
def dequeue(self):
#check self.head is equal to self.tail
if self.head == self.tail:
temp = self.head
self.head = -1
self.tail = -1
return self.data[temp]
#check self.head is equal to -1
if self.head == -1 and self.tail == -1:
#raise NotImplementedError
raise NotImplementedError
#check self.head is not equal to len(self.data)
if self.head != len(self.data):
result = self.data[self.head]
self.data[self.head] = None
self.head = self.head + 1
else:
# resetting head value
self.head = 0
result = self.data[self.head]
self.data[self.head] = None
self.head = self.head + 1
return result
#Implementation of resize method
def resize(self, newsize):
#check len(self.data) is less than newsize
assert (len(self.data) < newsize)
newdata = [None] * newsize
head = self.head
current = self.data[head]
countValue = 0
#Iterate the loop
while current != None:
newdata[countValue] = current
countValue += 1
#check countValue is not equal to 0
if countValue != 0 and head == self.tail:
break
#check head is not equal to
#len(self.data) - 1
if head != len(self.data) - 1:
head = head + 1
current = self.data[head]
else:
head = 0
current = self.data[head]
self.data = newdata
self.head = 0
self.tail = countValue - 1
#Implementation of empty method
def empty(self):
#check self.head is equal to -1
# and self.tail is equal to -1
if self.head == -1 and self.tail == -1:
return True
return False
#Implementation of _bool_() method
def _bool_(self):
return not self.empty()
#Implementation of _str_() method
def _str_(self):
if not (self):
return ''
return ', '.join(str(x) for x in self)
#Implementation of _repr_ method
def _repr_(self):
return str(self)
#Implementation of _iter_ method
def _iter_(self):
head = self.head
current = self.data[head]
countValue = 0
#Iterate the loop
while current != None:
yield current
countValue += 1
#check countValue is not equal to zero
#check head is equal to self.tail
if countValue != 0 and head == self.tail:
break
#check head is not equal to len(self.data) - 1
if head != len(self.data) - 1:
head = head + 1
current = self.data[head]
else:
head = 0
current = self.data[head
Explanation:-
Output:
Create a multimedia project that contains the text element and all the contents that you have studied about that element
Answer:
no sé jejejejeje
lslsl
lonsinet
ko
_________ are standard devices, such as switches and routers, that have small onboard computers to monitor traffic flows through the device as well as the status of the device and other devices connected to it
Answer:
Managed devices
Explanation:
hope it helps u
A test for logical access at an organization being audited would include: Group of answer choices Checking that the company has a UPS and a generator to protect against power outages Making sure there are no unmanaged third-party service level agreements Performing a walkthrough of the disaster recovery plan Testing that super user (SYSADMIN) access is limited to only appropriate personnel
Answer:
Testing that super user (SYSADMIN) access is limited to only appropriate personnel.
Explanation:
A test for logical access at an organization being audited would include testing that super user (SYSADMIN) access is limited to only appropriate personnel.
Type the correct answer in the box. Spell all words correctly.
As a project team member, Mike needs to create a requirements document. What is one of the most important aspects Mike should take care of while creating a requirements document?
Maintaining ( blank)
is one of the most important aspects of creating a requirements document.
Answer:
Gantt charts
Explanation:
Gantt charts control all aspects of your project plan from scheduling to assigning tasks and even monitoring progress. A Gantt chart shows your tasks across a timeline and puts them in phases for better organization.
Clarissa needs to modify a runtime environment variable that will be set for all users on the system for both new logins as well as new instances of the BASH shell being launched. Which of the following files should she modify?
a. /root/.profile
b. /etc/profile
c. /root/.bashrc
d. /etc/bashrc
Clarissa should modify the file /root/.profile.
Runtime environment variables
The Runtime environment variables are defined as the key pairs that are deployed along the function. The variables are mainly scoped to a function in the project.Therefore, in the context, Clarissa wishes to modify the run time environment variable which can be used for all the new logins and also for the new instances for the BASH shell. So for this, Clarissa should modify the /root/.profile file command.
Learn More :
https://brainly.in/question/10061342
Following are the description of the wrong choice:
In option b and option d, both are wrong because it's file directory.In option c, it is a software file directory which install in the main disk, that's why it is wrong.Therefore, the "/root/.profile" file should be changed by Clarissa.
Learn More :
https://brainly.in/question/6708999
a. Download the attached �Greetings.java� file.
b. Implement the �getGreetings� method, so that the code prompts the user to enter the first name, the last name, and year of birth, then it returns a greetings message in proper format (see the example below). The �main� method will then print it out. Here is an example dialogue with the user:
Please enter your first name: tom
Please enter your last name: cruise
Please enter your year of birth: 1962
Greetings, T. Cruise! You are about 50 years old.
Note that the greetings message need to be in the exact format as shown above (for example, use the initial of the first name and the first letter of the last name with capitalization).
c. Submit the final �Greetings.java� file (DO NOT change the file name) online.
Answer:
Code:
import java.util.*;
public class Greetings
{
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
System.out.println(getGreetings(s));
}
private static String getGreetings(Scanner console)
{
System.out.print("Please enter your first name: ");
String firstName=console.next();
char firstChar=firstName.toUpperCase().charAt(0);
System.out.print("Please enter your last name: ");
String lastName=console.next();
lastName=lastName.toUpperCase().charAt(0)+lastName.substring(1, lastName.length());
System.out.print("Please enter your year of birth: ");
int year=console.nextInt();
int age=getCurrentYear()-year;
return "Greetings, "+firstChar+". "+lastName+"! You are about "+age+" years old.";
}
private static int getCurrentYear()
{
return Calendar.getInstance().get(Calendar.YEAR);
}
}
Output:-
Create a python program that display this
Factorial Calculator
Enter a positive integer: 5
5! = 1 x 2 x 3 x 4 x 5
The factorial of 5 is: 120
Enter a positive integer: 4
4! = 1 x 2 x 5 x 4
.
The factorial of 4 is: 24
Enter a positive integer: -5
Invalid input! Program stopped!
Answer:
vxxgxfufjdfhgffghgfghgffh
2. A computer that is easy to operate is called
I
10 POINTSSSS PLEASEEE HELPPP
DIT QUESTION
Answer:
Explanation:
A computer that is easy to operate is called User Friendly
what is computer with figure
Answer:
A computer is an electronic device that accept raw data and instructions and process it to give meaningful results.
Give one example of where augmented reality is used
Answer
Medical Training
From operating MRI equipment to performing complex surgeries, AR tech holds the potential to boost the depth and effectiveness of medical training in many areas. Students at the Cleveland Clinic at Case Western Reserve University, for example, will now learn anatomy utilizing an AR headset allowing them to delve into the human body in an interactive 3D format.
it is also use in retail ,. Repair & Maintenance,Design & Modeling,Business Logistics etc
Discuss the OSI Layer protocols application in Mobile Computing
Answer:
The OSI Model (Open Systems Interconnection Model) is a conceptual framework used to describe the functions of a networking system. The OSI model characterizes computing functions into a universal set of rules and requirements in order to support interoperability between different products and software.
a computer works on input processing output device
true
false
a computer works on input processing output device true
Answer:
a computer works on input processing output device. True
Explanation:
God bless you.
Sites like Zillow get input about house prices from a database and provide nice summaries for readers. Write a program with two inputs, current price and last month's price (both integers). Then, output a summary listing the price, the change since last month, and the estimated monthly mortgage computed as (current_price * 0.051) / 12. Output each floating-point value with two digits after the decimal point, which can be achieved as follows: print('{:.2f}'.format(your_value))
Answer:
The program in Python is as follows:
current_price = int(input("Current Price: "))
last_price = int(input("Last Month Price: "))
change = current_price - last_price
mortgage = (current_price * 0.051) / 12
print('Change: {:.2f} '.format(change))
print('Mortgage: {:.2f}'.format(mortgage))
Explanation:
This gets input for current price
current_price = int(input("Current Price: "))
This gets input for last month price
last_price = int(input("Last Month Price: "))
This calculates the price change
change = current_price - last_price
This calculates the mortgage
mortgage = (current_price * 0.051) / 12
This prints the calculated change
print('Change: {:.2f} '.format(change))
This prints the calculated monthly mortgage
print('Mortgage: {:.2f}'.format(mortgage))
Answer:
current_price = int(input())
last_months_price = int(input())
change = current_price - last_months_price
mortgage = current_price * 0.051 / 12
print('This house is $', end= '')
print(current_price, end= '. ')
print('The change is $', end= '')
print(change, end= ' ')
print('since last month.')
print('The estimated monthly mortgage is $', end= '')
print(mortgage, end='0.\n')
Create a function, return type: char parameters: int *, int * Inside the function, ask for two integers. Set the user responses to the int * parameters. Prompt the user for a character. Get their response as a single character and return that from the function. In main Define three variables and call your function. Print values of your variables
Answer and Explanation:
In C programming language:
char fun(int*a, int*b){
printf("enter two integers: ");
scanf("%d%d",a,b);
int e;
printf("please enter a character: ");
e=getchar();
return e;
}
int main(int argc, char *argv[]) {
int d;
int f;
int g;
fun();
printf("%d%d%d", d, f, g);
}
We have declared a function fun type char above and called it in main. Note how he use the getchar function in c which reads the next available character(after the user inputs with printf()) and returns it as an integer. We then return the variable e holding the integer value as char fun() return value.
Which of the following BEST describes an inside attacker?
An agent who uses their technical knowledge to bypass security.
An attacker with lots of resources and money at their disposal.
A good guy who tries to help a company see their vulnerabilities.
An unintentional threat actor. This is the most common threat.
The inside attacker should be a non-intentional threat actor that represents the most common threat.
The following information related to the inside attacker is:
It is introduced by the internal user that have authorization for using the system i.e. attacked.It could be intentional or an accidental.So it can be non-intentional threat.Therefore we can conclude that The inside attacker should be a non-intentional threat actor that represents the most common threat.
Learn more about the threat here: brainly.com/question/3275422
The menu bar display information about your connection process, notifies you when you connect to another website, and identifies the percentage information transferred from the Website server to your browser true or false
Answer:
false
Explanation:
My teacher quized me on this
the base on which the number n=(34)? is written if it has a value of n= (22)10
If I'm understanding the question correctly, you are looking for an integer b (b ≠ 0, b ≠ 1) such that
[tex]34_b = 22_{10}[/tex]
In other words, you're solving for b such that
3×b ¹ + 4×b ⁰ = 22
or
3b + 4 = 22
Solving this is trivial:
3b + 4 = 22
3b = 18
b = 6
So we have
34₆ = 22₁₀
Which of the following is not a computer application?
a. Internet Explorer
b. Paint
c. Apple OSX
d. Microsoft Word
Apple OSX is not a computer application.
The information regarding the computer application is as follows:
The program of the computer application should give the skills that are required for usage of the application software on the computer.An application like word processing, internet, etc.Also, the computer application includes internet explorer, paint, and Microsoft word.Therefore we can conclude that Apple OSX is not a computer application.
Learn more about the computer here: brainly.com/question/24504878
Discuss the DMA process
Answer:
Direct memory access (DMA) is a process that allows an input/output (I/O) device to send or receive data directly to or from the main memory, bypassing the CPU to speed up memory operations and this process is managed by a chip known as a DMA controller (DMAC).
Explanation:
A defined portion of memory is used to send data directly from a peripheral to the motherboard without involving the microprocessor, so that the process does not interfere with overall computer operation.
In older computers, four DMA channels were numbered 0, 1, 2 and 3. When the 16-bit industry standard architecture (ISA) expansion bus was introduced, channels 5, 6 and 7 were added.
ISA was a computer bus standard for IBM-compatible computers, allowing a device to initiate transactions (bus mastering) at a quicker speed. The ISA DMA controller has 8 DMA channels, each one of which associated with a 16-bit address and count registers.
ISA has since been replaced by accelerated graphics port (AGP) and peripheral component interconnect (PCI) expansion cards, which are much faster. Each DMA transfers approximately 2 MB of data per second.
A computer's system resource tools are used for communication between hardware and software. The four types of system resources are:
I/O addresses Memory addresses. Interrupt request numbers (IRQ). Direct memory access (DMA) channels.DMA channels are used to communicate data between the peripheral device and the system memory. All four system resources rely on certain lines on a bus. Some lines on the bus are used for IRQs, some for addresses (the I/O addresses and the memory address) and some for DMA channels.
A DMA channel enables a device to transfer data without exposing the CPU to a work overload. Without the DMA channels, the CPU copies every piece of data using a peripheral bus from the I/O device. Using a peripheral bus occupies the CPU during the read/write process and does not allow other work to be performed until the operation is completed.
With DMA, the CPU can process other tasks while data transfer is being performed. The transfer of data is first initiated by the CPU. The data block can be transferred to and from memory by the DMAC in three ways.
In burst mode, the system bus is released only after the data transfer is completed. In cycle stealing mode, during the transfer of data between the DMA channel and I/O device, the system bus is relinquished for a few clock cycles so that the CPU can perform other tasks. When the data transfer is complete, the CPU receives an interrupt request from the DMA controller. In transparent mode, the DMAC can take charge of the system bus only when it is not required by the processor.
However, using a DMA controller might cause cache coherency problems. The data stored in RAM accessed by the DMA controller may not be updated with the correct cache data if the CPU is using external memory.
Solutions include flushing cache lines before starting outgoing DMA transfers, or performing a cache invalidation on incoming DMA transfers when external writes are signaled to the cache controller.
Answer:
See explanation
Explanation:
DMA [tex]\to[/tex] Direct Memory Access.
The peripherals of a computer system are always in need to communicate with the main memory; it is the duty of the DMA to allow these peripherals to transfer data to and from the memory.
The first step is that the processor starts the DMA controller, then the peripheral is prepared to send or receive the data; lastly, the DMA sends signal when the peripheral is ready to carry out its operation.
g A catch block that expects an integer argument will catch Group of answer choices all exceptions all integer exceptions any exception value that can be coerced into an integer C
Answer:
Hence the correct option is 2nd option. all integer exceptions.
Explanation:
A catch block that expects an integer argument will catch all integer exceptions.
The Cartesian product of two lists of numbers A and B is defined to be the set of all points (a,b) where a belongs in A and b belongs in B. It is usually denoted as A x B, and is called the Cartesian product since it originated in Descartes' formulation of analytic geometry.
a. True
b. False
The properties and origin of the Cartesian product as stated in the paragraph
is true, and the correct option is option;
a. True
The reason why the above option is correct is stated as follows;
In set theory, the Cartesian product of two number sets such as set A and set
B which can be denoted as lists of numbers is represented as A×B and is the
set of all ordered pair or points (a, b), with a being located in A and b located
in the set B, which can be expressed as follows;
[tex]\left[\begin{array}{c}A&x&y\\z\end{array}\right] \left[\begin{array}{ccc}B(1&2&3)\\\mathbf{(x, 1)&\mathbf{(x, 2)}&\mathbf{(x, 3)}\\\mathbf{(y, 1)}&\mathbf{(y, 2)}&\mathbf{(y, 3)}\\\mathbf{(z, 1)}&\mathbf{(z, 2)}&\mathbf{(z, 3)}\end{array}\right]}[/tex]
The name Cartesian product is derived from the name of the philosopher,
scientist and mathematician Rene Descartes due to the concept being
originated from his analytical geometry formulations
Therefore, the statement is true
Learn more about cartesian product here:
https://brainly.com/question/13266753
Which is the most correct option regarding subnet masks?
Answer:
thanks for your question
Identify the class of the address, the number of octets in the network part of the address, the number of octets in the host part of the address, the network number, and the network broadcast address g
Answer:
1.
190.190.190.190
Class B
Number of octets in the network part of the address: 2
Number of octets in the host part of the address: 2
Network number: 190.190.0.0/16
Network broadcast address: 190.190.255.255
2.
200.1.1.1
Class C
Number of octets in the network part of the address: 3
Number of octets in the host part of the address: 1
Network number: 200.1.1.0/24
Network broadcast address: 200.1.1.255
Explanation:
Write a Racket two-way selection structure that will produce a list '(1 2 3) when the first element of a list named a_lst is identical to the atom 'a and an empty list otherwise. Note that you are NOT required to write a function definition!
Answer:
A
Explanation:
Write a program that takes a date as input and outputs the date's season. The input is an integer to represent the month and an integer to represent the day. Ex: If the input is: 4 11 the output is: spring In addition, check if both integers are valid (an actual month and day). Ex: If the input is: 14 65 the output is: invalid The dates for each season are: spring: March 20 - June 20 summer: June 21 - September 21 autumn: September 22 - December 20 winter: December 21 - March 19
Answer:
Explanation:
The following program is written in Java. It is a function that takes in the two parameters, combines them as a String, turns the combined String back into an integer, and uses a series of IF statements to check the parameters and determine which season it belongs to. Then it prints the season to the screen. The code has been tested with the example provided in the question and the output can be seen in the attached image below.
class Brainly {
public static void main(String[] args) {
getSeason(4, 65);
getSeason(4, 11);
}
public static void getSeason(int month, int day) {
String combined = String.valueOf(month) + String.valueOf(day);
int combinedInt = Integer.parseInt(combined);
if ((month > 0 && month < 12) && (day > 0 && day < 31)) {
if ((combinedInt >= 320) && (combinedInt <= 620)) {
System.out.println("The Season is Spring");
} else if ((combinedInt >= 621) && (combinedInt <= 921)) {
System.out.println("The Season is Summer");
} else if ((combinedInt >= 922) && (combinedInt <= 1220)) {
System.out.println("The season is Autumn");
} else {
System.out.println("The Season is Winter");
}
} else {
System.out.println("Invalid date");
}
}
}
What will be the pseudo code for this
Answer:
Now, it has been a while since I have written any sort of pseudocode. So please take this answer with a grain of salt. Essentially pseudocode is a methodology used by programmers to represent the implementation of an algorithm.
create a variable(userInput) that stores the input value.
create a variable(celsius) that takes userInput and applies the Fahrenheit to Celsius formula to it
Fahrenheit to Celsius algorithm is (userInput - 32) * (5/9)
Actual python code:
def main():
userInput = int(input("Fahrenheit to Celsius: "))
celsius = (userInput - 32) * (5/9)
print(str(celsius))
main()
Explanation:
I hope this helped :) If it didn't tell me what went wrong so I can make sure not to make that mistake again on any question.
you get a call from a customer who says she can't access your site with her username and password. both are case-sensitive and you have verified she is entering what she remembers to be her user and password correctly. what should you do to resolve this problem?
a. have the customer clear her browser history and retry
b. look up her username and password, and inform her of the correct information over the phone
c. have the user reboot her system and attempt to enter her password again
d. reset the password and have her check her email account to verify she has the information
Answer:
answer would be D. I do customer service and would never give information over the phone always give a solution
In order to resolve this problem correctly, you should: D. reset the password and have her check her email account to verify she has the information.
Cybersecurity can be defined as a group of preventive practice that are adopted for the protection of computers, software applications (programs), servers, networks, and data from unauthorized access, attack, potential theft, or damage, through the use of the following;
Processes.A body of technology.Policies.Network engineers.Frameworks.For web assistance, the security standard and policy which must be adopted to enhance data integrity, secure (protect) data and mitigate any unauthorized access or usage of a user's sensitive information such as username and password, by a hacker, is to ensure the information is shared discreetly with the user but not over the phone (call).
In this context, the most appropriate thing to do would be resetting the password and have the customer check her email account to verify she has the information.
Read more: https://brainly.com/question/24112967
Calculator is an example of
computer
A. analogue
B. hybrid
C. manual
D. digital
E. public
D. digital
Explanation:
I hope it helps you
We canconnect two or more computer together using cables true or false
This is true for most modern computers
As the first step, load the dataset from airline-safety.csv by defining the load_data function below. Have this function return the following (in order):
1. The entire data frame
2. Total number of rows
3. Total number of columns
def load_data():
# YOUR CODE HERE
df, num_rows, num_cols
Answer:
import pandas as pd
def load_data():
df = pd.read_csv("airline-safety.csv')
num_rows = df.shape[0]
num_cols = df.shape[1]
return df, num_rows, num_cols
Explanation:
Using the pandas python package.
We import the package using the import keyword as pd and we call the pandas methods using the dot(.) notation
pd.read_csv reads the csv data into df variable.
To access the shape of the data which is returned as an array in the format[number of rows, number of columns]
That is ; a data frame with a shape value of [10, 10] has 10 rows and 10 columns.
To access the value of arrays we use square brackets. With values starting with an index of 0 and so on.
The row value is assigned to the variable num_rows and column value assigned to num_cols