Answer:
The program written in Java is as follows
import java.util.Scanner;
public class mutilate {
public static void main(String [] args) {
Scanner input = new Scanner(System.in);
int n;
System.out.print("Array Length: ");
n = input.nextInt();
while(n<1 || n > 103) {
System.out.print("Array Length: ");
n = input.nextInt();
}
int a []= new int [n];
int b []= new int [n];
System.out.print("Enter Elements of the Array: ");
for(int i =0;i<n;i++) {
a[i] = input.nextInt();
}
System.out.print("Output: ");
for(int i =0;i<n;i++) {
if(i == 0) {
b[i] = 0+a[i]+a[i+1];
}
else if(i == n-1) {
b[i] = a[i - 1]+a[i]+0;
}
else {
b[i] = a[i - 1]+a[i]+a[i+1];
}
System.out.print(b[i]+" ");
}
}
}
Explanation:
This line allows the program accepts user input
Scanner input = new Scanner(System.in);
This line declares integer n
int n;
The next two line prompts user for length of the array and also accepts input
System.out.print("Array Length: ");
n = input.nextInt();
The following while iteration ensures that the user input is between 1 and 103
while(n<1 || n > 103) {
System.out.print("Array Length: ");
n = input.nextInt();
}
The next two lines declares array a and b
int a []= new int [n];
int b []= new int [n];
The next for iteration allows user enter values for array a
System.out.print("Enter Elements of the Array: ");
for(int i =0;i<n;i++) {
a[i] = input.nextInt();
}
The next for iteration calculates and prints the values for array b based on the instruction in the question
System.out.print("Output: ");
for(int i =0;i<n;i++) {
if(i == 0) {
b[i] = 0+a[i]+a[i+1];
}
else if(i == n-1) {
b[i] = a[i - 1]+a[i]+0;
}
else {
b[i] = a[i - 1]+a[i]+a[i+1];
}
System.out.print(b[i]+" ");
}
I have an PC and it has one HMDI port but I need two monitors other problem is I need one monitor to connect to my USB drive work system and one to stay on my regular windows system how can I do this?
Answer:
You'll need dual monitor cables and an adapter.
Explanation:
First Step
Position your monitors on your desk or workspace. Make sure the systems are off.
Second Step
Make sure your power strip is close by. Then plug your power strip and connect the first monitor to your PC via your HDMI
Use an adapter to do the same for the second monitor.
Turn the entire system on
Third Step
On your PC, right click on a blank place in your home screen and click on Display Settings.
If you want to have two separate displays showing the same thing, select Duplicate, but if you want to have the two displays independent of each other, select Extend Display.
Apply the settings and select Done.
a) Code a statement that creates an instance of an Account class using the default constructor and stores the object that’s created in a variable named account.
b) Code a statement that creates an instance of the Account class using a constructor that has two parameters named firstName and age, and store the object in a variable named account. Assume that variables with those names have already been declared and initialized so you can pass those variables to the constructor.
c) Code a statement that sets the value of the Age property of an Account object named account to the value in a variable named newAge.
d) Code a statement that will get the value of a public static field named Count that’s defined in the Account class, and store the value in a new int variable named count. Assume that you’ve already created an object from this class that’s named account.
Answer:
a)
Account account = new Account();
b)
Account account = new Account(firstName, age);
c)
account.Age = newAge;
d)
int count = Account.Count;
Explanation:
a)
new is the keyword which is used to create an object.
Account is the class name.
account is the name of an object of class Account.
account object is created to access the class Account.
Account() is the constructor of Account class. This is the default constructor and it has no parameters. Constructor has the same name as class. When a account object is created, constructor Account will be invoked.
b)
Account is the class name.
account is the name of an object of class Account.
Account() is the constructor of Account class. This is the parameterized constructor and it has two parameters i.e. firstName and age. Constructor has the same name as class. When a account object is created, constructor Account will be invoked.
c)
account.Age = newAge;
Here account is the object name. The Age property to access and update the private field of the Account class is set to the variable named newAge.
d)
This int count = Account.Count; statement gets the value of a public static field named Count that’s defined in the Account class, and stores the value in a new int variable named count.
Diverting an attacker from accessing critical systems, collecting information about the attacker's activity and encouraging the attacker to stay on the system long enough for administrators to respond. These are all benefits of what network appliance?
Answer:
Honeypot is the correct answerExplanation:
A computer system that is meant to mimic the likely targets of cyber attacks is called honeypot. It is used to deflect the attackers from a legitimate target and detect attacks. It also helps to gain info about how the cyber criminals operate. They have been around for decades, it works on the philosophy that instead of searching for attackers, prepare something that would attract them. It is just like cheese-baited mousetraps. Cyber criminals get attracted towards honeypots by thinking that they are legitimate targets.
Most keyboards today are arranged in a(n) _______ layout.
Answer:
QWERTY
Explanation:
The QWERTY keyboard arrangement was invented back when typewriters were used, and they needed a keyboard layout that wouldn't jam the letters.
Today, QWERTY is the most commonly used keyboard layout.
Hope this helped!
А.
is the highest education degree available at a community college.
Answer:
The answer is "associate".
Explanation:
The two-year post-school degree is also known as the associate degree, in which the students pursuing any of this degree, which may take as little as 2 years to complete the course, although many prefer to do it at the same rate. Its first two years of a Bachelor (fresh and sophomore years) were covered by an Associate degree.
Which type of user profile is stored in the C:\Users folder and is automatically created when a user logs on to the computer for the first time?
Answer:
a. Local user profile.
Explanation:
Local user profile is a type of user profile which is stored in the C:\Users folder and is automatically created when a user logs on to the computer for the first time and it is being stored on the local hard disk of the computer.
Generally, in Microsoft windows any change made to the local user profile is peculiar to the user and the host computer on which the change is made.
Hence, local user profiles avails several users the opportunity of sharing a single computer with their respective user settings and data.
If a schema is not given, you may assume a table structure that makes sense in the context of the question. (using sql queries)
Find all Employee records containing the word "Joe", regardless of whether it was stored as JOE, Joe, or joe.
Answer:
The correct query is;
select * from EMPLOYEE where Employee_Name = 'JOE' or Employee_Name = 'Joe' or Employee_Name = 'joe';
where EMPLOYEE refer to the table name and type attribute name is Employee_Name
Explanation:
Here, the first thing we will do is to assume the name of the table.
Let’s assume the table name is EMPLOYEE, where the column i.e attribute from which we will be extracting our information is Employee_Name
The correct query to get the piece of information we are looking for will be;
select * from EMPLOYEE where Employee_Name = 'JOE' or Employee_Name = 'Joe' or Employee_Name = 'joe';
10.7 LAB: Fat-burning heart rate Write a program that calculates an adult's fat-burning heart rate, which is 70% of 220 minus the person's age. Complete fat_burning_heart_rate() to
Answer:
I've written in python
Explanation:
age = int(input("Enter the person's age: ")
def fat_burning_heart_rate(x):
rate =( 70/100 * 220 ) - age
print(fat_burning_heart_rate(age))
You are the network administrator for your company. A user reports that he cannot access network resources from his computer. He was able to access the resources yesterday. While troubleshooting his computer, you find that his computer is issued an Automatic Private IP Addressing (APIPA) address. All the network equipment in the user's computer is functioning properly because you are able to access the user's computer from a remote computer. What is most likely the problem
Answer:
the issued Automatic Private IP Addressing (APIPA) address.
Explanation:
Since we are told that the user was able to access the network resources yesterday, and all the network equipment in the user's computer is functioning properly, there is a very high possibility that because the user's computer has been issued an Automatic Private IP Addressing (APIPA) address, it affected his computer's ability to connect to a public network.
This is the case because private network IP addresses are known to prevent inflow and outflow of data onto public networks.
You are asked to write an app to keep track of a relatively small music library. The app should load song information from a data file once the app is started. It should allow user to view, add, remove, and search for songs. The app should save the data back to the same data file when the program exits.
Answer:
C++ PROGRAM
Explanation:
Declare a class named PatientData that contains two attributes named height_inches and weight_pounds. Sample output for the given program with inputs: 63 115 Patient data (before): 0 in, 0 lbs Patient data (after): 63 in, 115 lbs 1 Your solution goes here ' 2 1 test passed 4 patient PatientData () 5 print('Patient data (before):, end-' ') 6 print(patient.height_inches, 'in,, end=' ') 7 print(patient.weight_pounds, lbs') All tests passed 9 10 patient.height_inches = int(input()) 11 patient.weight_pounds = int(input()) 12 13 print('Patient data (after):', end-' ') 14 print (patient. height_inches, 'in,', end- ') 15 print(patient.weight_pounds, 'lbs') Run
Answer:
class PatientData(): #declaration of PatientData class
height_inches=0 #attribute of class is declared and initialized to 0
weight_pounds=0 #attribute of class is declared and initialized to 0
Explanation:
Here is the complete program:
#below is the class PatientData() that has two attributes height_inches and weight_pounds and both are initialized to 0
class PatientData():
height_inches=0
weight_pounds=0
patient = PatientData() #patient object is created of class PatientData
#below are the print statements that will be displayed on output screen to show that patient data before
print('Patient data (before):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
#below print statement for taking the values height_inches and weight_pounds as input from user
patient.height_inches = int(input())
patient.weight_pounds = int(input())
#below are the print statements that will be displayed on output screen to show that patient data after with the values of height_inches and weight_pounds input by the user
print('Patient data (after):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
Another way to write the solution is:
def __init__(self):
self.height_inches = 0
self.weight_pounds = 0
self keyword is the keyword which is used to easily access all the attributes i.e. height_inches and weight_pounds defined within a PatientData class.
__init__ is a constructor which is called when an instance is created from the PatientData, and access is required to initialize the attributes height_inches and weight_pounds of PatientData class.
The program along with its output is attached.
In this exercise we have to use the knowledge of computational language in python to describe a code, like this:
The code can be found in the attached image.
To make it easier the code can be found below as:
class PatientData():
height_inches=0
weight_pounds=0
patient = PatientData()
print('Patient data (before):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
patient.height_inches = int(input())
patient.weight_pounds = int(input())
print('Patient data (after):', end=' ')
print(patient.height_inches, 'in,', end=' ')
print(patient.weight_pounds, 'lbs')
See more about python at brainly.com/question/26104476
which approach does procedural programming follow? bottom up, top down, random, or object oriented
Answer:
Top to down approach
Explanation:
Although Python provides us with many list methods, it is good practice and very instructive to think about how they are implemented. Implement a Python methods that works like the following: a. count b. in: return True if the item is in the list c. reverse d. index: return -1 if the item is not in the list e. insert
Answer:
Here are the methods:
a) count
def count(object, list):
counter = 0
for i in list:
if i == object:
counter = counter + 1
return counter
b) in : return True if the item is in the list
def include(object, list):
for i in list:
if i == object:
return True
return False
c) reverse
def reverse(list):
first = 0
last = len(list)-1
while first<last:
list[first] , list[last] = list[last] , list[first]
first = first + 1
last = last - 1
return list
d) index: return -1 if the item is not in the list
def index(object, list):
for x in range(len(list)):
if list[x] == object:
return x
return -1
e) insert
def insert(object, index, list):
return list[:index] + [object] + list[index:]
Explanation:
a)
The method count takes object and a list as parameters and returns the number of times that object appears in the list.
counter variable is used to count the number of times object appears in list.
Suppose
list = [1,1,2,1,3,4,4,5,6]
object = 1
The for loop i.e. for i in list iterates through each item in the list
if condition if i == object inside for loop checks if the item of list at i-th position is equal to the object. So for the above example, this condition checks if 1 is present in the list. If this condition evaluates to true then the value of counter is incremented to 1 otherwise the loop keeps iterating through the list searching for the occurrence of object (1) in the list.
After the complete list is moved through, the return counter statement returns the number of times object (i.e. 1 in the example) occurred in the list ( i.e. [1,1,2,1,3,4,4,5,6] ) As 1 appears thrice in the list so the output is 3.
b)
The method include takes two parameters i.e. object and list as parameters and returns True if the object is present in the list otherwise returns False. Here i have not named the function as in because in is a reserved keyword in Python so i used include as method name.
For example if list = [1,2,3,4] and object = 3
for loop for i in list iterates through each item of the list and the if condition if i == object checks if the item at i-th position of the list is equal to the specified object. This means for the above example the loop iterates through each number in the list and checks if the number at i-th position in the list is equal to 3 (object). When this if condition evaluates to true, the method returns True as output otherwise returns False in output ( if 3 is not found in the list). As object 3 is present in the list so the output is True.
c) reverse method takes a list as parameter and returns the list in reverse order.
Suppose list = [1,2,3,4,5,6]
The function has two variables i.e. first that is the first item of the list and last which is the last item of the list. Value of first is initialized to 0 and value of last is initialized to len(list)-1 where len(list) = 6 and 6-1=5 so last=5 for the above example. These are basically used as index variables to point to the first and last items of list.
The while loop executes until the value of first exceeds that of last.
Inside the while loop the statement list[first] , list[last] = list[last] , list[first] interchanges the values of elements of the list which are positioned at first and last. After each interchange the first is incremented to 1 and last is decremented to 1.
For example at first iteration:
first = 0
last = 5
list[0] , list[5] = list[5] , list[0]
This means in the list [1,2,3,4,5,6] The first element 1 is interchanged with last element 6. Then the value of first is incremented and first = 1, last = 4 to point at the elements 2 and 5 of the list and then exchanges them too.
This process goes on until while condition evaluates to false. When the loop breaks statement return list returns the reversed list.
d) The method index takes object and list as parameters and returns the index of the object/item if it is found in the list otherwise returns -1
For example list = [1,2,4,5,6] and object = 3
for loop i.e. for x in range(len(list)): moves through each item of the list until the end of the list is reached. if statement if list[x] == object: checks if the x-th index of the list is equal to the object. If it is true returns the index position of the list where the object is found otherwise returns -1. For the above examples 3 is not in the list so the output is -1
e) insert
The insert function takes as argument the object to be inserted, the index where the object is to be inserted and the list in which the object is to be inserted.
For example list = [0, 1, 2, 4, 5, 6] and object = 3 and index = 3
3 is to be inserted in list [1,2,4,5] at index position 3 of the list. The statement:
return list[:index] + [object] + list[index:]
list[:index] is a sub list that contains items from start to the index position. For above example:
list[:index] = [0, 1, 2]
list[index:] is a sub list that contains items from index position to end of the list.
list[index:] = [4, 5, 6]
[object] = [3]
So above statement becomes:
[0, 1, 2] + [3] + [4, 5, 6]
So the output is:
[0, 1, 2, 3, 4, 5, 6]
Consider two different implementations of the same instruction set architecture (ISA). The instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate of 2.5 GHz have CPIs of 1, 2, 3, and 3 for each class, respectively. P2 with a clock rate of 3 GHz and CPIs of 2, 2, 2, and 2 for each class, respectively. Given a program with a dynamic instruction count of 1,000,000 instructions divided into classes as follows: 10% class A, 20% class B, 50% class C, and 20% class D.which implementation is faster?
a. What is the global CPI for each implementation?
b. Find the clock cycles required in both cases.
Answer: Find answers in the attachments
Explanation:
Universal Containers will be using multiple environments to manage the development, testing, and deployment of new functionality to sales users. Which deployment tool can be used to migrate metadata across Salesforce environments
Answer:
1. Force.com IDE
2. change sets
Explanation:
1. Force.com IDE is an integrated development environment. It is useful for creating applications on the force.com using metadata. it uses text based files to constitute the different parts of Salesforce.
2. change sets:
these can send configuration from one between different Salesforce organizations. It migrates changes in metadata between different organizations.
A device driver would ordinarily be written in :__________
a. machine language
b. assembly language
c. a platform-independent language, such as Java
d. an application-oriented language
Answer: Assembly language
Explanation:
A device driver is a computer program that is in charge of the operation or the controls of a device attached to a computer.
device driver would ordinarily be written in an assembly language. Assembly language is a low-level symbolic code that is converted by an assembler. It is typically designed for a particular type of processor.
PROGRAM 8: Grade Converter! For this program, I would like you to create a function which returns a character value based on a floating point value as
Answer:
This function will return a character grade for every floating-point grade for every student in the class.
function grade( floatPoint ){
let text;
switch ( floatPoint ) {
case floatPoint < 40.0 :
text= " F ";
break;
case floatPoint == 40.0 :
text= " P ";
break;
case floatPoint > 40.0 && floatPoint <= 50.0 :
text= " C ";
break;
case floatPoint > 50.0 && floatPoint < 70.0 :
text= " B ";
break;
case floatPoint >=70.0 && floatPoint <= 100.0 :
text= " C ";
break;
default :
text= "Floating point must be between 0.0 to 100.0"
}
return text;
}
Explanation:
This javascript function would return a character grade for floating-point numbers within the range of 0.0 to 100.0.
Gwen is starting a blog about vegetable gardening. What information should she include on the blog's home page
Answer:
The correct answer is "List of posts with the most recent ones at the top".
Explanation:
A website that includes someone else's thoughts, insights, views, etc. about a writer or community of authors and that also has photographs as well as searching the web.It indicates that perhaps the blog should distinguish between different articles about the site because then customers who frequent the site will observe and experience the articles on everyone's blogs.So that the above would be the appropriate one.
If you implement too many security controls, what portion of the CIA triad (Information Assurance Pyramid) may suffer?
a. Availability
b. Confidentiality
c. Integrity
d. All of the above
Answer:
Option A
Availability
Explanation:
The implementation of too many security protocols will lead to a reduction of the ease at which a piece of information is accessible. Accessing the piece of information will become hard even for legitimate users.
The security protocols used should not be few, however, they should be just adequate to maintain the necessary level of confidentiality and integrity that the piece of information should have, While ensuring that the legitimate users can still access it without much difficulty.
Can Anyone put my name in binary code using these images? Bentley is my name
Answer:
10010100001001010100101101010100000000000000000010100101010101111010001001010010100101001
Explanation:
An employer plans to pay bonus to each of his employees. Those earning Rs. 2000 or above are to be paid 10 percent of their salary and those earning less than 2000 are to be paid Rs. 200. The input record contains employee number, name and salary of an employee. The output should be employee name and their bonus. Write pseudo code algorithm to process the requirement.
Answer:
vfg
Explanation:
Which of the following is true about sorting functions?
A. The most optimal partitioning policy for quicksort on an array we know nothing about would be selecting a random element in the array.
B. The fastest possible comparison sort has a worst case no better than O(n log n)
C. Heapsort is usually best when you need a stable sort.
D. Sorting an already sorted array of size n with quicksort takes O(n log n) time.
E. When sorting elements that are expensive to copy, it is generally best to use merge sort.
F. None of the above statements is true.
Answer: Option D -- Sorting an already sorted array of size n with quicksort takes O(n log n) time.
Explanation:
Sorting an already sorted array of size n with quicksort takes O(n log n) time is true about sorting functions while other options are wrong.
Select the function completion that satisfies this docstring description: def convert_to_string(nums): """ (list of number) -> NoneType Replace each item in nums with its string equivalent. >>> nums
Answer:
def convert_to_string(nums):
for i in range(len(nums)):
nums[i] = str(nums[i])
nums = [7, 28, 92]
print(nums)
convert_to_string(nums)
print(nums)
Explanation:
Create a function called convert_to_string that takes one parameter, nums
Create a for loop that iterates through the nums. Inside the loop, set each item to its string equivalent using type casting (str)
Initialize a list
Print the list before the function call
Call the function, passing the list as a parameter
Then, print the list again to see the difference
list 2 forms of computer output
Answer:
Soft copy like audio
Hard copy e.g printouts
Explanation:
I keep getting this error: postfix.cpp: In function ‘double RPN_evaluation(std::string)’: postfix.cpp:42:26: error: cannot convert ‘__gnu_cxx::__alloc_traits > >::value_type {aka std::basic_string }’ to ‘char’ for argument ‘1’ to ‘int isOperand(char)’ if(isOperand(expr.at(g))){ ^ postfix.cpp:96:1: warning: control reaches end of non-void function [-Wreturn-type] } I am not sure what I am doing wrong, help please
Answer:
expr.at(g) returns a string, not a char. They are not the same thing and that is what the compiler is complaining about.
As an ICT student teacher using convincing and cogent reasons explain why you think operating system is pivotal in teaching and learning
Answer:
An operating system (OS) is a software which is responsible for the management of computer hardware, software, and also provides common services for computer programs.
Operating System is pivotal in teaching and learning because:
1. It enables computer programs to run smoothly on various computer devices.
2. The Operating System gives teachers the opportunity to install learning apps on their devices for ease of teaching.
3. It enables students to download and install learning applications, download and upload assignments, etc.
4. The Operating System makes video conferencing for online tuition easy and smooth.
5. It makes computer users to interact with other applications and softwares within a device.
Operating systems are found on many computer devices e.g: mobile phones, video games, PCs, supercomputers, etc.
Assume the existence of a Phone class. Define a derived class, CameraPhone that contains two data members: an integer named, imageSize, representing the size in megabytes of each picture, and an integer named memorySize, representing the number of megabytes in the camera's memory. There is a constructor that accepts two integer parameters corresponding to the above two data members and which are used to initialize the respective data members. There is also a function named numPictures that returns (as an integer) the number of pictures the camera's memory can hold.
#include <iostream>
using namespace std;
class CameraPhone:Phone{
int imageSize,memorySize;
public:
CameraPhone(int image_size,int memory_size):imageSize(image_size),memorySize(memory_size){}
int numPictures(){
return memorySize-imageSize;
}
}
int main(){}
Here is the code for the derived class, CameraPhone:
class Phone:
def __init__(self, brand, model, price): self.brand = brand self.model = model self.price = priceclass CameraPhone(Phone):
def __init__(self, brand, model, price, imageSize, memorySize): super().__init__(brand, model, price) self.imageSize = imageSize self.memorySize = memorySizedef numPictures(self):
return self.memorySize // self.imageSizeWhat are the derived class?This code defines a derived class, CameraPhone, that inherits from the Phone class. The CameraPhone class has two additional data members: imageSize and memorySize. The constructor for the CameraPhone class takes two additional parameters corresponding to these data members. The numPictures() function returns the number of pictures that the camera's memory can hold.
Here is an example of how to use the CameraPhone class:
phone = CameraPhone("Apple", "iPhone 13 Pro", 1000, 10, 100)
print(phone.numPictures())
# Output: 10
This code will print the number of pictures that the camera's memory can hold, which is 10 in this case.
Find out more on derived class here: https://brainly.com/question/31942927
#SPJ2
Which recovery method helps users boot into an environment to get them back into the system so they can begin the troubleshooting process
Answer:
sfadasda
Explanation:
dsadasdadas
why you think Operating System is pivotal in teaching and learning.
Answer:
An Operating System is pivotal in teaching and learning because:
1. It enables computer users to communicate with the hardware.
2. To run any computer programme successfully, the Operating System is basic.
3. It provides a smooth interface for teachers to use video conferencing or other conferencing systems in teaching their students.
4. The OS enables the launching of other learning packages on a computer system.
5. Students can install learning apps on their systems with the help of the OS.
Explanation:
An Operating System is a software which brings about easy communication with the hardware and enablea other programs to run on the computer easily. It provides basic functionality in systems were they are installed.
is badlion safe and how ?
Answer:
Yes, badlion is safe. The further explanation is given below.
Explanation:
Badlion Client does not encompass any malicious programs, like viruses and sometimes malware.Badlion application is pretty much safe to be used on inequality in society because most expressly forbidden plugins like decided to post as well as schematics become unavailable on the client-side whenever you enter Hypixel, but that is not a confirmation and therefore should not be depended towards.