Consider a load-balancing algorithm that ensures that each queue has approximately the same number of threads, independent of priority. How effectively would a priority-based scheduling algorithm handle this situation if one run queue had all high-priority threads and a second queue had all low-priority threads

Answers

Answer 1

Answer and Explanation:

Consider giving greater priority to both the queue contains the national priority comment section as well as, therefore, first method the thread throughout this queue.If the item from either the major priority queue becomes decoupled, if the balancing between some of the number of comments in some of these two queues becomes disrupted, instead decouple one thread from either the queue comprising the low-value thread as well as position that one in the queue with the highest - priority loop to match the number of connections in such 2 queues.Whenever a new thread arrives with some kind of proper description, a friendly interface could've been introduced to just the queue contains fewer threads to achieve stability.

Therefore, the load-balancing requirements for keeping about the same number of threads would be retained and the meaningful matter of top priority thread would also be retained.

Answer 2

Based on the information given, it is important to give higher priority to the queue that contains the high priority thread.

Also, once an element from the high priority queue is dequeued, then dequeue one thread from the queue containing low priority thread and this will be enqueued into the queue having high priority thread in order to balance the number of threads.

Since the priority queue automatically adjusts the thread, hence the removal of the thread from one priority queue to another is not a problem.

Learn more about threads on:

https://brainly.com/question/8798580


Related Questions

An introduction to object-oriented programming.
Write a GUI program named EggsInteractiveGUI that allows a user to input the number of eggs produced in a month by each of five chickens. Sum the eggs, then display the total in dozens and eggs. For example, a total of 127 eggs is 10 dozen and 7 eggs.

Answers

Answer:

The csharp program is given below.

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using System.Windows.Forms;

namespace WindowsFormsApplication1

{

   public partial class Form1 : Form

   {

       public Form1()

       {

           InitializeComponent();

      }

       private void button6_Click(object sender, EventArgs e)

       {

           int total = (Convert.ToInt32(textBox1.Text) +  Convert.ToInt32(textBox2.Text) + Convert.ToInt32(textBox3.Text) + Convert.ToInt32(textBox4.Text) + Convert.ToInt32(textBox5.Text));

           int dozen = total / 12;

           int eggs = total % 12;

           textBox6.Text = dozen.ToString();

           textBox7.Text = eggs.ToString();

       }

       private void button7_Click(object sender, EventArgs e)

       {

           textBox1.Text = "";

           textBox2.Text = "";

           textBox3.Text = "";

           textBox4.Text = "";

           textBox5.Text = "";

           textBox6.Text = "";

           textBox7.Text = "";

       }

        private void button8_Click(object sender, EventArgs e)

       {

           Close();

       }

    }

}

Explanation:

1. The integer variables are declared for total eggs, number of dozens and number of eggs.

2. The input of each text box is converted into integer by using the Convert.ToInt32() method on the value of that particular text box.

3. All the inputs are added and the sum is assigned to variable, total.

4. The number of dozens are obtained by dividing total by 12 and assigning the value to the variable, dozen.

5. The number of extra eggs are obtained by taking the modulus of total and 12 and the value is assigned to the variable, eggs.

6. The integer values in the variables, dozen and eggs, are converted into string using the ToString() function with that particular value.

dozen.ToString();

eggs.ToString();

7. The text boxes are assigned the respective values of dozens and number of eggs.

textBox6.Text = dozen.ToString();

textBox7.Text = eggs.ToString();

8. Two additional buttons, clear and exit, are also added.

9. The clear button erases the contents of all the text boxes. The Text property of each textbox is set to “” thereby clearing all the text fields.

10. The exit button closes the application using Close() function.

11. The program is made in visual studio and the output is attached.

Create a Python program that: Allows the user to enter a person's first name and last name. The user should be able to enter as many names as they desire. Create a function that takes the first name and last name, puts them together with the last name first, followed by the first name; with the names separated by commas. Take the result from the function, and place the resulting name in a list. Once the user finishes entering names, sort the contents of the list. Write the sorted names from a list into a text file. When you create the text file, allow the user to enter a name for the file to be created. After you finish writing names to the file, close the file and end the program.

Answers

Answer:

#main function start

def main():

#list to store names entered by user

name_list=[]

#variable to take input from user to keep rotating the loop and take input from user again and again

ch='y'

fname=""

lname=""

while ch=='y' or ch=='Y':#keep the loop taking input from user till user do not want to enter more

#take input from user

name=[]

fname=input("Enter first name: ")

lname=input("Enter last name: ")

name.append(fname)

name.append(lname)

 

#append the previously input first and last name in main list

name_list.append(name)

ch=input("Do you want to continue: (y/Y for yes)")

#main function end

#get file name from user

filename=input("Enter output file name")

#open file in write mode

file=open(filename,"w")

#keep loop add data in file till main list 'name_list' have

for i in name_list:

#Write data in file

file.write("%s, %s\r\n" % (i[0],i[1]))

#close the file

file.close()

#call main function

main()

Explanation:

input the above code and see output

Array A is not a heap. Clearly explain why does above tree not a heap? b) Using build heap procedure discussed in the class, construct the heap data structure from the array A above. Represent your heap in the array A as well as using a binary tree. Clearly show all the steps c) Show how heap sort work in the heap you have constructed in part (b) above. Clearly show all the step in the heap sort

Answers

Answer:

Sorted Array A { } = { 1, 4, 23, 32, 34, 34, 67, 78, 89, 100 }

Explanation:

Binary tree is drawn given that the binary tree do not follow both minimum heap and maximum heap property, therefore, it is not a heap.

See attached picture.

Part 1: For this assignment, call it assign0 Implement the following library and driver program under assign0: Your library will be consisting of myio.h and myio.c. The function prototypes as well as more explanations are listed in myio.h. Please download it and accordingly implement the exported functions in myio.c. Basically, you are asked to develop a simple I/O library which exports a few functions to simplify the reading of an integer, a double, and more importantly a string (whole line). In contrast to standard I/O functions that can read strings (e.g., scanf with "%s", fgets) into a given static size buffer, your function should read the given input line of characters terminated by a newline character into a dynamically allocated and resized buffer based on the length of the given input line. Also your functions should check for possible errors (e.g., not an integer, not a double, illigal input, no memory etc.) and appropriately handle them. Then write a driver program driver.c that can simply use the functions from myio library. Specifically, your driver program should get four command-line arguments: x y z output_filename. It then prompts/reads x many integers, y many doubles, and z many lines, and prints them into a file called output_filename.txt. Possible errors should be printed on stderr.

myio.h file

/*
* File: myio.h
* Version: 1.0
* -----------------------------------------------------
* This interface provides access to a basic library of
* functions that simplify the reading of input data.
*/

#ifndef _myio_h
#define _myio_h

/*
* Function: ReadInteger
* Usage: i = ReadInteger();
* ------------------------
* ReadInteger reads a line of text from standard input and scans
* it as an integer. The integer value is returned. If an
* integer cannot be scanned or if more characters follow the
* number, the user is given a chance to retry.
*/

int ReadInteger(void);

/*
* Function: ReadDouble
* Usage: x = ReadDouble();
* ---------------------
* ReadDouble reads a line of text from standard input and scans
* it as a double. If the number cannot be scanned or if extra
* characters follow after the number ends, the user is given
* a chance to reenter the value.
*/

double ReadDouble(void);

/*
* Function: ReadLine
* Usage: s = ReadLine();
* ---------------------
* ReadLine reads a line of text from standard input and returns
* the line as a string. The newline character that terminates
* the input is not stored as part of the string.
*/

char *ReadLine(void);

/*
* Function: ReadLine
* Usage: s = ReadLine(infile);
* ----------------------------
* ReadLineFile reads a line of text from the input file and
* returns the line as a string. The newline character
* that terminates the input is not stored as part of the
* string. The ReadLine function returns NULL if infile
* is at the end-of-file position. Actually, above ReadLine();
* can simply be implemented as return(ReadLineFile(stdin)); */

char *ReadLineFile(FILE *infile);

#endif

Answers

Answer:

Explanation:

PROGRAM

main.c

#include <fcntl.h>

#include <stdio.h>

#include <stdlib.h>

#include <sys/stat.h>

#include <sys/types.h>

#include <unistd.h>

#include "myio.h"

int checkInt(char *arg);

int main(int argc, char *argv[]) {

  int doubles, i, ints, lines;

  char newline;

  FILE *out;

  int x, y, z;

  newline = '\n';

  if (argc != 5) {

     printf("Usage is x y z output_filename\n");

     return 0;

  }

  if (checkInt(argv[1]) != 0)

     return 0;

  ints = atoi(argv[1]);

  if (checkInt(argv[2]) != 0)

     return 0;

  doubles = atoi(argv[2]);

  if (checkInt(argv[3]) != 0)

     return 0;

  lines = atoi(argv[3]);

  out = fopen(argv[4], "a");

  if (out == NULL) {

     perror("File could not be opened");

     return 0;

  }

  for (x = 0; x < ints; x++) {

     int n = ReadInteger();

     printf("%d\n", n);

     fprintf(out, "%d\n", n);

  }

  for (y = 0; y < doubles; y++) {

     double d = ReadDouble();

     printf("%lf\n", d);

     fprintf(out, "%lf\n", d);

  }

  for (z = 0; z < lines; z++) {

     char *l = ReadLine();

     printf("%s\n", l);

     fprintf(out, "%s\n", l);

     free(l);

  }

  fclose(out);

  return 0;

}

int checkInt(char *arg) {

  int x;

  x = 0;

  while (arg[x] != '\0') {

     if (arg[x] > '9' || arg[x] < '0') {

        printf("Improper input. x, y, and z must be ints.\n");

        return -1;

     }

     x++;

  }

  return 0;

}

myio.c

#include <limits.h>

#include <stdio.h>

#include <stdlib.h>

#include <unistd.h>

char *ReadInput(int fd) {

  char buf[BUFSIZ];

  int i;

  char *input;

  int r, ret, x;

  i = 1;

  r = 0;

  ret = 1;

  input = calloc(BUFSIZ, sizeof(char));

  while (ret > 0) {

     ret = read(fd, &buf, BUFSIZ);

   

     for (x = 0; x < BUFSIZ; x++) {

        if (buf[x] == '\n' || buf[x] == EOF) {

           ret = -1;

           break;

        }

        input[x*i] = buf[x];

        r++;

     }

   

     i++;

   

     if (ret != -1)

        input = realloc(input, BUFSIZ*i);

  }

  if (r == 0)

     return NULL;

  input[r] = '\0';

  input = realloc(input, r+1);

  return(input);

}

int ReadInteger() {

  char *input;

  int go, num, x;

  go = 0;

  do {

     go = 0;

   

     printf("Input an integer\n");

     input = ReadInput(STDIN_FILENO);

     for (x = 0; x < INT_MAX; x++) {

        if (x == 0&& input[x] == '-')

           continue;

        if (input[x] == 0)

           break;

        else if (input[x]> '9' || input[x] < '0') {

           go = 1;

           printf("Improper input\n");

           break;

        }

    }

  } while (go == 1);

  num = atoi(input);

  free(input);

  return num;

}

double ReadDouble(void) {

  int dec, exp;

  char *input;

  int go;

  double num;

  int x;

  do {

     go = 0;

     dec = 0;

     exp = 0;

   

     printf("Input a double\n");

     input = ReadInput(STDIN_FILENO);

     for (x = 0; x < INT_MAX; x++) {

        if (x == 0&& input[x] == '-')

           continue;

        if (input[x] == 0)

           break;

        else if (input[x] == '.' && dec == 0)

           dec = 1;

        else if (x != 0&& (input[x] == 'e' || input[x] == 'E') && exp == 0) {

           dec = 1;

           exp = 1;

        }

        else if (input[x]> '9' || input[x] < '0') {

           go = 1;

           printf("Improper input\n");

           break;

        }

     }

  } while (go == 1);

  num = strtod(input, NULL);

  free(input);

  return num;

}

char *ReadLine(void) {

  printf("Input a line\n");

  return(ReadInput(STDIN_FILENO));

}

char *ReadLineFile(FILE *infile) {

  int fd;

  fd = fileno(infile);

  return(ReadInput(fd));

}

myio.h

#ifndef _myio_h

#define _myio_h

/*

* Function: ReadInteger

* Usage: i = ReadInteger();

* ------------------------

* ReadInteger reads a line of text from standard input and scans

* it as an integer. The integer value is returned. If an

* integer cannot be scanned or if more characters follow the

* number, the user is given a chance to retry.

*/

int ReadInteger(void);

/*

* Function: ReadDouble

* Usage: x = ReadDouble();

* ---------------------

* ReadDouble reads a line of text from standard input and scans

* it as a double. If the number cannot be scanned or if extra

* characters follow after the number ends, the user is given

* a chance to reenter the value.

*/

double ReadDouble(void);

/*

* Function: ReadLine

* Usage: s = ReadLine();

* ---------------------

* ReadLine reads a line of text from standard input and returns

* the line as a string. The newline character that terminates

* the input is not stored as part of the string.

*/

char *ReadLine(void);

/*

* Function: ReadLine

* Usage: s = ReadLine(infile);

* ----------------------------

* ReadLineFile reads a line of text from the input file and

* returns the line as a string. The newline character

* that terminates the input is not stored as part of the

* string. The ReadLine function returns NULL if infile

* is at the end-of-file position. Actually, above ReadLine();

* can simply be implemented as return(ReadLineFile(stdin)); */

char *ReadLineFile(FILE *infile);

In which situations would it be most helpful to filter a form? Check all that apply.

Answers

Filtering is a useful way to see only the data that you want displayed in Access databases.

The new Director of Information Technology has asked you to recommend a strategy to upgrade the servers on their network. Recommendations on server hardware, CPU chip set, speed, and caching are needed. You should also recommend which servers to upgrade first and determine whether any servers are still appropriate to keep.

Answers

Answer:

servers to be upgraded are : APPLICATION AND LOAD BALANCING SERVERS

servers still appropriate to use : DNS AND DHCP SERVERS

Explanation:

The recommendations to be made in line with what the new director of information is asking for includes :

1 ) For the servers to be upgraded : The servers that requires upgrades  includes the APPLICATION SERVER and LOAD BALANCING SERVER. this is because these two servers are critical to the growth/expansion of any business, and they handle large volume of data

Recommendations on the servers upgrade includes:

Hardware : 2.3 GHz Intel Xeon Gold 5118 12-Core

CPU chip set :  Socket: FCLGA3647, Type: NSBM

Speed : processor 3.2 GHz

caching:   > 100 Gb

2)  For servers that do not necessarily need to be upgraded : The servers that do not need immediate upgrade are DNS and DHCP

A number of LC-3 instructions have an "evaluate address" step in the instruction cycle, in which a 16-bit address is constructed and written to the Memory Address Register via the MARMUX. List all LC-3 instructions that write to the MAR during the evaluate address phase of the instruction cycle, with the Register Transfer description of each.

Answers

Answer: you want to list all LC structers

Explanation:

public class Student {
private String getFood() {
return "Pizza";
}
public String getInfo() {
return this.getFood();
}
}
public class GradStudent extends Student {
private String getFood() {
return "Taco";
}
public void teach(){
System.out.println("Education!");
getInfo();
}
}
What is the output from this:

Student s1 = new GradStudent();
s1.teach();
Education! would be printed, followed by a run-time error when getInfo is called.

Education! Pizza

This code won't run because it won't compile.

Education! Taco

This code causes a run-time error because getInfo is not declared in the GradStudent class.

Answers

Answer:

getInfo(); ==

getSy.Info()

Explanation:

Get System Info

Python high school assignment: please keep simpleIn pythonInstructionsUse the following initializer list:w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]Write a loop that prints the words in uppercase letters.Sample RunALGORITHMLOGICFILTERSOFTWARENETWORKPARAMETERSANALYZEALGORITHMFUNCTIONALITYVIRUSES

Answers

Answer:

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in range (len(w)):

   print(w[i].upper())

Explanation:

every element needs to be upper cased

A loop that prints the words in uppercase letters is written below with the help of Python.

What is a function?

Simply said, a function is a "chunk" of code that you may reuse repeatedly so instead of having to write it out several times. Software developers can divide an issue into smaller, more manageable parts, which can each carry out a specific task, using functions.

A function, according to a technical definition, is a relationship between an amount of parameters and a set of potential outputs, where every other input is connected to precisely one output.

All the functions are to be written in uppercase:

w = ["Algorithm", "Logic", "Filter", "Software", "Network", "Parameters", "Analyze", "Algorithm", "Functionality", "Viruses"]

for i in range (len(w)):

  print(w[i].upper())

Learn more about function, Here:

https://brainly.com/question/29050409

#SPJ5

Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
if (userNum > 0)
printf("Positive.\n");
else
printf("Non-positive, converting to 1.\n");
user Num = 1;
printf("Final: %d\n", userNum);
1 #include Hem
int main(void) {
int userNum;
scanf("%d", &userNum);
return 0;

Answers

Answer:

Given

The above lines of code

Required

Rearrange.

The code is re-arrange d as follows;.

#include<iostream>

int main()

{

int userNum;

scanf("%d", &userNum);

if (userNum > 0)

{

printf("Positive.\n");

}

else

{

printf("Non-positive, converting to 1.\n");

userNum = 1;

printf("Final: %d\n", userNum);

}

return 0;

}

When rearranging lines of codes. one has to be mindful of the programming language, the syntax of the language and control structures in the code;

One should take note of the variable declarations and usage

See attachment for .cpp file

Consider the following skeletal C-like program:
void fun1(void); /* prototype */
void fun2(void); /* prototype */
void fun3(void); /* prototype */
void main() {
int a, b, c;
. . .
}
void fun1(void) {
int b, c, d;
. . .
}
void fun2(void) {
int c, d, e;
. . .
}
void fun3(void) {
int d, e, f;
. . .
}
Given the following calling sequences and assuming that dynamic scoping is used, what variables are visible during execution of the last function called? Include with each visible variable the name of the function in which it was defined
a. main calls funl; funl calls fun2; fun2 calls fun3
b. main calls fun1; fun1 calls fun3
c. main calls fun2; fun2 calls fun3; fun3 calls funl
d. main calls fun1; funl calls fun3; fun3 calls fun2.

Answers

Answer:

In dynamic scoping the current block is searched by the compiler and then all calling functions consecutively e.g. if a function a() calls a separately defined function b() then b() does have access to the local variables of a(). The visible variables with the name of the function in which it was defined are given below.

Explanation:

a. main calls fun1; fun1 calls fun2; fun2 calls fun3

Solution:

Visible Variable:  d, e, f         Defined in: fun3Visible Variable: c                  Defined in: fun2 ( the variables d and e of fun2 are not visible)Visible Variable: b                  Defined in: fun1 ( c and d of func1 are hidden)Visible Variable: a                  Defined in: main (b,c are hidden)

b. main calls fun1; fun1 calls fun3

Solution:

Visible Variable:  d, e, f          Defined in: fun3 Visible Variable:  b, c              Defined in: fun1 (d not visible)Visible Variable:  a                 Defined in: main ( b and c not visible)

c. main calls fun2; fun2 calls fun3; fun3 calls fun1

Solution:

Visible Variable:  b, c, d         Defined in: fun1 Visible Variable:  e, f              Defined in: fun3 ( d not visible)Visible Variable:  a                 Defined in: main ( b and c not visible)

Here variables c, d and e of fun2 are not visible .

d. main calls fun1; fun1 calls fun3; fun3 calls fun2

Solution:

Visible Variable: c, d, e        Defined in: fun2Visible Variable:  f                Defined in: fun3 ( d and e not visible)Visible Variable:  b              Defined in: fun1 ( c and d not visible)Visible Variable: a                Defined in: main ( b and c not visible)

Consider a recurrent neural network that listens to a audio speech sample, and classifies it according to whose voice it is. What network architecture is the best fit for this problem

Answers

Answer:

Many-to-one (multiple inputs, single output)

Explanation:

Solution

In the case of a recurrent neural network that listens to a audio speech sample, and classifies it according to whose voice it is, the RNN will listen to the audio and will give result by doing classification.

There will be a single output, for the classified or say identified person.

The RNN will take a stream of input as the input is a audio speech sample.

Therefore, there will be multiple inputs to the RNN and a single output, making the best fit Architecture to be of type Many-to-one(multiple inputs, single output).

What program is best for teaching young people code?

Answers

I’d probably say scratch, Its great for young people to learn how to code. Lots of things you can do and make with it.

WRITTEN INTERVIEW QUESTIONS
Doctoral candidates should provide an authentic personal statement to each of the five following questions/prompts reflecting on their own personal interest. In the event that any outside resources are used, resources should be cited in APA format. Submissions should be a maximum of 500 words or 125 words per question/prompt. It is best to response to each prompt/question individually for clarity of the reviewer. Writing sample should be submitted in Microsoft Word format and include candidate’s name.
PhD IT
1. Tell us about yourself and your personal journey that has lead you to University of the Cumberlands.
2. What are your research interests in the area of information technology? How did you become interested in this area of research?
3. What is your current job/career and how will this program impact your career growth?
4. What unique qualities do you think you have that will help you in being successful in this program?
5. How can obtaining a doctorate impact your contribution to the practices of information technology? Where do you see yourself after obtaining a doctorate from UC?

Answers

Explanation:

1. I grew up in a small community and my family owned a small business which involved manual labor. Although, having little income, my Dad sought to give us the best education he could afford from his little savings. With the small family savings I went to college where I studied Information Technology, after graduating I worked for a startup firm for two years before I decided to proceed with post graduate studies and I attained my Masters in UA. I met a friend who recommended I study in University of Cumberlands, I hesitated initially but was convinced after I researched the institution.

2. I'm particularly interested in the applications of information technology in labor intensive businesses and work because of my family background.

3. I have my own startup firm that designs work communication software for companies, however I intend to broaden my knowledge through this program into Information Technology based systems using machine learning algorithm.

4. I am committed to work and study, as some have called me a curious mind because of my passion towards learning.

5. I view obtaining a doctorate as not just a personal achievement but of lasting benefits to society as I use knowledge derived to improve the work experience of society.

I am confident that after my program I would be one the renowned contributors to the applications of information technology in labor intensive businesses.

A/an ____ file saves a workbook as a comma-delimited text file for use on another windows operating system??

A. XPS
B. TXT
C. ODS
D. CVS

Answers

Answer:

The correct option is D

D) CVS

Explanation:

A CVS file saves a workbook as a comma-delimited text file for use on another windows operating system. It ensures that line breaks, tab characters and other characteristics are interpreted correctly.

A CVS file stands for Comma Separated Value file, which basically allows the data to be saved in tabular format. However they differ from other spreadsheet file types because you can only have a single sheet in a file. Moreover, you cannot save cell, column or row in it.

Charles Montesquieu believed that the
Legislative Branch should do what?
A. Make laws
B. Enforce laws
C. Interpret laws
elles sone. All Rights Resed.​

Answers

Answer:

A. Make Laws

Explanation:

Montesquieu believed the ways to go about limiting the power of a monarch would be to split up power among 3 groups, Judicial, Legislative and Executive. The American Presidential system and Constitution used Montesquieu's writings as a foundation for their principles.

Judicial Interprets lawsLegislative Makes lawsExecutive Enforces Law

A. make laws ........ sorry for all the dots have to make it longer :/

Create a program that asks the user to enter grade scores. Use a loop to request each score and add it to a total. Continue accepting scores until the user enters a negative value. Finally, calculate and display the average for the entered scores.

Answers

Answer:

total = 0

count = 0

while(True):

   grade = float(input("Enter a grade: "))

   if grade < 0:

       break

   else:

       total += grade

       count += 1

       

average = total/count

print("The average is: " + str(average))

Explanation:

*The code is in Python.

Initialize the total and count as 0

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

Inside the loop, ask the user to enter a grade. If the grade is smaller than 0, stop the loop. Otherwise, add the grade to the total and increment the count by 1.

When the loop is done, calculate the average, divide the total by count, and print it

Write a program that lets the Michigan Popcorn Company keep track of their sales for seven different types of popcorn they produce: plain, butter, caramel, cheese, chocolate, turtle and zebra. It should use two parallel seven-element arrays: an array of strings that holds the seven popcorn names and an array of integers that holds the number of bags of popcorn sold during the past month for each popcorn flavor. The names should be stored using an initialization list at the time the flavors array is created. The program should prompt the user to enter the number of bags sold for each flavor. Once the popcorn data has been entered, the program should produce a report for each popcorn type, total sales, and the names of the highest selling and lowest selling products. Be sure to include comments throughout your code where appropriate. Complete the C++ code using Visual Studio or Xcode, compress (zip) and upload the entire project folder to the Blackboard assignment area by clicking on the Browse My Computer button or by dragging the file inside the Attach Files box g

Answers

Answer:

#include <iostream>using namespace std;int main(){    // declare and initialize popcorn name array    string popcorn_name[7] = {"plain", "butter", "caramel", "cheese", "chocolate", "turtle", "zebra"};    // declare and initialize sales array with 7 elements    int sales[7];        // A loop to prompt user to enter sales for each popcorn    for(int i=0; i < 7; i++){        cout<<"Enter number of sales for " + popcorn_name[i] + " :";        cin>>sales[i];    }        // Find maximum sales    int max = sales[0];    int maxIndex = 0;    for(int j=1; j < 7; j++){        if(max < sales[j]){            max = sales[j];            maxIndex = j;        }    }        // Find minimum sales    int min = sales[0];    int minIndex = 0;    for(int k=1; k < 7; k++){        if(min > sales[k]){            min = sales[k];            minIndex = k;        }    }        // Print popcorn name and sales    for(int l=0; l < 7 ; l++){        cout<<popcorn_name[l]<<"\n";        cout<<"Sales: "<< sales[l]<<"\n\n";    }        // Print popcorn name with maximum and minimum sales    cout<<"Highest selling: "<< popcorn_name[maxIndex]<<"\n";    cout<<"Lowest selling: "<<popcorn_name[minIndex]<<"\n";    return 0;}

Explanation:

Create two arrays to hold the list of popcorn name and their sales (Line 5-8). Next prompt user to input the sales for each popcorn (Line 10-14). Get the maximum sales of the popcorn (Line 17-24) and minimum sales (Line 27-34). Print the popcorn name and sales (Line 37-40) and the popcorn name with highest and lowest selling (Line 43-44).

In 1987, Congress passed the Computer Security Act (CSA). This was the first law to address federal computer security. Under the CSA, every federal agency had to inventory its IT systems. Agencies also had to create security plans for those systems and review their plans every year.
A. True
B. False

Answers

Answer:

A.) True is the answer hope it helps

Compute -ABE16-DF416 using 15’s complement

Answers

Answer:

33600

Explanation:

Let M = ABE16

and N = DF416

In hexadecimal representation: 10 = A, 11 = B, 12 = C, 13 = D, 14 = E, 15 = F

Step 1: Find the 15's complement of N

 F  F  F  F  F

- D  F  4  1  6

2  0  B  E  9

Step 2: Add 15's complement of N to M

  A  B  E  1  6

+ 2  0  B  E  9  

  C  C  9  F  F

Step 3: Find the 15's complement of CC9FF

 F  F   F  F  F

- C  C  9  F  F

 3   3  6  0  0

Therefore, ABE16 - DF416 using 15's complement is 33600

The following numbers are inserted into a linked list in this order:
10, 20, 30, 40, 50, 60
What would the following statements display?
pCur = head->next;
cout << pCur->data << " ";
cout << pCur->next->data << endl;
a) 20 30
b) 40 50
c) 10 20
d) 30 40

Answers

Answer:

A. 20 30

Explanation:

Given

Linked list: 10, 20, 30, 40, 50, 60

Required

The output of the following code segment

pCur = head->next;

cout << pCur->data << " ";

cout << pCur->next->data << endl;

A linked list operates by the use of nodes which begins from the head to the next node, to the next, till it reaches the last;

The first line of the code segment; "pCur = head->next; " shifts the node from the head to the next node

The head node is the node at index 0 and that is 10;

This means that the focus has been shifted to the next at index 1 and that is 20;

So, pCur = 20

The next line of the code segment; cout << pCur->data << " "; prints pCur and a blank space

i.e. "20 " [Take note of the blank space after 20]

The last line "cout << pCur->next->data << endl; " contains two instructions which are

1. pCur = next->data;

2. cout<<pCur->data;

(1) shifts focus to the next node after 20 ; This gives pCur = 30

(2) prints the value of pCur

Hence, the output of the code segment is 20 30

Write a program that reads a list of words. Then, the program outputs those words and their frequencies. Ex: If the input is: hey hi Mark hi mark the output is: hey 1 hi 2 Mark 1 hi 2 mark 1

Answers

Answer:

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

Explanation:

This program that we are told to write will be done by using python programming language/ High-level programming language.

The question wants us to write a program in which the output will be as below;

hey 1

hi 2

Mark 1

hi 2

mark 1

Just by imputing hey hi mark hi mark.

Just copy and run the code below.

#Declare variable to get the input

#list from the user

input_list = input()

#split the list into words by space

list = input_list.split()

#Begin for-loop to iterate each word

#to get the word frequency

for word in list:

#get the frequency for each word

frequency=list.count(word)

#print word and frequency

print(word,frequency)

In this exercise we have to use the knowledge in computational language in python to write the following code:

We have the code can be found in the attached image.

So in an easier way we have that the code is

input_list = input()

list = input_list.split()

for word in list:

frequency=list.count(word)

print(word,frequency)

See more about python at brainly.com/question/18502436

You acquire a network vulnerability-scanning tool and try it out on a network address segment belonging to people at your university of business. The scanner identifies one computer named Prince Hal that has many serious vulnerabilities. You deduce to whom the machine belongs. Explain the ethical implication of:________.
a. telling the owner what you have found,
b. telling you local administrator or security officer what you have found
c. exploiting one of the relatively minor vulnerabilities to show the owner how serious the exposure is
d. exploiting a relatively minor vulnerability as a prank without telling the owner,
e. telling the owner what you have found and the demanding money for details on the vulnerabilities
f. using one of the vulnerabilities to acquire control of the machine, downloading and installing patches and changing settings to address all the vulnerabilities, and never telling anyone what you have done.

Answers

Answer and Explanation:

The speculates on either the morality of transmitting vulnerabilities to an individual over all the internet. The node is a very possible target of a criminal charge, these are highly recommended in terms of the problem not just ethical.The question argues the etiquette of telling a compromised network infrastructure to something like a domain admins or security guard. Throughout this case the primary admin issue is power. Informing individuals about both the potential problem is prudent or legal, which is also preferable to recommend the future course of action.The speculates on either the moral values of leveraging the infrastructure for a mild vulnerability. This same proprietor including its node is truly likely to be victims of a prospective infringement, and therefore it is advantageous to notify him including its problem that the equitable access is considered to become an ethical manipulate susceptibility for possessor data as well as potential threats to understanding.The theories a small flaw throughout the channel's ethics. The device's leader is the likely guilty party of even a future offense to notify him of both the actual problem. The law is ridiculous as well as comparable to trying to hack without permission vulnerability it's immoral vulnerability.The content upon the ethical principles of manipulating the channel's small susceptibility. The device's owner seems to be the likely casualty of such a future offense to instruct him including its subject. As well as trying to sell him much farther documents socially responsible borders. It's the holder who has so far notified the weakness she perhaps she has just one option to obtain products and services. Having clear data on the sale still seems to be ethical.The issue argues mostly on ethics with repairing security flaws without channel assent. Although the controlled variable of the modules has been the true likely target of such a future infringement, exploiting susceptibility without permission is appropriate as well as unethical, this same objective being honorable as well as noble.

Convert each of the following for loops into an equivalent while loop. (You might need to rename some variables for the code to compile, since all four parts a-d are in the same scope.)

// a.

System.out.println("a.");
int max = 5;
for (int n = 1; n <= max; n++) {

System.out.println(n);

}

System.out.println();

// b.

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

int total = 25;

for (int number = 1; number <= (total / 2); number++) {

total = total - number;

System.out.println(total + " " + number);

}

System.out.println();

// c.

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

for (int i = 1; i <= 2; i++) {

for (int j = 1; j <= 3; j++) {

for (int k = 1; k <= 4; k++) {

System.out.print("*");

}

System.out.print("!");

}

System.out.println();

}

System.out.println();

// d.

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

int number = 4;

for (int count = 1; count <= number; count++) {

System.out.println(number);

number = number / 2;

}

Answers

Answer:

~CaptnCoderYankee

Don't forget to award brainlyest if I got it right!

Write a program that keeps track of where cars are located in a parking garage to estimate the time to retrieve a car when the garage is full. This program will demonstrate the following:_________.
How to create a list for use as a stack,
How to enter and change data in a stack.

Answers

Answer: Provided in the explanation section

Explanation:

Code to use;

# Define the main() function.

def main():

   # Declare the required variables.

   stack_cars = []

   move_time = 1

   retrieve_time = 2

   # Start the loop to display the menu.

   while True:

       # Display the choices to the user.

       print("\n\t\t\t Car Stack Menu")

       print("\n1. Add a car")

       print("2. Retrieve a car")

       print("3. Show the car stack")

       print("4. Exit")

       # Prompt the user to enter the input.

       choice = input("\nEnter your choice: ")

       # Append the car in the stack if the choice is 1.

       if choice == '1':

           car = input("Enter the car name to add: ")

           stack_cars.append(car)

       

       # Remove the car from the stack if the choice is 2.

       elif choice == '2':

           car = input("Enter the car name to retrieve: ")

           # Display the error message if the car is not present.

           if car not in stack_cars:

               print(car + " is not present in the stack.")

           # Otherwise, compute the time to retrieve a car.

           else:

               # Declare a temp stack to move the cars.

               temp = []

               x = stack_cars.pop()

               count = 0

               # Start the loop to pop the cars from the stack

               # until the car to be retrieved is found.

               while x != car:

                   count += 1

                   # Store the car in the temp stack.

                   temp.append(x)

                   x = stack_cars.pop()

               # Start the loop to move the cars back in the

               # original stack.

               while len(temp) != 0:

                   stack_cars.append(temp.pop())

               # Compute and display the total time.

               total_time = move_time * count + retrieve_time

               print("Total time to retrieve", car, "=", total_time)

       

       # Display the stack if the choice is 3.

       elif choice == '3':

           print("Car stack =", stack_cars)

       # Return from the funtion if the choice is 4.

       elif choice == '4':

           print("Exiting from the program...")

           return

       

       # Display the message for invalid input.

       else:

           print("Error: Invalid choice!")

# Call the main() function.

if __name__ == "__main__":

   main()

In addition to compiling the list of user access requirements, applications, and systems, the BIA also includes processes that are ____________. These processes safeguard against any risks that might occur due to key staff being unavailable or distracted.

Answers

Answer:

automated

Explanation:

Basically a Business Impact Analysis (BIA) estimates and determines the effects of a business activity and process disturbances. These disruptions can be natural or electronic disasters. It also collects information which is used to establish recovery plan. It identifies the business vulnerabilities and works on the strategies in order to reduce such potential hazards. The BIA involves both manual and automated processes. BIA involves automated processes which include the automated software tools that enables the protection of the confidential information of the users and also generates automated reports about the critical business processes.

A vSphere Administrator is receiving complaints a database VM is experiencing performance issues. The VM is a member of the high priority resource pool and the cluster has not experienced contention.
Which condition should be checked to address immediate performance concerns?
A. VM snapshots
B. VMFS version
C. Resource Pool share value
D. Configured CPU shares

Answers

Answer:

C. Resource Pool share value.

Explanation:

The vSphere is a term used to describe the VMware’s virtualization cloud platform. The vSphere comprises of the following, vCenter Server, ESXi, Virtual Machine File System (VMFS) and vCenter Client.

If a vSphere Administrator receive complaints that a database Virtual Machine (VM) is experiencing performance issues and the Virtual Machine (VM) is a member of the high priority resource pool and the cluster has not experienced contention.

In order to address immediate performance concerns, the vSphere Administrator should check the Resource Pool share value.

VMware resource pool refers to the aggregated central processing unit and memory allocated to a Virtual Machine (VM) for flexible management of the resources.

Also, the vSphere Administrator should install VMware tools to check which processes are having high CPU usage by using vimtop, as well as checking if vCenter Server is swapping.

You are writing a paragraph in a word processor. You
want to use the same text that appears elsewhere in a
different document, but you want to keep it in the other
document. To get the other text into the new document
most efficiently, you should:
Cut and paste
Ctrl + S
Copy and paste
Print the text and retype it so you don't make any mistakes.

Answers

Answer:

Explanation:

I mean I would copy and paste it. I hope thats right

What is a digital security risks?

Answers

Answer:

A digital security risk is an action that could result in damage to a computer or similar device's hardware, software, data etc.

what is computer aided design​

Answers

Computer-aided design (CAD) is the use of computers (or workstations) to aid in the creation, modification, analysis, or optimization of a design.[1] CAD software is used to increase the productivity of the designer, improve the quality of design, improve communications through documentation, and to create a database for manufacturing. hope this helps!!!
Other Questions
Hydrocarbon X has the formula C6H12. X reacts with one molar equivalent of hydrogen in the presence of a palladium catalyst to form a product having 12 primary hydrogens. Treatment of X with ozone followed by zinc in aqueous acid gives a mixture two aldehydes. What is the structure of X how to factor 5r^2+10r-240 Max magnitude Write a method maxMagnitude() with two integer input parameters that returns the largest magnitude value. Use the method in a program that takes two integer inputs, and outputs the largest magnitude value. Ex: If the inputs are: 5 7 the method returns: 7 Ex: If the inputs are: -8 -2 the method returns: -8 Note: The method does not just return the largest value, which for -8 -2 would be -2. Though not necessary, you may use the absolute-value built-in math method. Your program must define and call a method: public static int maxMagnitude(int userVal1, int userVal2) Read each incomplete sentence and choose the option with the correct verbs to complete them. El seor Moreno ________ tan agradable! Sus amigos ________ en Mxico. es; estn estamos; somos somos; estn soy; estoy The equation 9(u 2) + 1.5u = 8.25 models the total miles Michael traveled one afternoon while sledding, where u equals the number of hours walking up a hill and (u 2) equals the number of hours sledding down the hill. Which is the value of u? f(x)=x+2 sayanahatake6355 are you dere Where was New France located What is the measure of angle L in parallelogrami LMNO?20304050 Which of the following words means "quickly" in Spanish?A. bienB. lentamenteC. rpidamenteD. rpido How did WWI impact the land then known as Palestine/Israel Will give brainliest to best answer(s)!! If 9: x= x-4, then x=0 36180 246 how has E=MC2 helped us with our understanding of how stars like our Sun create energy? How many climate zones are in Central America 2573 A physician orders Lanoxin elixir qd for an 81-pound child based on 3.4 mcg/ kg/day. Lanoxin (digoxin) Pediatric Elixir is 50 mcg (0.05 mg)/mL. What volume should be administered per dose? Which is a true statement about the diagram? 1.What are natural rights?2.How would you describe them in your own words? Complete this sentence."Lequel" is used to replace quel + ______.a nouna verban adjectivean adverb john lockes ideal form of government good for the people Please please, I need help with this question ASAP.....