Answer:
The program in Python is as follows:
from random import randrange
colors = ['Red', 'Green', 'Blue', 'Orange', 'Yellow']
randNum = randrange(5)
print(colors[randNum])
Explanation:
This imports the randrange module from the random library
from random import randrange
This initializes the list of colors
colors = ['Red', 'Green', 'Blue', 'Orange', 'Yellow']
This generates a random number between 0 and 4 (inclusive)
randNum = randrange(5)
This prints the corresponding color
print(colors[randNum])
By comparing the time out mechanism used in TCP to that used in a data link layer protocol, outline why it is necessary for the TCP timeout mechanism to implement an adaptive timeout duration
Answer:
When there are network flows within the wireless link that experience prolonged poor transmission it can impact on the network, leading to the stalling of the source while waiting for the arrival of ACKS, due to the filling of the TCP source congestion window. More time is lost as the source waits for a timeout to be caused by the expiration of the RTO timer which results in lower efficiency and network throughput by the TCP that requires an adaptive timeout duration to be implemented
Explanation:
Write an expression that executes the loop while the user enters a number greater than or equal to 0. Note: These activities may test code with different test values. This activity will perform three tests, with user input of 9, 5, 2, -1, then with user input of 0, -17, then with user input of 0 1 0 -1. See "How to Use zyBooks". Also note: If the submitted code has an infinite loop, the system will stop running the code after a few seconds, and report "Test aborted."
Answer:
while ( num >= 0) { ... }
Explanation:
Required
Express to execute a while loop with the given condition.
The condition in the question is that: the user input must be greater than or equal to 0.
The statement for this is:
[tex]while[/tex] ( [tex]num[/tex] [tex]>=[/tex] [tex]0[/tex]) { [tex]...[/tex] }
Where num is the input variable
1. The smallest unit in a digital system is a
Answer:
a bit
Explanation:
<3
How could you use your technology skill and Microsoft Excel to organize, analyze, and compare data to decide if a specific insurance is a good value for the example you gave
Answer:
The summary of the given question would be summarized throughout the below segment.
Explanation:
"Insurance firms voluntarily assume our charge probability," implies assurance undertakings will compensate including all our devastations throughout respect of products for something we have health coverage and that the vulnerability for both would be equivalent.If somehow the client receives significant losses, the firm must compensate that kind of money as well as, if there are no failures, it can invest earnings or rather an investment.What is the meaning of negative impact in technology
Answer:
the use of criminal thought by the name of education
Consider the code below. When you run this program, what is the output if the temperature is 77.3 degrees Fahrenheit?
temperature = gloat(input('what is the temperature'))
if temperature >70:
print('Wear short sleeves')
else:
print('bring a jacket')
print ('Go for a walk outside')
Answer:
The output would be "Wear short sleeves"
Explanation:
The temperature is 77.3 degrees and 77.3 > 70
) Python command line menu-driven application that allows a user to display, sort and update, as needed a List of U.S states containing the state capital, overall state population, and state flower. The Internet provides multiple references with these lists. For example:
Answer:
Explanation:
The following is a Python program that creates a menu as requestes. The menu allows the user to choose to display list, sort list, update list, and/or exit. A starting list of three states has been added. The menu is on a while loop that keeps asking the user for an option until exit is chosen. A sample output is shown in the attached picture below.
states = {'NJ': ['Trenton', 8.882, 'Common blue violet'], 'Florida':['Tallahassee', 21.48, 'Orange blossom'], 'California': ['Sacramento', 39.51, 'California Poppy']}
while True:
answer = input('Menu: \n1: display list\n2: Sort list\n3: update list\n4: Exit')
print(type(answer))
if answer == '1':
for x in states:
print(x, states[x])
elif answer == '2':
sortList = sorted(states)
sorted_states = {}
for state in sortList:
sorted_states[state] = states[state]
states.clear()
states = sorted_states
sorted_states = {}
elif answer == '3':
state = input('Enter State: ')
capital = input('Enter Capital: ')
population = input('Enter population: ')
flower = input('Enter State Flower: ')
states[state] = [capital, population, flower]
else:
break
True/False: The American Standard Code for Information (ASCII) is a code that allows people to read information on a computer.
True
False
2.
The program is the set of instructions a computer obeys.
True
False
3.
A flash drive, dvd, and hard drive are all examples of:
storage
processing
output
input
4.
An example of an Input device is:
speaker
monitor
keyboard
CPU
5.
How many bits are in a byte?
16
8
24
32
6.
The part of the computer that processes all the inputs and outputs is the:
Monitor
Mouse
CPU
Tower
7.
Match the word to its definition:
1.
Smart phone
2.
Program
3.
Super computer
4.
Desktop
5.
Tablet
6.
Computer
7.
Mainframes
8.
Notebook
a.
An individual’s personal computer that resides on a desk or table
b.
A small portable computer, such as a netbook
c.
A device that includes, text, and data capabilities
d.
A large and powerful scientific computer that can process large amounts of data quickly
e.
The coded instructions that tell a computer what to do; also to write the code for a program
f.
A computer that combines the features of a graphic tablet with the functions of a personal computer; sometimes called a tablet PC
g.
Is a machine that changes information from one form into another by performing four basic actions
h.
A type of computer used by many people at the same time to allow access to the same secure data
8.
The four functions of a computer are (check all that apply):
processing
input
output
storage
9.
An example of an Output device is:
barcode reader
keyboard
monitor
mouse
10.
Which of the following are part of a computer (check all that apply):
mouse
tower
keyboard
11.
A storage device is both input and output together.
True
False
Answer:
Find answers below.
Explanation:
1. True: The American Standard Code for Information Interchange (ASCII) is a code that allows people to read information on a computer. It is used for representing numbers through 128 English characters.
2. True: a program is the set of instructions a computer obeys to perform a specific task.
3. A flash drive, dvd, and hard drive are all examples of: storage device. They are used for storing data, informations and instructions.
4. An example of an Input device is: a keyboard. An input device can be defined as any device that is typically used for sending data to a computer system.
5. There are 8 bits are in a byte; 1 byte = 8 bits.
In Computer science, a bit is a short word for the term binary digit and is primarily the basic (smallest) unit measurement of data or information. A bit is a logical state which represents a single binary value of either one (1) or zero (0).
6. The part of the computer that processes all the inputs and outputs is the: central processing unit (CPU).
Match the word to its definition:
a. Desktop: an individual’s personal computer that resides on a desk or table.
b. Notebook: a small portable computer, such as a netbook.
c. Smart phone: a device that includes, text, and data capabilities.
d. Supercomputer: a large and powerful scientific computer that can process large amounts of data quickly.
e. Program: the coded instructions that tell a computer what to do; also to write the code for a program.
f. Tablet: computer that combines the features of a graphic tablet with the functions of a personal computer; sometimes called a tablet PC.
g. Computer: is a machine that changes information from one form into another by performing four basic actions.
h. Mainframe: a type of computer used by many people at the same time to allow access to the same secure data.
8. The four functions of a computer are:
processing, input, output and storage.
9. An example of an Output device is: monitor. An output device can be defined as a hardware device that typically receives processed data from the central processing unit (CPU) and converts these data into information that can be used by the end user of a computer system.
10. The parts of a computer:
keyboard and mouse.
11. False: storage device is both input and output together. A storage device is a hardware device used for holding data (informations) either permanently or temporarily.
Create a function void process(char ch, int x, int y)- to accept an arithmetic operator (+,-./, in argum
ch and two integers in arguments x and y. Now on the basis of the operator stored in ch perform the operator
in x and y and print the final result. Also, write a main function to input the two integers and an arithmetit
operator, and by invoking function process() print the output.
Example: Input:
First Integer
Second Integer
: 6
Value of ch
Output: The result of 5 and 7 on * = 24
write in java
Answer:
The program is as follows:
import java.util.*;
public class Main{
public static void process(char ch, int x, int y){
if(ch == '+'){
System.out.print(x+y); }
else if(ch == '-'){
System.out.print(x-y); }
else if(ch == '*'){
System.out.print(x*y); }
else if(ch == '/'){
if(y!=0){
double num = x;
System.out.print(num/y); }
else{
System.out.print("Cannot divide by 0"); } }
else{
System.out.print("Invalid operator"); }
}
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int x, y;
char ch;
System.out.print("Enter two integers: ");
x = input.nextInt(); y = input.nextInt();
System.out.print("Enter operator: ");
ch = input.next().charAt(0);
process(ch,x, y);
}
}
Explanation:
The function begins here
public static void process(char ch, int x, int y){
If the character is +, this prints the sum of both integers
if(ch == '+'){
System.out.print(x+y); }
If the character is -, this prints the difference of both integers
else if(ch == '-'){
System.out.print(x-y); }
If the character is *, this prints the product of both integers
else if(ch == '*'){
System.out.print(x*y); }
If the character is /, this prints the division of both integers.
else if(ch == '/'){
if(y!=0){
double num = x;
System.out.print(num/y); }
else{
This is executed if the denominator is 0
System.out.print("Cannot divide by 0"); } }
Invalid operator is printed for every other character
else{
System.out.print("Invalid operator"); }
}
The main begins here
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
This declares both integers
int x, y;
This declares the operator
char ch;
Get input for both integers
System.out.print("Enter two integers: ");
x = input.nextInt(); y = input.nextInt();
Get input for the operator
System.out.print("Enter operator: ");
ch = input.next().charAt(0);
Call the function
process(ch,x, y);
}
}
In this module you learned about advanced modularization techniques. You learned about the advantages of modularization and how proper modularization techniques can increase code organization and reuse.
Create the PYTHON program allowing the user to enter a value for one edge of a cube(A box-shaped solid object that has six identical square faces).
Prompt the user for the value. The value should be passed to the 1st and 3rd functions as arguments only.
There should be a function created for each calculation
One function should calculate the surface area of one side of the cube. The value calculated is returned to the calling statement and printed.
One function should calculate the surface area of the whole cube(You will pass the value returned from the previous function to this function) and the calculated value results printed.
One function should calculate the volume of the cube and print the results.
Make a working version of this program in PYTHON.
Answer:
Following are the code to the given question:
def getSAOneSide(edge):#defining a method that getSAOneSide that takes edge patameter
return edge * edge#use return to calculate the edge value
def getSA(SA_one_side):#defining a method that getSA that takes SA_one_side patameter
return 6 * SA_one_side#use return to calculate the SA_one_side value
def volume(edge):#defining a method that volume that takes edge patameter
return edge * edge * edge#use return to calculate edge value
edge = int(input("Enter the length of edge of the cube:\n"))#defining edge variable that input value
SA_one_side = getSAOneSide(edge)#defining SA_one_side that holds getSAOneSide method value
print("Surface area of one side of the cube:", SA_one_side)
surfaceArea = getSA(SA_one_side)#defining a surfaceArea that holds getSA method value
print("Surface area of the cube:", surfaceArea)#print surfaceArea value
vol = volume(edge)#defining vol variable that holds Volume method value
print("Volume of the cube:", vol)#print vol Value
Output:
Please find the attached file.
Explanation:
In the code three method "getSAOneSide, getSA, and volume" method is declared that takes a variable in its parameters and use a return keyword that calculates and return its value.
In the next step,edge variable is declared that holds value from the user and defines three variable that holds method value and print its value with the message.
Exercise#1: The following formula gives the distance between two points (x1, yı) and (x2, y2) in the Cartesian plane:
[tex] \sqrt{(x2 - x1) ^{2} + (y2 - y1) ^{2} } [/tex]
Given the center and a point on circle, you can use this formula to find the radius of the circle. Write a C++ program that prompts the the user to enter the center and point on the circle. The program should then output the circle's radius, diameters, circumference, and area. Your program must have at least the following methods: findDistance: This mehod takes as its parameters 4 numbers that represent two points in the plane and returns the distance between them. findRadius: This mehod takes as its parameters 4 numbers that represent the center and a point on the circle, calls the method findDistance to find the radius of the circle, and returns the circle's radius. circumference: This mehod takes as its parameter a number that represents the radius of the circle and returns the circle's circumference. area: This mehod takes as as its parameter a number that represents the radius of the circle and returns the circle's area. .
What does the abbreviation BBC stands for?
Answer:
British Broadcasting Corporation Microcomputer System
Explanation:
The British Broadcasting Corporation Microcomputer System, or BBC Micro, is a series of microcomputers and associated peripherals designed and built by the Acorn Computer company in the 1980s for the BBC Computer Literacy Project.
Answer:
British Broadcasting Corporation
Explanation:
This is a UK company which provides television and radio news in over 40 languages. This is the computer related meaning, there are other meanings to the abbreviation but they seem irrelevant in this case.
Hope this information was of any help to you. (:
The _____ of the Open Systems Interconnection (OSI) modelspecifies the electrical connections between computers and the transmission medium and is primarily concerned with transmitting binary data, or bits, over a communication network.
Answer:
"Physical layer" is the correct answer.
Explanation:
It dealt mostly with bit-level transfer across various equipment as well as it provides industrial automation connections to meet quality standards to something like digital downloads.The purpose of this layer would be to consolidate essential networking system compatibility so that information is being sent successfully.Thus, the above is the correct answer.
each interior angle of a regular polygon is 150°.how many sides has the polygon
Answer:
12 sides
Explanation:
{(n-2)x180}÷n
150=[tex]\frac{(n-2)*180}{n}[/tex]
150n=(n-2) x 180
150n= 180n-360
150n-180n=- 360
-30n= -360
n= 12
Sides of polygon is 12
What layer of the OSI model describes how data between applications is synced and recovered if messages don't arrive intact at the receiving application?
A) Application Layer.
B) Presentation Layer.
C) Session Layer.
D) Transport Layer.
Answer:
C) Session Layer.
Explanation:
OSI model stands for Open Systems Interconnection. The seven layers of OSI model architecture starts from the Hardware Layers (Layers in Hardware Systems) to Software Layers (Layers in Software Systems) and includes the following;
1. Physical Layer
2. Data link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
Basically, each layer has its unique functionality which is responsible for the proper functioning of the communication services.
Session layer is the layer of an Open Systems Interconnection (OSI) model which describes how data between applications is synced and recovered if messages don't arrive intact at the receiving application.
Which of the following statement is False? 1 point Context free language is the subset of context sensitive language Regular language is the subset of context sensitive language Recursively enumerable language is the super set of regular language Context sensitive language is a subset of context free language
Answer:
Context-sensitive language is a subset of context-free language
Explanation:
Considering the available options, the statement that is considered wrong is "Context-sensitive language is a subset of context-free language."
This is because generally every regular language can be produced through the means of context-free grammar, while context-free language can be produced through the means of context-sensitive grammar, and at the same time, context-sensitive grammars are produced through the means of Recursively innumerable.
Hence, the correct answer in this correct answer to the question is the last option *Context-sensitive language is a subset of context-free langage
what is function of java
Explanation:
Java is an object-orinted programming language used for software develpment.
The imperative programming paradigm is popular and is a part of object-oriented computing paradigm, because it: __________.
A. is based on computer organization and thus is efficient to execute on hardware.
B. matches the culture of doing things by following the step-wise instructions.
C. enforces the modularity and supports the development of large programs.
D. supports class inheritance and code reuse.
Answer:
B. Matches the culture of doing things by following the step-wise instructions.
Explanation:
Imperative programming paradigm follows a sequence of instructions and steps. The order of execution of the statement is necessary because their is sequence of statements. Operation is system oriented.
In imperative programming, the source code is a series of commands, this commands tell the computer what to do, when to do it and the order it will be done so as to achieve the best result. The code of imperative programming paradigm is quite easy to understand.
Caleb Co. owns a machine that had cost $42,400 with accumulated depreciation of $18,400. Caleb exchanges the machine for a newer model that has a market value of $52,000. 1. Record the exchange assuming Caleb paid $30,000 cash and the exchange has commercial substance. 2. Record the exchange assuming Caleb paid $22,000 cash and the exchange has commercial substance.
Answer: See explanation
Explanation:
1. Record the exchange assuming Caleb paid $30,000 cash and the exchange has commercial substance.
Dr Machine (new) $52000
Dr Loss on exchange of asset $2000
Dr Accumulated Depreciation $18400
Cr Equipment (Old) $42400
Cr Cash $30000
Nite that loss was calculated as:
= Market value of new machine - (Book value if old machine - Depreciation) - Cash paid
= $52000 - ($42400 - $18400) - $30000
= $52000 - $24000 - $30000
= -$2000
2. Record the exchange assuming Caleb paid $22,000 cash and the exchange has commercial substance
Dr Machine (new) $46000
Dr Accumulated Depreciation $18400
Cr Equipment (Old) $42400
Cr Cash $22000
Note that the value of the new machine was calculated as:
= Original cost + Cash paid - Accumulated Depreciation
= $42000 + $22000 - $18400
= $46000
Which of the following statements regarding the SAP Hana product implemented by Under Armour is NOT true?
A. All of the statements are true.
B. The program allows legacy silos to remain intact.
C. The program can run across platforms and devices.
D. The program provides real-time results.
Answer:A
Explanation:i need points
A company can either invest in employee training seminars or update its computer network. Since updating the computer network would result in more measurable benefits, the company would be best off updating its computer network. The argument above assumes that: Group of answer choices
Answer:
The more measurable a benefit, the greater value that benefit has to a company
Explanation:
Here, there are two choices ; organizing employee training seminars and computer network update. With an update in the company's computer network, accompanying benefits include ; Improved network performance, Extended feature accessibility, Enhanced firewall and security features, Enhanced efficiency leading to increased overall output. Employee training and seminar also comes with its own benefit which include enhanced employee knowledge. However , the measurable benefits of updating a computer network seems more numerous than employee training which could be a reason why the company chose to invest in its computer network as they feel that investments with more measurable benefits will impact more on the company.
Frames control what displays on the Stage, while keyframes help to set up
Answer: A keyframe is a location on a timeline which marks the beginning or end of a transition. So for example, you have a movie and it transitions to another scene, keyframes tell it when and where to start the transition then when and where to stop the transition.
sita didnt go to school. (affirmative)
me
Write a program that estimates how many years, months, weeks, days, and hours have gone by since Jan 1 1970 by calculations with the number of seconds that have passed.
Answer:
Explanation:
The following code is written in Java. It uses the LocalDate import to get the number of seconds since the epoch (Jan 1, 1970) and then uses the ChronoUnit import class to transform those seconds into years, months, weeks days, and hours. Finally, printing out each value separately to the console. The output of the code can be seen in the attached picture below.
import java.time.LocalDate;
import java.time.temporal.ChronoUnit;
class Brainly {
public static void main(String[] args) {
LocalDate now = LocalDate.now();
LocalDate epoch = LocalDate.ofEpochDay(0);
System.out.println("Time since Jan 1 1970");
System.out.println("Years: " + ChronoUnit.YEARS.between(epoch, now));
System.out.println("Months: " + ChronoUnit.MONTHS.between(epoch, now));
System.out.println("Weeks: " + ChronoUnit.WEEKS.between(epoch, now));
System.out.println("Days: " + ChronoUnit.DAYS.between(epoch, now));
System.out.println("Hours: " + (ChronoUnit.DAYS.between(epoch, now) * 24));
}
}
Aaron opens a bicycle store. Which of the
following gives the best example of how Aaron
uses the scarce resource of labor?
Answer: Aaron hired an employee to do bicycle repairs
Explanation:
Labor refers to the physical and mental effort put into production by human beings.
Since Aaron opens a bicycle store, he can hire an employee to do bicycle repairs. Therefore, in this case, labor will be put into productive use for the company.
which function would ask excel to average the values contained in cells C5,C6,C7, and C8
Answer:
=AVERAGE(C5:C8)
Explanation:
The function calculates the average of the values in the cell range C5:C8 - C5, C6, C7, C8.
Of the following is a principle of total quality management?
A. Continuous defect elimination
B. Continuous process improvement
C. Continuous value enhancement
D. Continuous productivity improvement
As a CISO, you are responsible for developing an information security program based on using a supporting framework. Discuss what you see as some major components of an information security program.
Answer:
The CISO (Chief Information Security Officer) of an organization should understand the following components of an information security program:
1) Every organization needs a well-documented information security policy that will govern the activities of all persons involved with Information Technology.
2) The organization's assets must be classified and controlled with the best industry practices, procedures, and processes put in place to achieve the organization's IT objectives.
3) There should be proper security screening of all persons in the organization, all hardware infrastructure, and software programs for the organization and those brought in by staff.
4) Access to IT infrastructure must be controlled to ensure compliance with laid-down policies.
Explanation:
As the Chief Information Security Officer responsible for the information and data security of my organization, I will work to ensure that awareness is created of current and developing security threats at all times. I will develop, procure, and install security architecture, including IT and network infrastructure with the best security features. There will good management of persons' identity and controlled access to IT hardware. Programs will be implemented to mitigate IT-related risks with due-diligence investigations, and smooth governance policies.
Write an application that inputs a five digit integer (The number must be entered only as ONE input) and separates the number into its individual digits using MOD, and prints the digits separated from one another. Your code will do INPUT VALIDATION and warn the user to enter the correct number of digits and let the user run your code as many times as they want (LOOP). Submit two different versions: Using the Scanner class (file name: ScanP2)
Answer:
The program in Java is as follows:
import java.util.*;
public class Main{
public static void main(String[] args) {
int n, num;
Scanner input = new Scanner(System.in);
System.out.print("Number of inputs: ");
n = input.nextInt();
LinkedList<Integer> myList = new LinkedList<Integer>();
for(int i = 0; i<n;i++){
System.out.print("Input Integer: ");
num = input.nextInt();
while (num > 0) {
myList.push( num % 10 );
num/=10;
}
while (!myList.isEmpty()) {
System.out.print(myList.pop()+" ");
}
System.out.println();
myList.clear();
}
}
}
Explanation:
This declares the number of inputs (n) and each input (num) as integer
int n, num;
Scanner input = new Scanner(System.in);
Prompt for number of inputs
System.out.print("Number of inputs: "); n = input.nextInt();
The program uses linkedlist to store individual digits. This declares the linkedlist
LinkedList<Integer> myList = new LinkedList<Integer>();
This iterates through n
for(int i = 0; i<n;i++){
Prompt for input
System.out.print("Input Integer: ");
This gets input for each iteration
num = input.nextInt();
This while loop is repeated until the digits are completely split
while (num > 0) {
This adds each digit to the linked list
myList.push( num % 10 );
This gets the other digits
num/=10;
}
The inner while loop ends here
This iterates through the linked list
while (!myList.isEmpty()) {
This pops out every element of thelist
System.out.print(myList.pop()+" ");
}
Print a new line
System.out.println();
This clears the stack
myList.clear();
}
seven and two eighths minus five and one eighth equals?
Answer: 2.125
Explanation