Answer:
Top Secret, (A,B,C)
Explanation:
Solution:
Some information are known to be sensitive, and has a higher level of classification.
Examples for such levels are: Secret, Top secret ,Unclassified and Confidential, and Unclassified. all users of the system has a level of clearance. fro a user to be able to gain access to document, he or she must have posses a level of the document.
Now, this is governed by two rules which is stated below:
No user can have access to any information that is considered higher than their level of clearance.
Secondly, a user can write to files only that contains an equal level or lower of his clearance level, this is to stop what is called the write down effect.
It is important to note that ABC, categories determine what type of access is permitted.
Now, for the given example, since, Bob and charlie cannot read it, which shows that the file must be of top priority or importance, then Bob and Charlie needs clearance to the file,the file 2 is considered a top priority.
Therefore, the File 2 is classified as a Top Secret, (A,B,C)
Find the error in the following pseudocode.
Module main()
Declare Real mileage
Call getMileage()
Display "You've driven a total of ", mileage, " miles."
End Module
Module getMileage()
Display "Enter your vehicle’s mileage."
Input mileage
End Module
Answer:
Following are the error in the given program are explain in the explanation part .
Explanation:
The main() function call the function getMileage() function after that the control moves to the getMileage() definition of function. In this firstly declared the "mileage" variable after that it taking the input and module is finished we see that the "mileage" variable is local variable i,e it is declared inside the " Module getMileage() " and we prints in the main module that are not possible to correct these we used two technique.
Technique 1: Declared the mileage variable as the global variable that is accessible anywhere in the program.
Technique 2: We print the value of "mileage" inside the Module getMileage() in the program .
Social engineering attacks can be carried out:______.
a. only through physical proximity, such as shoulder surfing.
b. remotely by highly sophisticated means and subject matter experts (SMEs).
c. only for fun, they don't give any useful information to the attacker, except may be by entering a building without an ID or something such.
d. via password cracking software, such as Rainbow trees.
Given parameters b and h which stand for the base and the height of an isosceles triangle (i.e., a triangle that has two equal sides), write a C program that calculates: The area of the triangle; The perimeter of the triangle; And The volume of the cone formed by spinning the triangle around the line h The program must prompt the user to enter b and h (both of type double) The program must define and use the following three functions: Calc Area (base, height) //calculates and returns the area of the triangle Calc Perimeter (base, height) //calculates and returns the perimeter Calc Volume(base, height) //calculates and returns the volume
Answer:
The area of the triangle is calculated as thus:
[tex]Area = 0.5 * b * h[/tex]
To calculate the perimeter of the triangle, the measurement of the slant height has to be derived;
Let s represent the slant height;
Dividing the triangle into 2 gives a right angled triangle;
The slant height, s is calculated using Pythagoras theorem as thus
[tex]s = \sqrt{b^2 + h^2}[/tex]
The perimeter of the triangle is then calculated as thus;
[tex]Perimeter = s + s + b[/tex]
[tex]Perimeter = \sqrt{b^2 + h^2} + \sqrt{b^2 + h^2} +b[/tex]
[tex]Perimeter = 2\sqrt{b^2 + h^2} + b[/tex]
For the volume of the cone,
when the triangle is spin, the base of the triangle forms the diameter of the cone;
[tex]Volume = \frac{1}{3} \pi * r^2 * h[/tex]
Where [tex]r = \frac{1}{2} * diameter[/tex]
So, [tex]r = \frac{1}{2}b[/tex]
So, [tex]Volume = \frac{1}{3} \pi * (\frac{b}{2})^2 * h[/tex]
Base on the above illustrations, the program is as follows;
#include<iostream>
#include<cmath>
using namespace std;
void CalcArea(double b, double h)
{
//Calculate Area
double Area = 0.5 * b * h;
//Print Area
cout<<"Area = "<<Area<<endl;
}
void CalcPerimeter(double b, double h)
{
//Calculate Perimeter
double Perimeter = 2 * sqrt(pow(h,2)+pow((0.5 * b),2)) + b;
//Print Perimeter
cout<<"Perimeter = "<<Perimeter<<endl;
}
void CalcVolume(double b, double h)
{
//Calculate Volume
double Volume = (1.0/3.0) * (22.0/7.0) * pow((0.5 * b),2) * h;
//Print Volume
cout<<"Volume = "<<Volume<<endl;
}
int main()
{
double b, h;
//Prompt User for input
cout<<"Base: ";
cin>>b;
cout<<"Height: ";
cin>>h;
//Call CalcVolume function
CalcVolume(b,h);
//Call CalcArea function
CalcArea(b,h);
//Call CalcPerimeter function
CalcPerimeter(b,h);
return 0;
}
What color model should Joe use if he will be using an offset printing press?
Answer:
The color model used for an offset printing press should involve cyan, magenta, yellow and black. The combination of this creates a black color.
Offset printing doesn’t involve the direct contact of the ink with the paper. The ink usually comes in contact first with a rubber cylinder after which the cylinder makes the necessary imprints on the paper.
What were the first microblogs known as?
OA. tumblelogs
O B. livecasts
OC. wordpower
O D. textcasts
Answer:
the right answer is A
.....
Answer:
tumblelogs
Explanation:
After pushing the power switch of the PC to the ʺonʺ position, Bob, the PC repair person, realizes that the power-on lights found on the monitor and computer case do not light up and nothing displays on the screen. The first thing that Bob does is check the power plugs found on the back of the computer case and monitor. Bobʹs actions best illustrate the use ________ in solving a problem.
1. Professional and technical training
2. Logic3. Communication
4 .Beginnerʹs luck
Answer:
2. Logic
Explanation:
We all know that for the PC to come on, there must be a power input, this means that if the PC does not power on, then there is probably no power input into the PC. It is only logical for Bob to check if the PC is properly connected first when the power-on lights did not come on. People with no technical training should be able to apply this simple logic too.
(TCO C) When a remote user attempts to dial in to the network, the network access server (NAS) queries the TACACS+ server. If the message sent to the server is REJECT, this means _____.
Answer:
The correct answer to the following question will be "The user is prompted to retry".
Explanation:
NAS seems to be a category of server system a broader open internet as well as web through in-house and perhaps remotely associated user groups.
It handles as well as provides linked consumers the opportunity to provide a collection of network-enabled applications collectively, thereby integrated into a single base station but rather portal to infrastructure.Unless the text or response sent to the server seems to be REJECT, this implies that the authentication process continued to fail and therefore should be retried.building relationship during your carrer exploration is called
Answer:
Building relationships during your career exploration is called networking.
Canadian Tire is one of Canada’s largest companies. They operate four large distribution centers service over 470 tire retail outlets. They recently installed a Yard Management System (YMS), which they have integrated with their Warehouse Management Systems (WMS) and Transport Management System (TMS) systems. Their expectation was improved performance in over-the-road transportation equipment utilization, driver productivity, and warehouse dock/door utilization. As a relatively new logistics employee, you have been asked to develop an evaluation system to measure operational productivity improvement. While management does not want a financial impact evaluation, they are interested in developing benchmarks to measure initial and sustainable productivity improvement. You have the job-how would you proceed?
Answer: Provided in the explanation section
Explanation:
A YMS acts an interface between a WMS and TMS.The evaluation system with the key performance indicators are mentioned in the table below.
NOTE: The analysis follows in this order given below
MetricDescriptionCommentsMetric 1
Trailer utilization
Description :This captures the status of the trailer whether it is in the yard or is in transit
Comments : Helps in measuring the trailer productivity on a daily ,weekly or monthly basis
Metric 2
Driver utilization
Description : This captures the status of the driver whether the driver is in the yard or is in transit
Comments : Helps in measuring the driver productivity on a periodic basis
Metric 3
Trailer sequence
Description : This captures the order of movement of trailers in the yard on a given day, week or month
Comments : Helps in measuring the order fulfilment efficiency i.e. whether the priority orders have been serviced first or not
Metric 4
Total time in yard
Description : This captures the time spent by the trailer in the yard from the time it enters and leaves the yard
Comments : This helps in measuring the time taken to fulfill a particular request
⇒ Capturing these metrics need inputs from both WMS and TMS, and also the trailers need to have RFID tags attached to them.Then compare these performance metrics with the ones prior to the deployment of YMS to identify the percent gains in the overall operational productivity.
cheers i hope this helped !!
In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends decide to split the bill evenly between them, after adding 15% tip for the service. Calculate the tip, the total amount to pay, and each friend's share, then output a message saying "Each person needs to pay: " followed by the resulting number.
Answer:
The java program for the given scenario is as follows.
import java.util.*;
import java.lang.*;
public class Main
{
//variables for bill and tip declared and initialized
static double bill=47.28, tip=0.15;
//variables for total bill and share declared
static double total, share1;
public static void main(String[] args) {
double total_tip= (bill*tip);
//total bill computed
total = bill + total_tip;
//share of each friend computed
share1 = total/2;
System.out.printf("Each person needs to pay: $%.2f", share1);
}
}
Explanation:
1. The variables to hold the bill and tip percent are declared as double and initialized with the given values.
static double bill=47.28, tip=0.15;
2. The variables to hold the values of total bill amount and total tip are declared as double.
3. All the variables are declared outside main() and at class level, hence declared as static.
4. Inside main(), the values of total tip, total bill and share of each person are computed as shown.
double total_tip= (bill*tip);
total = bill + total_tip;
share1 = total/2;
5. The share of each person is displayed to the user. The value is displayed with only two decimal places which is assured by %.2f format modifier. The number of decimal places required can be changed by changing the number, i.e. 2. This format is used with printf() and not with println() method.
System.out.printf("Each person needs to pay: $%.2f", share1);
6. The program is not designed to take any user input.
7. The program can be tested for any value of bill and tip percent.
8. The whole code is put inside a class since java is a purely object-oriented language.
9. Only variables can be declared outside method, the logic is put inside a method in a purely object-oriented language.
10. As shown, the logic is put inside the main() method and only variables are declared outside the method.
11. Due to simplicity, the program consists of only one class.
12. The output is attached.
Answer:
bill = 47.28
tip = bill *.15
total = bill + tip
share = total
print( "Each person needs to pay: "+str(share) )
Explanation:
PROSZĘ O PILNĄ ODPOWIEDŹ
Zapisz algorytmy w postaci listy kroków:
1. algorytm mycia rąk
2. algorytm przejścia przez jezdnię
Przedstaw w postaci schematu blokowego:
1. Algorytm obliczania pola i obwodu prostokąta
2. Algorytm obliczania prędkości średniej pojazdu
Answer:
Kroki i algorytmy są opisane i załączone w poniższych akapitach
Explanation:
1. algorytm mycia rąk
za. Iść do ręki była umywalka
b. Włącz kran
do. Przenieś ręce pod wodę
dopóki nie zostanie przemoczony
re. Weź mydło
mi. Nanieś mydło na obie ręce
fa. Zwróć mydło
sol. Umieść dłonie pod bieżącą wodą z kranu na 2 sekundy
h. Złóż dłonie razem i potrzyj
ja. Przetrzyj jedną rękę dłonią drugiej
jot. Zablokuj palce i potrzyj je o siebie
l. Kciukami potrzyj obszar paznokci palców obu rąk
m. Pocieraj opuszki palców dłoni
n. Przyłóż kciuk i koniec nadgarstka kumplami i potrzyj
o. Spłucz całe mydło z rąk
2. algorytm przekraczania drogi
za. Obserwuj i planuj
ja. Dotrzyj do bezpiecznego miejsca do przejścia (najlepiej przejścia dla pieszych lub sygnalizacji świetlnej lub tam, gdzie jest dozorca ruchu) i zatrzymaj się tam
ii. Jeśli powyższe nie jest możliwe, poszukaj miejsca, w którym można wyraźnie zobaczyć wszystkie nadjeżdżające pojazdy i gdzie mogą cię zobaczyć
b. Zatrzymać
ja. Odsuń się trochę od krawędzi drogi na chodniku
ii. Cierpliwie rozejrzyj się, aby upewnić się, że jesteś w bezpiecznym miejscu
do. Patrz i słuchaj
i. Spójrz i nasłuchuj ruchu we wszystkich kierunkach
re. Pozostań na miejscu, dopóki nie będzie można bezpiecznie przejść
ja. Cierpliwie pozwalaj na ruch uliczny
ii. Przejdź przez jezdnię, gdy jest przerwa w ruchu, dzięki czemu jest wystarczająco dużo czasu, aby przejść szybciej
iii. Przejdź tylko wtedy, gdy masz pewność, że nie nadjeżdżają żadne pojazdy
mi. Patrz dalej i słuchaj
ja. Gdy nie ma nadjeżdżających pojazdów, a następnie przejeżdżasz przez ulicę, upewnij się, że cały czas szukasz ruchu (pojazdów)
1. Algorytm obliczania pola i obwodu prostokąta
W załączeniu wymagany schemat blokowy
2. Algorytm obliczania średniej prędkości pojazdu
W załączeniu wymagany schemat blokowy
as a programmer,why do you think that skills and training are needed. give 5 reasons
Answer:
bc
1 without them you wouldn't be able to program
2 need for job interviews
3 important to be good and make the money
4 can be adaptable
5 easy to move from a business to another
is co2+4h2--> ch4 + 2h2o a combustion
Answer:
No its not a combustion its a formation.
Explanation:
An exact solution to the bin packing optimization problem can be found using 0-1 integer programming (IP) see the format on the Wikipedia page.
Write an integer program for each of the following instances of bin packing and solve with the software of your choice. Submit a copy of the code and interpret the results.
a) Six items S = { 4, 4, 4, 6, 6, 6} and bin capacity of 10
b) Five items S = { 20, 10, 15, 10, 5} and bin capacity of 20
sflpawkfowakfpowja0ifjhnaw0i
when searching fora an image on your computer, you should look for a file with what extensions
Answer:png, jpeg, jpg, hevc, raw, bmp, png, webp
Explanation:
Just look for all the Image file formats
lan is working on a project report that will go through multiple rounds of
revisions. He decides to establish a file labeling system to help keep track of
the different versions. He labels the original document
ProjectReport_v1.docx. How should he label the next version of the
document?
A. ProjectReport_revised.docx
B. ProjectReport_v1_v2.docx
C. Report_v2.docx
D. ProjectReport_v2.docx
Answer:It’s D
Explanation:
APEVX
The label of the next version of the document can probably be ProjectReport_v2.docx. The correct option is D.
What is a document?A document's purpose is to enable the transmission of information from its author to its readers.
It is the author's responsibility to design the document so that the information contained within it can be interpreted correctly and efficiently. To accomplish this, the author can employ a variety of stylistic tools.
Documentation can be of two main types namely, products and processes. Product documentation describes the product under development and provides instructions on how to use it.
A document file name is the name given to a document's electronic file copy.
The file name of the document does not have to be the same as the name of the document itself. In fact, you can use the shortest possible version of the name.
As the document here is second version of the previous one, so its name should be ProjectReport_v2.docx.
Thus, the correct option is D.
For more details regarding document, visit:
https://brainly.com/question/27396650
#SPJ2
Given a set, weights, and an integer desired_weight, remove the element of the set that is closest to desired_weight (the closest element can be less than, equal to OR GREATER THAN desired_weight), and associate it with the variable actual_weight. For example, if weights is (12, 19, 6, 14, 22, 7) and desired_weight is 18, then the resulting set would be (12, 6, 14, 22, 7) and actual_weight would be 19. If there is a tie, the element LESS THANdesired_weight is to be chosen. Thus if the set is (2, 4, 6, 8, 10) and desired_weight is 7, the value chosen would be 6, not 8. Assume there is at least one value in the set.
Answer:
In the question stated a we declared a set named as weights also an integer variable was the desired_weight
In python A set is regarded as {12, 19, 6, 14, 22, 7}
Explanation:
Solution
The python program code is executed below:
# Declare a tuple
weights = (12, 19, 6, 14, 22, 7)
# Declare an integer variable to store desired weight.
desired_weight = 18
# Declare an integer variable to store actual_weight weight
actual_weight = weights[0]
# Create a for-loop to read each value in the tuple.
for each_weight in weights:
# Create an if-statement to find the that is
# closest weight but not greater than desired weight.
if(each_weight > actual_weight and each_weight < desired_weight):
actual_weight = each_weight
weights=list(weights)
# Delete the actual weight
weights.remove(actual_weight)
weights=tuple(weights)
# Display the actual weight
print("Actual Weight:",actual_weight)
# Display the resulted tuple.
print("Resulted set:",weights)
This program here is to declare a set which is as follows:
# Declare a set
weights = {12, 19, 6, 14, 22, 7}
# Declare an integer variable to store desired weight.
desired_weight = 18
# Declare an integer variable to store actual weight
# Assign first index element using list.
actual_weight = list(weights)[0]
# Create a for-loop to read each value in the tuple.
for each_weight in weights:
# Create an if-statement to find the that is
# closest weight but not greater than desired weight.
if(each_weight > actual_weight and each_weight < desired_weight):
actual_weight = each_weight
# Delete the actual weight using discard() method.
weights.discard(actual_weight)
# Display the actual weight
print("Actual Weight:",actual_weight)
# Display the resulted tuple.
print("Resulted set:",weights)
Finish and test the following two functions append and merge in the skeleton file:
(1) function int* append(int*,int,int*,int); which accepts two dynamic arrays and return a new array by appending the second array to the first array.
(2) function int* merge(int*,int,int*,int); which accepts two sorted arrays and returns a new merged sorted array.
#include
using namespace std;
int* append(int*,int,int*,int);
int* merge(int*,int,int*,int);
void print(int*,int);
int main()
{ int a[] = {11,33,55,77,99};
int b[] = {22,44,66,88};
print(a,5);
print(b,4);
int* c = append(a,5,b,4); // c points to the appended array=
print(c,9);
int* d = merge(a,5,b,4);
print(d,9);
}
void print(int* a, int n)
{ cout << "{" << a[0];
for (int i=1; i
cout << "," << a[i];
cout << "}\n"; }
int* append(int* a, int m, int* b, int n)
{
// wru=ite your codes in the text fields
}
int* merge(int* a, int m, int* b, int n)
{
// wru=ite your codes in the text fields
}
Answer:
Explanation:
#include <iostream>
using namespace std;
int* append(int*,int,int*,int);
int* merge(int*,int,int*,int);
void print(int*,int);
int main()
{ int a[] = {11,33,55,77,99};
int b[] = {22,44,66,88};
print(a,5);
print(b,4);
int* c = append(a,5,b,4); // c points to the appended array=
print(c,9);
int* d = merge(a,5,b,4);
print(d,9);
}
void print(int* a, int n)
{ cout << "{" << a[0];
for (int i=1; i<n; i++)
cout << "," << a[i];
cout << "}\n";
}
int* append(int* a, int m, int* b, int n)
{
int * p= (int *)malloc(sizeof(int)*(m+n));
int i,index=0;
for(i=0;i<m;i++)
p[index++]=a[i];
for(i=0;i<n;i++)
p[index++]=b[i];
return p;
}
int* merge(int* a, int m, int* b, int n)
{
int i, j, k;
j = k = 0;
int *mergeRes = (int *)malloc(sizeof(int)*(m+n));
for (i = 0; i < m + n;) {
if (j < m && k < n) {
if (a[j] < b[k]) {
mergeRes[i] = a[j];
j++;
}
else {
mergeRes[i] = b[k];
k++;
}
i++;
}
// copying remaining elements from the b
else if (j == m) {
for (; i < m + n;) {
mergeRes[i] = b[k];
k++;
i++;
}
}
// copying remaining elements from the a
else {
for (; i < m + n;) {
mergeRes[i] = a[j];
j++;
i++;
}
}
}
return mergeRes;
}
The OSI is reference/conceptual model and accordingly multiple practical models (such as TCP/IP, AppleTALK, etc) exits. Which fundamental functionalities necessarily needs to considered while implementing any network model?
Answer:
The fundamental functionalities necessarily needs to considered while implementing any network model are (1) Scalability, (2)The quality of service (3) Fault tolerance (4) Security.
Explanation:
Solution:
Network must help a wide area of applications and administrations, just just as work over various sorts of links and devices that make up the physical infrastructure. The term network refers to the innovations that help the infrastructure and the customized administrations and rules, or protocols, that move messages over the network.
The following are some fundamental functionalities necessarily needs to considered while implementing any network model which is stated below:
(1) Scalability :
A huge number of users and service providers connect with the Internet every week. All together for the Internet to help this fast measure of development, it must be scalable.
A scalable network can extend rapidly to help new clients and applications without influencing the performance of the administration being conveyed to existing clients.
(2)Quality of Service :
Networks must provide predictable, quantifiable, and, now and again, ensured administrations.
Networks also need mechanisms to carry on congested network traffic. Network bandwidth is the estimate of the data-transfer size of the network. As such, what amount of data can be transmitted inside a particular measure of time? Network data transfer capacity is estimated in the quantity of bits that can be transmitted in a solitary second, or bits every second (bps).
(3) Fault Tolerance :
The Internet is consistently accessible to the a huge number of users who depend on it. This requires a network design that is worked to be fault tolerant.
A fault-tolerant network is one that constrains the impact of a failure, with the goal that the least number of devices are influenced by it. It is likewise worked in a manner that empowers fast recuperation when such a failure happens.
Faults-tolerant networks rely upon various ways between the source and destination of a message. On the off chance that one way comes up short, the messages can be immediately sent over an alternate connection.
(4) Security:
The Internet has advanced from a firmly controlled inter network of instructive and government associations to a generally open methods for transmission of business and individual interchanges.
Subsequently, the security necessities of the network have changed. The network infrastructure, the system administrations, and the information contained on arrange appended gadgets are vital individual and business resources. Bargaining the respectability of these benefits could have genuine outcomes.
What are two key elements of describing the environment? a. Communication protocols and security methods b. External systems and technology architecture c. Programming language and operating system environment d. Hardware configuration and DBMS’s
Answer:
B. External systems and technology architecture.
Explanation:
In such environment, you have to know what external systems are in place so have proper communication with External Systems whether be in message format or web/networks, Communication protocols, Security methods, Error detection and recovery,
Additionally, it consits of technology architecture so conforming to an existing technology architecture helps us discover and describe existing architecture
The two elements that describe the environment are external systems and technology architecture. Thus, the correct option for this question is B.
What is an Environment?In computer and technology, the environment may be defined as anything which is present in the surrounding of computer and network connection. It significantly includes various protocols and their characteristics.
According to the environment of the computer, external systems are remarkably assisting in the proper communication, protocols, Security methods, Error detection, and recovery. It creates a supportive environment for the user. Apart from this, it also consists of technology architecture which confirms the process of existing technological perspectives.
Therefore, the two elements that describe the environment are external systems and technology architecture. Thus, the correct option for this question is B.
To learn more about Technology architecture, refer to the link:
https://brainly.com/question/15243421
#SPJ2
Suggest how you would go about validating a password protection system for an application that you have developed. Explain the function of any tools that you think may be useful.
A MAC Frame format has a Preamble of 7 octet pattern in the form of alternating 1s and 0s used by a receiver to establish synchronization. Use a Manchester Encoding technique to describe the first octet of the signal pattern produced within the Preamble.
Answer:
The Manchester encoding to describe the first octet pattern signal within the preamble is 10101010
Explanation:.
Solution
Given that:
The first octet value of Preamble is 10101010
The Manchester encoding to outline or describe the first octet of the signal pattern produced or created within the preamble is 10101010
Note: Kindly find an attached image of the first octet signal pattern produced below.
What are some ways technology has changed the way people live
Answer:
Multiple ways.
Explanation:
Here are some examples. Modern people relay on technology alot! It shapes our lives. Like now you can order something without moving from you place using your smartphone. When you need a spare part for a lego for example you can now just 3D print it without buying another one. See plenty of ways. Looks around you and find more examples.
Given the macro definition and global declarations shown in the image below, provide answers to the following questions:
A. After the statement "quiz4 x,4" executes, x contains
B. The statement "quiz4 6,4" will produce an error when the macro is invoked. (Enter true or false)
C. Suppose that the following code executes:
mov ebx, 3
mov ecx, 12
mov edx, ecx
quiz4 ecx, ebx
Upon completion, edx will contain_______
Hint: Think carefully, part C may be more difficult than it seems.
quiz4 MACRO p,q
LOCAL here
push eax
push ecx
mov eax, p
mov ecx, q
here: mul P
loop here
mov p, eax
pop ecx
pop eax
ENDM .
data
x DWORD 3
y DWORD 3
Answer:
A. 243
B. True
C. 0
Explanation:
Macro instruction is a line of coding used in computer programming. The line coding results in one or more coding in computer program and sets variable for using other statements. Macros allows to reuse code. Macro has two parts beginning and end. After the execution of statement of quiz4 x, 4 the macro x will contain 243. When the macro is invoked the statement will result in an error. When the macro codes are executed the edx will contain 0. Edx serve as a macro assembler.
Return 1 if ptr points to an element within the specified intArray, 0 otherwise.
* Pointing anywhere in the array is fair game, ptr does not have to
* point to the beginning of an element. Check the spec for examples if you are
* confused about what this method is determining.
* size is the size of intArray in number of ints. Can assume size != 0.
* Operators / and % and loops are NOT allowed.
** ALLOWED:
* Pointer operators: *, &
* Binary integer operators: -, +, *, <<, >>, ==, ^
* Unary integer operators: !, ~
* Shorthand operators based on the above: ex. <<=, *=, ++, --, etc.
** DISALLOWED:
* Pointer operators: [] (Array Indexing Operator)
* Binary integer operators: &, &&, |, ||, <, >, !=, /, %
* Unary integer operators: -
*/
int withinArray(int * intArray, int size, int * ptr) {
Answer:
int withinArray(int * intArray, int size, int * ptr) {
if(ptr == NULL) // if ptr == NULL return 0
return 0;
// if end of intArr is reached
if(size == 0)
return 0; // element not found
else
{
if(*(intArray+size-1) == *(ptr)) // check if (size-1)th element is equal to ptr
return 1; // return 1
return withinArray(intArray, size-1,ptr); // recursively call the function with size-1 elements
}
}
Explanation:
Above is the completion of the program.
1. What are the first tasks the Team Leader (TL) must perform after arriving at the staging area?
O A. Assign volunteers to specific positions and prioritize response activities.
OB. Gather and document information about the incident.
O C. Take the team to the most pressing need.
O D. Communicate with emergency responders to let them know the CERT is in place.
Write a program that prompts the user to enter three cities and displays them in ascending order. Here is a sample run: Enter the first city: Chicago Enter the second city: Los Angeles Enter the third city: Atlanta The three cities in alphabetical order are Atlanta Chicago Los Angeles
Answer:
import java.util.Scanner;
public class SortStrings3 {
public static void main(String args[]){
Scanner scanner = new Scanner(System.in);
String str1, str2, str3;
System.out.print("Enter the first city: ");
str1 = scanner.nextLine();
System.out.print("Enter the second city: ");
str2 = scanner.nextLine();
System.out.print("Enter the third city: ");
str3 = scanner.nextLine();
System.out.print("The three cities in alphabetical order are ");
if(str1.compareTo(str2) < 0 && str1.compareTo(str3) < 0){
System.out.print(str1+" ");
if(str2.compareTo(str3) < 0){
System.out.print(str2+" ");
System.out.println(str3);
}
else {
System.out.print(str3+" ");
System.out.println(str2);
}
}
else if(str2.compareTo(str1) < 0 && str2.compareTo(str3) < 0){
System.out.print(str2+" ");
if(str1.compareTo(str3) < 0){
System.out.print(str1+" ");
System.out.println(str3);
}
else {
System.out.print(str3+" ");
System.out.println(str1);
}
}
else{
System.out.print(str3+" ");
if(str1.compareTo(str2) < 0){
System.out.print(str1+" ");
System.out.println(str2);
}
else {
System.out.print(str2+" ");
System.out.println(str1);
}
}
}
}
EXPLANATION:
Okay, we are given that a program should be written which will make user to enter three cities namely Atlanta, Chicago and Los Angeles (which should be done in ascending alphabetical order).
So, we will be writting the code or program with a programming language known as JAVA(JUST ANOTHER VIRTUAL ACCELERATOR).
We will make use of java to write this program because Java can be used in Loading code, verifying codes and executing codes on a single or multiple servers.
The code or program can be seen in the attached file/document. Kindly check it.
The goal for me is that I need to identify the objects needed for the UNO card game and the actions that those objects perform, rather than how the objects are suppose to actually be represented. Write a document that includes an ADT (abstract data type) for each object needed in my program. This is a partial ADT for the UnoCard class.
//get the color of the car
+getColor(): String
//set the color of the card
+setColor(color : String):void
//get the value of the card
+getValue(): int
//set the value of the card
+getValue(val : int): void
//return true if card has same value or
//same color as the card
//return false otherwise
+isMatch(card: UnoCard): boolean
The standard UNO card must be able to report both its color and value, and, when given another card, tell whether or not it is a "match.
Answer:
Explanation:
//Java program
class UnoCard{
private String color;
private int value;
public UnoCard(String color , int val) {
this.color = color;
value = val;
}
public String getColor() {
return color;
}
//set the color of the card
public void setColor(String color ) {
this.color = color;
}
//get the value of the card
public int getValue() {
return value;
}
//set the value of the card
public void setValue(int val) {
value = val;
}
//return true if card has same value or
//same color as the card
//return false otherwise
public boolean isMatch(UnoCard card) {
return (this.value==card.value)||(this.color==card.color);
}
}
public class Card {
public static void main(String args[]) {
UnoCard card1 = new UnoCard("Red",10);
UnoCard card2 = new UnoCard("Green",10);
UnoCard card3 = new UnoCard("Blue",15);
if(card1.isMatch(card2))System.out.println("Match");
else System.out.println("No Match");
if(card2.isMatch(card3))System.out.println("Match");
else System.out.println("No Match");
}
}
Write in Java please
Description
There is a cricket that lives by our timeshare in Myrtle Beach, South Carolina. Most every night I hear it patiently chirping away. Some nights it chirps faster than others, and it seems like the warmer it is, the faster it chirps. There are many crickets, and each of them seems to behave the same. On several different nights, armed with a stopwatch and a thermometer, I recorded the frequency of the chirps and compared it to that night's air temperature.
Experimental Results
The chirping follows a simple linear formula: take the number of chirps, add 40 and divide that sum by four to get the temperature in degrees Fahrenheit.
Assignment
Create a simulation to model the crickets chirping at various randomly generated frequencies, create an Environmentclass that knows and can return the current temperature. Create a Cricket class that chirps, or for simplicity, returns how many chirps per minute the cricket would make at that temperature. Repeat the simulation for at least three trials.
Extension: There is a cricket variety in some parts of South Carolina that is a little slower than most normal Carolina crickets. Add a ClemsonCricket class that extends Cricket but chirps slower by 20%.
Bonus: Implement polymorphism in the driver class.
Rubrics
Cricket class should include the following items:
A variable that stores the frequency of chirps.
A default constructor that initializes the frequency to a random value
An overloaded constructor that initializes the frequency to a value of your choice that gets passed on as a parameter.
A method for changing the frequency to a random value.
A getter method that returns the frequency.
clemsonCricket class should include the following items:
A default constructor that initializes the frequency to a random value that is 20% lower than what the parent class constructor would initialize it to.
A overloaded constructor that calls to the parent constructor.
A polymorphic method that changes the frequency value to a value that is 20% lower than what the parent method would change it to.
Environment class should include the following items:
A variable that stores the temperature.
A default constructor that initializes the temperature to a value of your choosing.
An overloaded constructor that initializes the temperature based on the formula in the assignment.
A method that takes in a frequency as a parameter and calculates the temperature based on the formula in the assignment.
testCrickets program should do the following items:
Creates an Environment object in the test program or in the Cricket or clemsonCricket classes and displays temperature Creates a cricket object and displays temperature before and after changing frequency
Creates a Clemson cricket object and displays temperature before and after changing frequency
Creates a polymorphic Clemson cricket object and displays temperature before and after changing frequency.
Answer: Provided in the section below
Explanation:
Using C# Code:
using System;
class Environment{
//temperature
private double temp;
//sets initial value of temp to 100 Fahrenheits
public Environment(){
temp=100;
}
//sets initial value to given temp
public Environment(double t) {
this.temp = t;
}
//returns temp
public double getTemp(){
return temp;
}
//calculates temp at given frequency
public void calcTemperature(double frequency){
temp=(frequency+40)/4.0;
}
}
class Cricket{
private Random r=new Random();
//frequency of birds
protected double frequency;
//sets frequency to a random value between 0-100
public Cricket(){
frequency=r.NextDouble()*100;
}
//sets frequency to a given frequency
public Cricket(double f) {
frequency = f;
}
//returns the frequency
public double getFrequency() {
return frequency;
}
//randomize the frequency
public virtual void randomFrequency() {
frequency = r.NextDouble()*100;
}
}
class ClemsonCricket: Cricket{
//sets the frequency to 80% of the parent's
public ClemsonCricket(): base(){
frequency=frequency*0.8;
}
//sets frequency to a given frequency
public ClemsonCricket(double f): base(f){}
//randomize frequency and sets it to 80% of the parent's
public override void randomFrequency(){
base.randomFrequency();
frequency=frequency*0.8;
}
}
public class testCrickets {
static void Main(){
Environment env=new Environment();
Console.WriteLine("Initial Temp: "+env.getTemp());
Cricket cricket=new Cricket();
env.calcTemperature(cricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
cricket.randomFrequency();
env.calcTemperature(cricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}",env.getTemp()));
Console.WriteLine("\nClemson Cricket: ");
ClemsonCricket clemsonCricket=new ClemsonCricket();
env.calcTemperature(clemsonCricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
clemsonCricket.randomFrequency();
env.calcTemperature(clemsonCricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}" ,env.getTemp()));
Console.WriteLine("\nPolymorphism Clemson Cricket: ");
Cricket Ccricket=new ClemsonCricket();
env.calcTemperature(Ccricket.getFrequency());
Console.WriteLine(String.Format("Temp before changing Frequency: {0:0.00}",env.getTemp()));
Ccricket.randomFrequency();
env.calcTemperature(Ccricket.getFrequency());
Console.WriteLine(String.Format("\nTemp after changing Freqency: {0:0.00}",env.getTemp()));
}
}
cheers i hope this helped !!
2 x + y for x = 1 and y = 1
Answer:
3
Explanation:
2*1+1
2+1
hope this helps