In contrasting the read-evaluation loop and the notification-based paradigm for inter- active programs, construction of a pre-emptive dialog was discussed. How would a programmer describe a pre-emptive dialog by purely graphical means? (Hint: Refer to the discussion in Sec- tion 8.5 concerning the shift from external and independent dialog management to presentation control of the dialog)

Answers

Answer 1
Answer:

The way a programmer describe a pre-emptive dialog by purely graphical means is; by producing a window that covers the entire screen to make it the currently selected window.

What is Pre - emptive Dialogue?

In a graphics - based interaction, it is supposed that the user can only interact with parts of the system that are visible. However, In a windowing system, the user can only direct input to a single window that was currently selected and the way to change that selected window is to indicate with some gesture within that window.

Finally, to create a pre-emptive dialog, the system would do so through the production of a window that covers the entire screen to make it the currently selected window. Thereafter, all user input would be directed to that window and the user would have no means of selecting any other window. Then the covering window will now pre-empt any other user action with the exception of that which it is defined to support.

Read more about dialogue at; brainly.com/question/5962406

Answer 2
Answer:

Answer:

In an illustrations based communication, it is expected that the client can just associate with parts of the framework that are obvious. In a windowing framework, for instance, the client can just direct contribution to a solitary, at present chosen window, and the main methods for changing the chose window would be by demonstrating with some signal inside that window. To make a preemptive exchange, the framework can create a window that covers the whole screen and make it the right now chosen window. All client information would then be coordinated to that window and the client would have no methods for choosing another window. The 'covering' window in this way preempts some other client activity with the exception of that which it is characterized to help


Related Questions

5. Switch a in the circuit has been open for a long time and switch b has been closed for a long time. Switch a is closed at t = 0. After remaining closed for 1s, switches a and b are opened simultaneously and remain open indefinitely. Determine the expression for the inductor current i that is valid when (a) 0 ≤ t ≤ 1s and (b) t ≥ 1s
A 78-percent efficient 12-hp pump is pumping water from a lake to a nearby pool at a rate of 1.5 ft3/s through a constant-diameter pipe. The free surface of the pool is 32 ft above that of the lake. Determine the irreversible head loss of the piping system, in ft, and the mechanical power used to overcome it. Take the density of water to be 62.4 lbm/ft3.
Water needs to be turned into steam in a high altitude lab where the atmospheric pressure is 84.6 KPa. Computte the heat energy (in calories) required to evaporate 900g of water at 15 degree C under these conditions.
The 50mm diameter cylinder is made from Am 1004-T61 magnesium (E = 44.7GPa, a = 26x10^-6/°C)and is placed in the clamp when the temperature is T1 = 15°C. If the two 304-stainless-steel (E =193GPa, a = 17x10^-6/°C) carriage bolts of the clamp each have a diameter of 10mm, and they holdthe cylinder snug with a negligible force against the rigid jaws, determine the temperature at whichthe average normal stress in either the magnesium or steel becomes 12 MPa.
2) The switch in the circuit below has been closed a long time. At t=0, it is opened.Find the inductor current for il(t) for t> 0.

The larger the Bi number, the more accurate the lumped system analysis. a)-True b)- False

Answers

Answer:

b). False

Explanation:

Lumped body analysis :

Lumped body analysis states that some bodies during heat transfer process remains uniform at all times. The temperature of these bodies is a function of temperature only. Therefor the heat transfer analysis based on such idea is called lumped body analysis.

                      Biot number is a dimensionless number which governs the heat transfer rate for a lumped body. Biot number is defined as the ratio of the convection transfer at the surface of the body to the conduction inside the body. the temperature difference will be uniform only when the Biot number is nearly equal to zero.  

                      The lumped body analysis assumes that there exists a uniform temperature distribution within the body. This means that the  conduction heat resistance should be zero. Thus the lumped body analysis is exact when biot number is zero.

In general it is assume that for a lumped body analysis, Biot number \leq 0.1

Therefore, the smaller the Biot number, the more exact is the lumped system analysis.

8.2.1: Function pass by reference: Transforming coordinates. Define a function CoordTransform() that transforms the function's first two input parameters xVal and yVal into two output parameters xValNew and yValNew. The function returns void. The transformation is new

Answers

Answer:

The output will be (3, 4) becomes (8, 10)

Explanation:

#include <stdio.h>

//If you send a pointer to a int, you are allowing the contents of that int to change.

void CoordTransform(int xVal,int yVal,int* xNew,int* yNew){

*xNew = (xVal+1)*2;

*yNew = (yVal+1)*2;

}

int main(void) {

int xValNew = 0;

int yValNew = 0;

CoordTransform(3, 4, &xValNew, &yValNew);

printf("(3, 4) becomes (%d, %d)\n", xValNew, yValNew);

return 0;

}

A new pipeline is installed to convey 2500 gal/min. If the pipeline can not exceed 6 ft/1,000ft of head loss what is the minimum standard diameter to convey the flowrate? Size both PVC (C=130) and steel (C=120) pipelines.

Answers

Answer:

Minimum standard diameter for the PVC pipe = 14.26 inches

Minimum standard diameter for the steel pipe = 14.70 inches

Explanation:

Head loss = 6/1000...................................................(1)

Head loss = hf/l

Head loss = 10.44Q^(1.85) /C^(1.85) D^(4.8655) ............................(2)

Q = 2500 gal/min

a) Minimum standard diameter for PVC

C for PVC = 130

Equating (1) and (2) and putting C = 130

6/1000 = 10.44* 2500^(1.85) /[130^(1.85) * D^(4.8655) ]\nD^(4.8655)  = 10.44* 2500^(1.85) /[0.006*130^(1.85)]\nD = [10.44* 2500^(1.85) /[0.006*130^(1.85)]]^(1/4.8655) \nD = 14.26 inches

b) Minimum standard diameter for steel

C for steel = 120

Equating (1) and (2) and putting C = 120

6/1000 = 10.44* 2500^(1.85) /[120^(1.85) * D^(4.8655) ]\nD^(4.8655)  = 10.44* 2500^(1.85) /[0.006*120^(1.85)]\nD = [10.44* 2500^(1.85) /[0.006*120^(1.85)]]^(1/4.8655) \nD = 14.70 inches

8. 15 A manual arc welding cell uses a welder and a fitter. The cell operates 2,000 hriyr. The welder is paid $30/hr and the fitter is paid $25/hr. Both rates include applicable overheads. The cycle time to complete one welded assembly is 15. 4 min. Of this time, the arc-on time is 25%, and the fitter's participation in the cycle is 30% of the cycle time. A robotic arc welding cell is being considered to replace this manual cell. The new cell would have one robot, one fitter, and two workstations, so that while the robot is working at the first sta tion, the fitter is unloading the other station and loading it with new components. The fitter's rate would remain at $25/hr. For the new cell, the production rate would be eight welded assemblies per hour. The arc-on time would increase to almost 52%, and the fitter's participation in the cycle would be about 62%. The installed cost of the robot and worksta tions is $158,000. Power and other utilities to operate the robot and arc welding equipment will be $3. 80/hr, and annual maintenance costs are $3,500. Given a 3-year service life, 15% rate of return, and no salvage value, (a) determine the annual quantity of welded assem blies that would have to be produced to reach the break-even point for the two methods. (b) What is the annual quantity of welded assemblies produced by the two methods work. Ing 2,000 hryr?​

Answers

The annual quantity of welded assemblies that would have to be produced to reach the break-even point for the two methods is approximately 15,983.

To determine the break-even point between the manual arc welding cell and the robotic cell, we need to calculate the total costs for each method and then equate them.

For the manual arc welding cell:

Labor cost per hour = (welder's hourly rate x arc-on time) + (fitter's hourly rate x fitter's participation in the cycle) = ($30 x 0.25) + ($25 x 0.3) = $11.25

Labor cost per welded assembly = labor cost per hour x cycle time per assembly / 60 = $11.25 x 15.4 / 60 = $2.89

Overhead cost per welded assembly = (labor cost per hour x (1 - arc-on time - fitter's participation in the cycle)) x cycle time per assembly / 60 = ($30 x 0.45) x 15.4 / 60 = $4.68

Total cost per welded assembly = labor cost per welded assembly + overhead cost per welded assembly = $2.89 + $4.68 = $7.57

Total cost per hour = total cost per welded assembly x production rate = $7.57 x 8 = $60.56

Total cost per year = total cost per hour x hours of operation per year = $60.56 x 2,000 = $121,120

For the robotic arc welding cell:

Labor cost per hour = fitter's hourly rate x fitter's participation in the cycle = $25 x 0.62 = $15.50

Labor cost per welded assembly = labor cost per hour x cycle time per assembly / 60 = $15.50 x 15.4 / 60 = $3.97

Overhead cost per welded assembly = power and utility cost per hour + annual maintenance cost / production rate = $3.80 + $3,500 / (8 x 2,000) = $3.80 + $0.22 = $4.02

Total cost per welded assembly = labor cost per welded assembly + overhead cost per welded assembly + (installed cost / (production rate x service life)) = $3.97 + $4.02 + ($158,000 / (8 x 3)) = $3.97 + $4.02 + $6,208.33 = $14.19

Total cost per hour = total cost per welded assembly x production rate = $14.19 x 8 = $113.52

Total cost per year = total cost per hour x hours of operation per year = $113.52 x 2,000 = $227,040

To find the break-even point, we set the total cost of the manual arc welding cell equal to the total cost of the robotic arc welding cell and solve for the annualquantity of welded assemblies:

$121,120 + x($7.57) = $227,040 + x($14.19)

$7.57x - $14.19x = $227,040 - $121,120

$-6.62x = $105,920

x = $105,920 / $6.62

x = 15,982.7

Therefore, the annualquantity of welded assemblies that would have to be produced to reach the break-even point for the two methods is approximately 15,983.

Learn more about hourly rate here brainly.com/question/29335545

#SPJ4

IN JAVA,Knapsack Problem

The file KnapsackData1.txt and KnapsackData2.txt are sample input files

for the following Knapsack Problem that you will solve.

KnapsackData1.txt contains a list of four prospective projects for the upcoming year for a particular

company:

Project0 6 30

Project1 3 14

Project2 4 16

Project3 2 9

Each line in the file provides three pieces of information:

1) String: The name of the project;

2) Integer: The amount of employee labor that will be demanded by the project, measured in work weeks;

3) Integer: The net profit that the company can expect from engaging in the project, measured in thousands

of dollars.

Your task is to write a program that:

1) Prompts the user for the number of work weeks available (integer);

2) Prompts the user for the name of the input file (string);

3) Prompts the user for the name of the output file (string);

4) Reads the available projects from the input file;

5) Dolves the corresponding knapsack problem, without repetition of items; and

6) Writes to the output file a summary of the results, including the expected profit and a list of the best

projects for the company to undertake.

Here is a sample session with the program:

Enter the number of available employee work weeks: 10

Enter the name of input file: KnapsackData1.txt

Enter the name of output file: Output1.txt

Number of projects = 4

Done

For the above example, here is the output that should be written to Output1.txt:

Number of projects available: 4

Available employee work weeks: 10

Number of projects chosen: 2

Number of projectsTotal profit: 46

Project0 6 30

Project2 4 16

The file KnapsackData2.txt, contains one thousand prospective projects. Your program should also be able to handle this larger problem as well. The corresponding output file,

WardOutput2.txt, is below.

With a thousand prospective projects to consider, it will be impossible for your program to finish in a

reasonable amount of time if it uses a "brute-force search" that explicitly considers every possible

combination of projects. You are required to use a dynamic programming approach to this problem.

WardOutput2.txt:

Number of projects available: 1000

Available employee work weeks: 100

Number of projects chosen: 66

Total profit: 16096

Project15 2 236

Project73 3 397

Project90 2 302

Project114 1 139

Project117 1 158

Project153 3 354

Project161 2 344

Project181 1 140

Project211 1 191

Project213 2 268

Project214 2 386

Project254 1 170

Project257 4 427

Project274 1 148

Project275 1 212

Project281 2 414

Project290 1 215

Project306 2 455

Project334 3 339

Project346 2 215

Project356 3 337

Project363 1 159

Project377 1 105

Project389 1 142

Project397 1 321

Project399 1 351

Project407 3 340

Project414 1 266

Project431 1 114

Project435 3 382

Project446 1 139

Project452 1 127

Project456 1 229

Project461 1 319

Project478 1 158

Project482 2 273

Project492 1 142

Project525 1 144

Project531 1 382

Project574 1 170

Project594 1 125

Project636 2 345

Project644 1 169

Project668 1 191

Project676 1 117

Project684 1 143

Project689 1 108

Project690 1 216

Project713 1 367

Project724 1 127

Project729 2 239

Project738 1 252

Project779 1 115

Project791 1 110

Project818 2 434

Project820 1 222

Project830 1 179

Project888 3 381

Project934 3 461

Project939 3 358

Project951 1 165

Project959 2 351

Project962 1 316

Project967 1 191

Project984 1 117

Project997 1 187

Answers

Answer:

Explanation:

Code:

import java.io.File;

import java.io.FileWriter;

import java.io.IOException;

import java.util.Scanner;

public class Knapsack {

 

  public static void knapsack(int wk[], int pr[], int W, String ofile) throws IOException

  {

      int i, w;

      int[][] Ksack = new int[wk.length + 1][W + 1];

     

      for (i = 0; i <= wk.length; i++) {

  for (w = 0; w <= W; w++) {

  if (i == 0 || w == 0)

  Ksack[i][w] = 0;

  else if (wk[i - 1] <= w)

  Ksack[i][w] = Math.max(pr[i - 1] + Ksack[i - 1][w - wk[i - 1]], Ksack[i - 1][w]);

  else

  Ksack[i][w] = Ksack[i - 1][w];

  }

  }

     

      int maxProfit = Ksack[wk.length][W];

      int tempProfit = maxProfit;

      int count = 0;

      w = W;

      int[] projectIncluded = new int[1000];

      for (i = wk.length; i > 0 && tempProfit > 0; i--) {

         

      if (tempProfit == Ksack[i - 1][w])

      continue;    

      else {

          projectIncluded[count++] = i-1;

      tempProfit = tempProfit - pr[i - 1];

      w = w - wk[i - 1];

      }

     

      FileWriter f =new FileWriter("C:\\Users\\gshubhita\\Desktop\\"+ ofile);

      f.write("Number of projects available: "+ wk.length+ "\r\n");

      f.write("Available employee work weeks: "+ W + "\r\n");

      f.write("Number of projects chosen: "+ count + "\r\n");

      f.write("Total profit: "+ maxProfit + "\r\n");

     

  for (int j = 0; j < count; j++)

  f.write("\nProject"+ projectIncluded[j] +" " +wk[projectIncluded[j]]+ " "+ pr[projectIncluded[j]] + "\r\n");

  f.close();

      }    

  }

 

  public static void main(String[] args) throws Exception

  {

      Scanner sc = new Scanner(System.in);

      System.out.print("Enter the number of available employee work weeks: ");

      int avbWeeks = sc.nextInt();

      System.out.print("Enter the name of input file: ");

  String inputFile = sc.next();

      System.out.print("Enter the name of output file: ");

      String outputFile = sc.next();

      System.out.print("Number of projects = ");

      int projects = sc.nextInt();

      int[] workWeeks = new int[projects];

      int[] profit = new int[projects];

     

      File file = new File("C:\\Users\\gshubhita\\Desktop\\" + inputFile);

  Scanner fl = new Scanner(file);

 

  int count = 0;

  while (fl.hasNextLine()){

  String line = fl.nextLine();

  String[] x = line.split(" ");

  workWeeks[count] = Integer.parseInt(x[1]);

  profit[count] = Integer.parseInt(x[2]);

  count++;

  }

 

  knapsack(workWeeks, profit, avbWeeks, outputFile);

  }

}

Console Output:

Enter the number of available employee work weeks: 10

Enter the name of input file: input.txt

Enter the name of output file: output.txt

Number of projects = 4

Output.txt:

Number of projects available: 4

Available employee work weeks: 10

Number of projects chosen: 2

Total profit: 46

Project2 4 16

Project0 6 30

A horizontal curve on a single-lane highway has its PC at station 1+346.200 and its PI at station 1+568.70. The curve has a superelevation of 6.0% and is designed for 120 km/h. The limiting value for coefficient of side friction at 120 km/h is 0.09. What is the station of the PT? Remember that 1 metric station = 1000 m.

Answers

Answer:

The solution is given in the attachments.