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.

Answers

Answer 1

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)


Related Questions

LAB:
Warm up:
People's weights Output each floating-point value with two digits after the decimal point, which can be achieved as follows:
printf("%0.2lf", yourValue);
(1) Prompt the user to enter five numbers, being five people's weights. Store the numbers in an array of doubles. Output the array's numbers on one line, each number followed by one space. (2 pts)
Ex:
Enter weight 1: 236.0
Enter weight 2: 89.5
Enter weight 3: 142.0
Enter weight 4: 166.3
Enter weight 5: 93.0
You entered: 236.00 89.50 142.00 166.30 93.00
(2) Also output the total weight, by summing the array's elements. (1 pt)
(3) Also output the average of the array's elements. (1 pt)
(4) Also output the max array element. (2 pts)
Ex:
Enter weight 1: 236.0
Enter weight 2: 89.5
Enter weight 3: 142.0
Enter weight 4: 166.3
Enter weight 5: 93.0
You entered: 236.00

Answers

Answer:

Following is the program in the C language

#include <stdio.h> // header file  

int main() // main function

{

float weight1[10]; // array declaration  

float sum=0,max1,t; // variable declaration

for(int k = 0; k < 5; k++) //iterating the loop

{

printf("Enter weight %d: ",k+1);

scanf("%f",&weight1[k]); // Read the array by user

}

printf("\n");

printf("You entered: ");

max1=weight1[0];

for(int k = 0; k < 5 ; k++)

{

sum=sum+weight1[k];

if(max1 < weight1[k]) // check condition for highest element

{

max1=weight1[k];

}

printf("%.2lf ",weight1[k]);

}

t=sum/5.0; // find average

printf("\nTotal weight: %.2lf\n",sum); // displat total

printf("Average weight: %.2lf\n",t); // display Average

printf("Max weight: %.2lf\n",max1); // display maximum value

return 0;

}

Output:

Enter weight 1: 1

Enter weight 2: 2

Enter weight 3:3

Enter weight 4:4

Enter weight 5: 5

You entered:  1.00  2.00  3.00  4.00  5.00

Total weight: 15.00

Average weight:  3.00

Max weight:  5.00

Explanation:

Following are description of program :

Declared a array "weight1" of type "float" .Declared a variable sum,t max1 of type "float ".Iterating the loop for taking the input by the user by using scanf statement .Iterating the loop for calculating the maximum value in "max1" variable  ,total in "sum" variable .In the "t" variable we calculated the average. Finally we print the value of the maximum ,average ,total and respective array that are mention in the question .

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?

Answers

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.

For this lab you will write a Java program that will run a simple math quiz. Your program will generate two random integers between 1 and 20 and then ask a series of math questions. Each question will be evaluated as to whether it is the right or wrong answer. In the end a final score should be reported for the user.

This is a sample transcript of what your program should do. Items in bold are user input and should not be put on the screen by your program.

Enter your name: Jeremy
Welcome Jeremy! Please answer the following questions:

4 + 6 = 10
Correct!

4 * 6 = 24
Correct!

4 / 6 = 1
Wrong!
The correct answer is 0

4 % 6 = 4
Correct!

You got 3 correct answers
That's 75.0%!

Your code will behave differently based on the random numbers it selects and the answers provided by the user. Here is a second possible execution of this code:

Enter your name: Bob
Welcome Bob! Please answer the following questions:

3 + 3 = 0
Wrong!
The correct answer is 6

3 * 3 = 6
Wrong!
The correct answer is 9

3 / 3 = 0
Wrong!
The correct answer is 1

3 % 3 = 1
Wrong!
The correct answer is 0

You got 0 correct answers
That's 0.0%!

Answers

Answer:

A java program was used to run a simple math quiz. the program was used to generate two random integers between 1 and 20 and then ask a series of math questions

Explanation:

Solution

THE CODE:

import java.util.Random;

import java.util.Scanner;

public class LabQuiz {

public static void main(String[] args) {

Scanner in = new Scanner(System.in);

System.out.println("****Welcome to Quiz******");

System.out.print("Enter your name: ");

String name = in.next();

System.out.println("Welcome "+name+"! Please answer the following questions:");

int scoreCounter=0;

int a;

int b;

int response;

a=getRandomNum();

b=getRandomNum();

System.out.print(a+"+"+b+"=");

response = in.nextInt();

if(response==(a+b)){

scoreCounter++;

System.out.println("That is correct");  

}  

else

System.out.println("No, thats not the right answer, its::"+(a+b));

a=getRandomNum();

b=getRandomNum();

System.out.print(a+"*"+b+"=");

response = in.nextInt();

if(response==(a*b)){

scoreCounter++;

System.out.println("That is correct");  

}  

else  

System.out.println("No, thats not the right answer, its::"+(a*b));

a=getRandomNum();

b=getRandomNum();

System.out.print(a+"/"+b+"=");

response = in.nextInt();

if(response==(a/b)){

scoreCounter++;

System.out.println("That is correct");

}

else

System.out.println("No, thats not the right answer, its::"+(a/b));

a=getRandomNum();

b=getRandomNum();

System.out.print(a+"%"+b+"=");

response = in.nextInt();

if(response==(a%b)){

scoreCounter++;

System.out.println("That is correct");  

}

else

System.out.println("No, thats not the right answer, its::"+(a*b));

System.out.println("You got "+scoreCounter+" correct answers.");

System.out.println("Thats "+(scoreCounter*25)+"%");

in.close();  

}

static int getRandomNum(){

Random rand = new Random();

int a;  

a = rand.nextInt(20);

if(a==0)

a++;  

return a;  

}  

}

Write and test a Python program to find and print the smallest number in a set of integer numbers. The program should read input numbers until it reads a negative number. The negative number serves as a sentinel or marker telling the program when to stop reading numbers. The smallest of all numbers input as well as how many numbers were read (not considering the sentinel number) should be printed.

Answers

Answer:

numbers = []

count = 0

while True:

   number = int(input("Enter a number: "))

   if number < 0:

       break

   else:

       numbers.append(number)

       count += 1

min_number = min(numbers)  

print(str(min_number) + " was the smallest among " + str(count) + " entered numbers.")

Explanation:

Initialize an empty array, to hold the entered numbers, and count as 0

Create a while loop that iterates until a specific condition is met

Inside the loop, ask the user to enter the numbers. When the user enters a negative number terminate the loop. Otherwise, add the entered number to the numbers array and increment the count by 1.

When the loop is done, find the smallest of the number in the numbers array using min method and assign it to the min_number.

Print the min_number and count

Print "Censored" if userInput contains the word "darn", else print userInput. End with a newline. Ex: If userInput is "That darn cat.", then output is: Censored Ex: If userInput is "Dang, that was scary!", then output is: Dang, that was scary! Note: If the submitted code has out-of-range access, the system will stop running the code after a few seconds, and report "Program end never reached." The system doesn't print the test case that caused the reported message.
#include
#include
using namespace std;
int main() {
string userInput;
getline(cin, userInput);
/* Your solution goes here */
return 0;
}

Answers

Answer:

The program goes as follows

Comments are used to explain difficult lines

#include <iostream>

#include <string>

using namespace std;

int main()

{

string userinput;

getline(cin,userinput);

/* My Solution starts here*/

//Initialize sub string position to 0

int stringpos = 0;

// Declare an iterating variable to iterate through userinput

int startpos;  

//Declare and initialize a determinant variable

int k = 0;

while((startpos = userinput.find("darn",stringpos))!=string::npos)

{

 //If userinput contaings "darn", increase k by 1

k++;

// Go to next string position

stringpos = startpos+1;  

}

//If determinant variable k is p then, userinput does not contain "darn"

if(k==0)

{

 cout<<userinput;

}

//Otherwise, it contains "darn"

else

{

 cout<<"Censored";

}

/* My Solution ends here*/

return 0;

}

See attached for .cpp program file

What is the work of the cpu as processer

Answers

Answer:

A central processing unit (CPU) is an important part of every computer. The CPU sends signals to control the other parts of the computer, almost like how a brain controls a body. The CPU is an electronic machine that works on a list of computer things to do, called instructions. hope that helps love!

I would say the CPU has to be the most important part including the graphics card

The skip_elements function returns a list containing every other element from an input list, starting with the first element. Complete this function to do that, using the for loop to iterate through the input list.

Answers

Answer:

Following are code that we fill in the given in the given question

if i %2==0:# check the condition

new_list.append(elements[i])# append the list  

return new_list # return the new_list

Explanation:

Missing Information :

def skip_elements(elements):# function

new_list=[]# Declared the new list

i=0  #variable declaration

for i in range(len(elements)): #iterating over the loop  

if ---------# filtering out even places elements in the list

--------------# appending the list

return -------- # returning the new_list

print(skip_elements(['a','b','c','d','e','f','g'])) #display

Following are the description of the code:

In this we declared a function skip_elements .In this function we pass the parameter into them .After that we declared the new_list array.Declared the variable "i" that are initialized with the 0 value .Iterating over the for loop and this loop we check the condition in the if condition.The if condition executed when the index is even .The statement inside the if condition we will appending the list and returning the list item .Finally we print the even number of index list .

Richard Palm is the accounting clerk of Olive Limited. He uses the source documents such as purchase orders, sales invoices and suppliers’ invoices to prepare journal vouchers for general ledger entries. Each day he posts the journal vouchers to the general ledger and the related subsidiary ledgers. At the end of each month, he reconciles the subsidiary accounts to their control accounts in the general ledger to ensure they balance.
Discuss the internal control weaknesses and risks associated with the above process. (maximum 300 words)

Answers

Answer:

Lack of segregation of duties

Explanation:

Internal Controls are set of rules and guidelines that are followed to ensure effectiveness of business operations. The main risk in the business is weak internal controls. There are some organizations with strong internal controls but implementation of such controls is a challenge for organizations. There are human errors, IT security risks, fraud and compliance risk.

The risks associated with Olive limited is that there is no segregation of duties, Richard Palm is preparing journal vouchers, posts the journal vouchers and reconciles the balance himself. If he makes an error in recording a transaction there is no one who reviews his work and can identify an error. Also if Richard is involved in a fraud and collaborates with purchase department or sales department staff, he can pass a transaction without any supervision.

How do I write: "get a random number between -10 and 11 but it cannot be 0"? (java)

Answers

Answer:

  generate a random number in a known range and map the result to the range you want

Explanation:

Use any of the usual methods to get a random number in the range 0-20, then subtract 9. Use an IF statement to test if the result is 0. If it is, replace the value with -10.

Anyone watch anime, i love stay kids and they sang the op for Tower of God XD

Answers

Answer:

I do Stray kids and Tower Of God is good combo mannnn

Answer:

Yes

Explanation:

I dont comprehend how this question requires any intellectual answer but it's ok.

For each of the descriptions below, perform the following tasks:

i. Identify the degree and cardinalities of the relationship.
ii. Express the relationships in each description graphically with an E-R diagram.

a. A book is identified by its ISBN number, and it has a title, a price, and a date of publication. It is published by a publisher, which has its own ID number and a name. Each book has exactly one publisher, but one publisher typically publishes multiple books over time.
b. A book is written by one or multiple authors. Each author is identified by an author number and has a name and date of birth. Each author has either one or multiple books; in addition, occasionally data are needed regarding prospective authors who have not yet published any books.
c. In the context specified in 2a and 2b, better information is needed regarding the relationship between a book and its authors. Specifically, it is important to record the percentage of the royalties that belongs to a specific author, whether or not a specific author is a lead author of the book, and each author's position in the sequence of the book's authors.
d. A book can be part of a series, which is also identified as a book and has its own ISBN number. One book can belong to several sets, and a set consists of at least one but potentially many books.
e. A piano manufacturer wants to keep track of all the pianos it makes individually. Each piano has an identifying serial number and a manufacturing completion date. Each instrument represents exactly one piano model, all of which have an identification number and a name. In addition, the company wants to maintain information about the designer of the model. Overtime, the company often manufactures thousands of pianos of a certain model, and the model design is specified before any single piano exists.
f. A piano manufacturer (see 2e) employs piano technicians who are responsible for inspecting the instruments before they are shipped to the customers. Each piano is inspected by at least two technicians (identified by their employee number). For each separate inspection, the company needs to record its date and a quality evaluation grade.
g. The piano technicians (see 2f) have a hierarchy of reporting relationships: Some of them have supervisory
responsibilities in addition to their inspection role and have multiple other technicians report to them. The supervisors themselves report to the chief technician of the company.
h. A vendor builds multiple types of tablet computers. Each has a type identification number and a name. The key
specifications for each type include amount of storage space and display type. The company uses multiple processor types, exactly one of which is used for a specific tablet computer type; obviously, the same processor can be used in multiple types of tablets. Each processor has a manufacturer and a manufacturer's unique code that identifies it.
i. Each individual tablet computer manufactured by the vendor (see 2h) is identified by the type identification number and a serial number that is unique within the type identification. The vendor wants to maintain information about when each tablet is shipped to a customer.
j. Each of the tablet computer types (see 2h) has a specific operating system. Each technician the company employs is certified to assemble a specific tablet type—operating system combination. The validity of a certification starts on the day the employee passes a certification examination for the combination, and the certification is valid for a specific period of time that varies depending on tablet type—operating system combination.

Answers

Answer:

Explanation:

The underlined traits in the ER chart speak to essential key since they remarkably recognize the quality  

(a)

(I) The level of the given relationship is 2 i.e it is a parallel connection among Book and Publisher. It is a one to numerous relationship from distributer to book in light of the fact that a distributer can distribute any number of books however a book will have only one publisher,so the cardinality will be 1 to 1..* (one to many)

(b)

(i) The degree of the given relationship is 2 i.e it is a binary relationship between Author and Book. It is a many to many relationship from Book to Author a book can be written by one or more authors and an author can write more than one book, so the cardinality will be 1..* to 1..* (many to many)

(c)

(i) As mentioned in part (b), the degree of given relation is 2 and cardinality is many to many (1..* to 1..*)

(d)

(i) The degree of the given relationship is 1 i.e unary relationship. It is a many to many relationship because one book can belong to any sets and a set can have any number of books, so cardinality is 1..* to 1..* (many to many)

Note: attached below is the image of various options to confirm the explanation (answer).

cheers i hope this helped !!!

Program: ASCII art (Python 3)1) Output this tree. 2) Below the tree (with two blank lines), output this cat. (3 pts) /\ /\ o o = = --- Hint: A backslash \ in a string acts as an escape character, such as with a newline \n. So, to print an actual backslash, escape that backslash by prepending another backslash. Ex: The following prints a single backslash: System.out.println("\\");

Answers

The correct format for the output this tree is shown below:

(1) Output this tree

    ×

  ×××

×××××

×××××××

  ×××

(2) The correct format for the Below the tree is shown below:

Below the tree (with two blank lines), output this cat. (3 pts)

  / \        / \

     o     o

 =           =

   -   -   -

Answer:

Explanation:

We are given an Hint that:

A backslash \ in a string acts as an escape character, such as with a newline \n. So, to print an actual backslash, escape that backslash by prepending another backslash.

An Example : The following prints a single backslash: System.out.println("\\");

The main objective here is to use a Java code to interpret the above  (1) Output this tree and  (2) Below the tree.

So Using a Java code to interpret the Program: ASCII art ; we have:

public class AsciiArt {

  public static void main(String[] args) {

      // TODO Auto-generated method stub

 

      //Draw Tree

    System.out.println(" *");

      System.out.println(" ***");

      System.out.println(" *****");

      System.out.println("*******");

      System.out.println(" ***");

      //output cat

      System.out.println();

      System.out.println("/\\\t/\\");

      System.out.println(" o o");

      System.out.println(" = =")

      System.out.println(" ---");

  }

OUTPUT:

SEE THE ATTACHED FILE BELOW.

The program is a sequential program, and does not require loops and conditional statements.

See attachment for the complete program written in Python, where comments are used as explanation

Read more about Python programs at:

https://brainly.com/question/16397886

A computer needs both hardware and to be useful

Answers

Answer:

Software? or a person?

Software. To be fully functional, a computer needs both hardware and software

Which of the following is the final step in the problem-solving process?

Answers

Explanation:

Evaluating the solution is the last step of the problem solving process.

Continue to develop the site content as directed in milestone 4. At this point, at least 3 of the pages for the site should be completed. Use the knowledge gained in this week's lecture and Lab to create a user feedback form. Include all necessary controls (text boxes, radio buttons, check boxes, text areas, dropdown lists, and buttons) to allow the user to effectively interact with the form. You can choose the type of input control for each question, but your feedback form will have at least five feedback questions. Use CSS to control the layout of the form. Include reset and submit buttons with the form. The reset button should clear the form and the submit button should load a "Your information has been received" page. Move all site and page level styles to an external CSS file. Upon completion of this step, zip up all of the files for the site into one single file and submit the file.
Grading Rubric
Category Points % Description
Content completed on at least
three pages 9 20 Content on pages is visible
Form created and CSS used for the layout
of the form 9 20 As per milestone spec
All necessary form controls used
as appropriate 9 20 Required site evaluation options present
Buttons (submit/reset) included 9 20 Submit button linked to form action;
reset clear forms
External CSS file 9 20 Site managed by an external CSS file
Total 45 100 A quality project will meet or exceed
all of the above requirements
Submit your assignment to the Dropbox, located at the top of this page. For instructions on how to use the Dropbox, read these step-by-step instructions.

Answers

Answer:

This is createing a responsive website form for clients.

Explanation:

Using HTML, CSS and JavaScript or python to create an interactive, dynamic website. The html file is used to structure the layout of the website Dom , the CSS, also known as cascaded style sheet is using to style the created web pages. The CSS libraries and frameworks like sass, less and bootstraps can be used for convenience and speed. The JavaScript file is used to manipulate the Dom, creating an interactive site. Python libraries likes flask are used for backend development routing to create dynamic contents and web pages.

Assume the following variable definition appears in a program:
double number = 12.3456;
Write a cout statement that uses the setprecision manipulator and the fixed manipulator to display the number variable rounded to 2 digits after the decimal point. (Assume that the program includes the necessary header file for the manipulators.)

Answers

Answer:

cout << setprecision(2)<< fixed << number;

Explanation:

The above statement returns 12.35 as output

Though, the statement can be split to multiple statements; but the question requires the use of a cout statement.

The statement starts by setting precision to 2 using setprecision(2)

This is immediately followed by the fixed manipulator;

The essence of the fixed manipulator is to ensure that the number returns 2 digits after the decimal point;

Using only setprecision(2) in the cout statement will on return the 2 digits (12) before the decimal point.

The fixed manipulator is then followed by the variable to be printed.

See code snippet below

#include <iostream>  

#include <iomanip>

using namespace std;  

int main()  

{  

// Initializing the double value

double number = 12.3456;  

//Print  result

cout << setprecision(2)<< fixed << number;  

return 0;  

}  

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

Answers

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

Select a classification for File2 so that: Alice can read and write to File2 Bob and Charlie can write to File2, but can't read it. Eve can write to File1 but can't read it. Alice has Top Secret, {A,B,C}. Bob has Secret{A,B}, Charlie has Confidential,{C} and Eve is Unclassified. File2 should be classified as

Answers

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)

In a horse race, the odds that Romance will win are listed as 2 : 3 and that Downhill will win are
1:2. What odds should be given for the event that either Romance or Downhill wins? (3 mks)
QUESTION FOUR​

Answers

Answer:

The odds for the event that either Romance or Downhill wins is 11/4

Explanation:

The odds that Romance will win is 2: 3

The odds that Downhill will win is 1:2

[tex]P(event) = \frac{Odd(event)}{1 + Odd(event)}[/tex]

Where P(event) = Probability that an event occurs

Odd(event) = The odds that an event occurs

Calculate the Probability that Romance wins, P(R):

[tex]P(R) = \frac{2/3}{2/3 + 1} \\P(R) = 2/5[/tex]

Calculate the probability that Downhill wins, P(D):

[tex]P(D) = \frac{1/2}{1/2 + 1} \\P(D) = 1/3[/tex]

Calculate the Probability that either Romance or Downhill wins, P(R or D):

P(R or D) = P(R) + P(D)

P(R or D) = 2/5 + 1/3

P(R or D) = 11/15

[tex]P(R or D) = \frac{Odd(R or D)}{1 + Odd(R or D)} \\\\11/15 = \frac{Odd(R or D)}{1 + Odd(R or D)}\\[/tex]

[tex]\frac{11}{15} + \frac{11}{15}[ Odd(R or D)] = Odd(R or D)\\\\\frac{4}{15}[ Odd(R or D)] = \frac{11}{15}\\\\\\Odd(R or D) = \frac{11}{15} * \frac{15}{4}\\\\Odd(R or D) = 11/4[/tex]

Write a method that computes the sum of the digits in an integer. Use the following method header: public static int sumDigits(long n) For example, sumDigits(234) returns 9 the result of 2 3 4. (Hint: Use the % operator to extract digits, and the / operator to remove the extracted digit. For instance, to extract 4 from 234, use 234 % 10, which is 4. To remove 4 from 234, use 234 / 10, which is 23. Use a loop to repeatedly extract and remove the digit until all the digits are extracted.

Answers

Answer:

The java program for the given scenario is shown below.

import java.util.*;

import java.lang.*;

public class Test

{

   //variables to hold the number, digits and sum of the digits

   //variable to hold number is assigned any random value

   static long num=123;

   static int sum=0;

   static int digit;

   static int s;

   //method to add digits of a number

   public static int sumDigits(long n)

   { do

       {

           digit=(int) (n%10);

           sum=sum+digit;

           n=n/10;

       }while(n>0);

       return sum;

   }

public static void main(String[] args) {

    s = sumDigits(num);

 System.out.println("The sum of the digits of "+num+ " is "+s);  }

}

OUTPUT

The sum of the digits of 123 is 6

Explanation:

1. The variables to hold the number is declared as long and initialized.

2. The variables to store the digits of the number and the sum of the digits are declared as integer. The variable, sum, is initialized to 0.

3. The method, sumDigits(), is defined which takes a long parameter and returns an integer value. The method takes the number as a parameter and returns the sum of its digits.

4. Inside method, sumDigits(), inside the do-while loop, the sum of the digits of the parameter is computed.

5. Inside main(), the method, sumDigits(), is called. The integer value returned by this method is stored in another integer variable, s.

6. The sum of the digits is then displayed to the console.

7. All the variables are declared outside main() and at the class level and hence declared static. The method, sumDigits(), is also declared static since it is to be called inside main().

8. In java, the whole code is written inside a class since java is a purely object-oriented language.

9. In this program, object of the class is not created since only a single class is involved having main() method.

10. The program can be tested for any value of the variable, num.

11. The file is saved as Test.java, where Test is the name of the class having main() method.

software that interprets commands from the keyboard and mouse is also known as the? A. desktop B. Operating system C. operating disk D. hard drive

Answers

Answer:

C

Explanation:

Select the correct order of the chemicals to successfully create the cure. *

Purple=P, Red=R, Orange=O, Yellow=Y, Green=G, Blue=B

Answers

Answer:

Red=R, Yellow=Y, Blue=B, Orange=O, Green=G, Purple=P

Explanation:

Colors of chemical is a physical property which comes from excitation of electrons. The electrons absorbs energy which enables the chemical to change its color. The correct sequence to create cure is to use red, yellow and blue then add gradually the other colored chemicals.

Explain the difference between storage devices and virtual storage

Answers

Answer:

Storage devices tend to be built in/physical pieces of storage such as an SD Card or Hard Drive. Virtual storage is more-so like Cloud storage, where the files are hosted elsewhere.

Explanation:

2-3 Calculating the Body Mass Index (BMI). (Programming Exercise 2.14) Body Mass Index is a measure of health based on your weight. It can be calculated by taking your weight in kilograms and dividing by the square of your height in meters. Write a program that prompts the user to enter a weight in pounds and height in inches and displays the BMI. Note: One pound is 0.45359237 kilograms and one inch is 0.0254 meters. Hint: Convert the pounds entered into kilograms also convert the height in inches into meters Example: If you entered in pounds your weight as 95.5 and your height as 50 inches then the calculated BMI is 26.8573 FYI: BMI < 18.5 is underweight BMI >

Answers

Answer:

weight = float(input("Enter your weight in pounds: "))

height = float(input("Enter your height in inches: "))

weight = weight * 0.45359237

height = height * 0.0254

bmi = weight / (height * height)

print("Your BMI is: %.4f" % bmi)

Explanation:

*The code is written in Python.

Ask the user to enter weight in pounds and height in inches

Convert the weight into kilograms and height into meters using given conversion rates

Calculate the BMI using given formula

Print the BMI

What are the main differences between photo and video formats?

Answers

Answer:

Nothing just the video is series of photos together

Explanation:

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.

Answers

Um idk just answering so I can get a answer for mine

What is one reason to include people who will use a new technology in conversations about technology upgrades for a business?

Answers

Answer:The users would likely know if an upgrade would be necessary or even useful.

First hand user information is often ignored by developers, change managers etc. However, obtaining first hand user input has proven vastly cost effective ,productive and easier to apply . By having early input the actual working interface can be designed so that daily users find it works effectively for them and others they interact with. It can also allow users to effectively aim to break the functionality before a crisis occurs etc. Furthermore by having user input the users will make a greater effort in ensuring the upgrade works seamlessly.

Explanation:

Suppose two computers (A & B) are directly connected through Ethernet cable. A is sending data to B, Sketch the waveform produced by A when “$” is sent. Also mention the OSI layer that is responsible for this.

Answers

Answer:

Physical / Data link layer

Explanation:

If two computers (A & B) are directly connected through Ethernet cable. A is sending data to B, the data would be transmitted if the network is clear but if the network is not clear, the transmission would wait until the network is clear.

The Open Systems Interconnection model (OSI model) has seven layers each with its own function.

The physical layer is the first layer responsible for data transmission over a physical link. The data packets are converted to signals over a transmission media like ethernet cable.

The data link layer is the second layer in the OSI layer responsible for transmission of data packets between nodes in a network. It also provides a way of detecting errors and correcting this errors produced as a result of data transmission.

What color model should Joe use if he will be using an offset printing press?

Answers

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.

This quiz is meant to test your understanding of secure passwords. Click on the title and answer the following questions in the submission box: What are the characteristics of a secure password? Why is phishing harmful?

Answers

Answer:

A secure password has the following characteristics:

long - it should be more than 15 charactersmix of characters - it should composed of letters (uppercase and lowercase), numbers and symbolsdon't use dictionary word - avoid using common words such as "orange", "password"don't use memorable key paths - avoid using the sequential letter or numbers such as "abc123"

Phishing is a kind of social engineering where a cyber criminals  trying to trick the victims to get benefit from them. For example, a cyber criminal can send a phishing email to tell the victims about something wrong with their credit card or bank account and provide a malicious link and persuade the victim to access their fake website that resembles an official bank website.  From there, the victims can send credential info to the cyber criminals without their awareness. Phishing can also be done through phone call. Phishing is harmful as a victim can fall into the trap of disclosing highly critical credential info that incur a huge loss of money.

Other Questions
The progressive goal to implement womens suffrage was accomplished by? SOMEONE PLEASE HELP ME ASAP PLEASE!!! Can someone help me with chinese please please. Find the share radical in the following characters What would be the long and short term impacts we would see in the world if no one in the world used solar panels? Kevin says that lines p and m will eventually intersect.Lines A and B intersect. Plane A contains lines p, m, and n. Line n is horizontal on the plane. Lines p and m are both going in the same direction and are identical. Plane B contains vertical line l which forms a right angle with line n.Is Kevin correct?No, because they are non-coplanar.No, because they are parallel.Yes, because they are perpendicular.Yes, because they are coplanar. ?me no understand help mee Read this sentence. The attorney gave his client sound advice. What is the subject in this sentence? A) gave B) advice C) client D) attorney A school has a track that is made up of a rectangle with two semicircles at each end, as pictured. The perimeter of the track, P, is 395 m. The rectangular part of the track will be covered with grass. The grass comes in pieces that each have an area of 1.35 square metres. Determine the minimum number of pieces of grass required to cover the rectangular part of the track. Sandra is a lawyer. She is working on x number of cases. She gets 8 more cases to work on. She now has more than 29 cases that she is working on. Which inequality could be used to figure out how many cases Sandra is working on? * Answers. 8x > 29 x + 8 29 x - 8 < 29 The speaker in Hughess poem "Democracy" encourages people to bravely stand up for what is right.peacefully support change.patiently wait for equality to come.silently let change take its course. Each student (input) has a unique student ID number (output) . Function or not a function Please who can answer these questions about Identify structure of the following each sentences 3) What major events and atrocities of World War II may haveprompted nations to consider guidelines for protecting human rights?NEED TO KNOW ASAP PLEAE HELP ? A patient in her mid-twenties saw an ophthalmologist for a routine eye exam. Due to her young age, a glaucoma est was not performed. She later was diagnosed with glaucoma and sued the ophthalmology group, alleging negligence in failing to preform a glaucoma test. The defense argued hat the standard of care was to not administer the test to patients younger than 40 because the instance of glaucoma at younger ages was rare. Which of the following statements do you think best describes the applicable standard of care in this case? 1. The defense should prevail because the reasonable, customary, and prudent course of action followed by practitioners in the same or similar circumstances would be the same. 2. The plaintiff should prevail because all patients should be protected against glaucoma, regardless of age. A company purchased a commercial dishwasher by paying cash of $4,600. The dishwasher's fair value on the date of the purchase was $4,980. The company incurred $420 in transportation costs, $350 installation fees, and paid a $250 fine for illegal parking while the dishwasher was being delivered. For what amount will the company record the dishwasher?A company purchased a commercial dishwasher by paying cash of $4,600. The dishwasher's fair value on the date of the purchase was $4,980. The company incurred $420 in transportation costs, $350 installation fees, and paid a $250 fine for illegal parking while the dishwasher was being delivered. For what amount will the company record the dishwasher? Why was the second fugitive law enacted?... please answer I will give you brainiest Use the formula above to find the Celsius temperature equivalent to 185F. A. 85C B. 153C C. 102C D. 68C at what point does the external energy enter the system? You have 120 feet of fencing for a garden. The fencing is sold in 5-foot sections. What is the area of the largest garden you can build? The following question refers the novel the three musketeers by Alexandra Dumas