1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ella [17]
3 years ago
7

When the famous stylist Kate Young comes to her office, she sees that her customers Anna (A), Bella (B) and Chloe (C) are waitin

g for her service. A needs a service that takes 5 minutes, B requires a service that takes 20 minutes and C requires a service that takes 10 minutes. Kate Young wants to schedule the customers in such a way that minimizes their total time in the system. What should be the heuristic that Kate Young uses for her greedy algorithm to minimize the total time in the system
Computers and Technology
1 answer:
Anit [1.1K]3 years ago
8 0

Answer:

The heuristic would be to satisfy the shortest time first. so it would be in this order

Anna first,

Chloe second,

Bella last.

Explanation:

The heuristic that Kate should use for her greedy algorithm in order to minimize the total time in the system would be to satisfy the job that is shortest first.

The shortest job first heuristic would be used here. so we arrange the service time for all customers according to ascending order. First  Kate would attend to since Anna needs a service that would take 5 minutes, then Chloe would be next with 10 minutes and lastly Bella would next with as service time of 20 minutes.

<em>i have gone ahead to help you calculate the total waiting time</em>

The total waiting time would

for Anna = 0 minutes since she is first

for Chloe it would be the time Anna spent receiving her service = 5 minutes

for Bella: it would be the time Anna spent receiving her service in addition to Chloe's time= 5+10 = 15

total waiting time = 5 + 15 minutes = 20 minutes.

You might be interested in
Which of the following not a hardware componet​
erma4kov [3.2K]

Answer:

antivirus.......hope this answers your question

3 0
3 years ago
Which of the following are possible ways to
Andru [333]

Answer:

employ ability assessments and the ability to perform tasks

Explanation:

6 0
3 years ago
Read 2 more answers
Printed versions of your presentation that contain the slides and blank lines below are called
m_a_m_a [10]

Answer:

Handouts

Explanation:

matches description

6 0
2 years ago
Create a brief program that demonstrates use of a Java exception. For example, you could use InputMismatchException and ask the
HACTEHA [7]

Answer:

Here is the program that demonstrates the use of JAVA exception:

import java.util.Scanner;  //to accept input from user

public class Main {  //class name

   public static void main(String[] args) {  //start of main method

      Scanner input = new java.util.Scanner(System.in);  //creates Scanner class object to accept input from user

       int number1 = 0;  //stores the first integer value

       int number2 = 0;  //stores the second integer value

       while(true) {  //keeps looping until user enters integer value

           System.out.println("Enter 2 integers to perform addition: "); //prompts user to enter two integer values

           try {  //defines a chunk of code to check for errors        

               number1 = input.nextInt(); //reads input integer 1

               number2 = input.nextInt(); //reads input integer 2                  

               break;             }  

           catch (java.util.InputMismatchException e) { // defines a code chunk to execute if an error occurs in the try code chunk

              System.out.println("Input must be an integer "); //displays this message if user enters anything other than an integer value

              input.nextLine();              }         }  // reads input from user again until user enters both integer type values

       System.out.println("The sum is: " + (number1+number2));      }  } //if user enters 2 integers then computes and displays the sum of two integer values

Explanation:

The program uses InputMismatchException exception and asks the user to input two integers and computes the sum of two integers if user enters  integers otherwise an exception InputMismatchException is thrown and a error message Input must be an integer is displayed to the user if they input a string of letters instead o f integer values. Here while loop is used which keeps executing until user enters both the integer values. After the user enters correct values, the sum of the two integers are computed and result is displayed on output screen. The screenshot of program and its output is attached.

Another program asks the user to input an integer and the program executes correctly if they enter an integer but exception InputMismatchException is thrown with an error message that is is displayed to the user if they input a string of letters. Here is the program:

import java.util.Scanner;

public class Main {

   public static void main(String[] args) {

       Scanner input = new java.util.Scanner(System.in);

       int number1 = 0;          

       while(true) {

           System.out.println("Enter an integer value: ");        

           try {

               number1 = input.nextInt();  

               break;             }  

           catch (java.util.InputMismatchException e) {

              System.out.println("Input must be an integer ");

              input.nextLine();             }        }  

       System.out.println("The program executed correctly!");  } }

7 0
3 years ago
Can u guys tell me what is the definition of umbra​
oksian1 [2.3K]

Answer:

the fully shaded inner region of a shadow cast by an opaque object, especially the area on the earth or moon experiencing the total phase of an eclipse.

Explanation:

i go.ogled it

5 0
2 years ago
Read 2 more answers
Other questions:
  • Chdtp aoxophg gr72 ae9&gt;3 zqqz
    12·1 answer
  • Which of the following is an accurate statement? When the LOWER function is used in a SELECT clause, it will automatically store
    6·1 answer
  • There are local administrators for each of the departments, excluding the IT. These local administrators will use the local admi
    7·1 answer
  • How will Mario know which words are misspelled in his document?
    11·2 answers
  • What is the difference between technology and science?
    13·1 answer
  • The challenge of preparing for ____________________ is in ensuring that employees do not feel that they are being prepared for t
    7·1 answer
  • Ayuda necesito 7 objetos que se utilizan en la vida diaria
    8·1 answer
  • What changes should be made in OSI model(Open System Interconnection).
    5·2 answers
  • Importance of computer education​
    9·1 answer
  • What is the difference between second generation and third generation of computer​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!