A set of processes along with their burst time in milliseconds is given below. The processes should execute in First Come First Served order. Assume that the quantum (q) is 3:
Process Burst Time
P1 22
P2 4
P3 12
P4 15
P5 2
Find the average waiting time using the Round Robin algorithm. Round your answer to 2 decimal places
In: Computer Science
Parse the file /usr/src/include/minix/ipc.h (Struct message) Modify the newly created system call to receive and print a parameter of type long through the structure “message” (the System_Calls_in_Minix.pdf file may be helpful). From the test file, the parameter must be sent to the user library created in the previous exercise, which in turn sends the parameter to the syscall. Your library must use the M4 type message. The system call must print the arbitrary number sent by the user code through the library. The output format must be: Hi! The number is: <number> where <number> is the value of the parameter sent to the library through the message. Include in the answer the definitions of the functions: int do_mycall () { } int mycall (long integer) { } in that order, as defined and tested on your copy of minix.
In: Computer Science
Please finish the following JAVA Codes:
1. The class Person includes information of a person’s first name, last name, phone number, and email. Implement the class with appropriate constructors, getters and setters.
2. Derive a Student class that extends Person. In addition to a person’s information, a student has major, year, GPA, and a list of enrolled courses. In addition to appropriate constructors, getters and setters, make two methods addCourse and dropCourse.
3. Design and implement a program, either in main() or in another class, that calculates the GPA of a student. The student’s courses should be displayed in console, one at a time, and the grade of the course will be input to console by user. After all grades were input, the GPA should be displayed and be recorded in the student object.
In: Computer Science
Due 2/14 by end of day Your first assignment is to create the barebones outline of your first data structure - The ArrayList - with minimal functionality. 1) Open up your IDE and create a new Project. Call it "PDSSpring2019". 2) Inside your project create a new package. Call it "adt" 3) Inside the adt package create an interface. Call it "List" 4) You are to fully program the List interface using Java generics and Javadoc. Please note - an interface doesn't account for implementation. It is just the function definitions and Javadoc. The following functions need to be present - boolean add(E e) void add(int index, E element) boolean addAll(Collection<? extends E> c) boolean addAll(int index, Collection<? extends E> c) void clear() boolean contains(Object o) boolean containsAll(Collection<?> c) boolean equals(Object o) E get(int index) int indexOf(Object o) boolean isEmpty() int lastIndexOf(Object o) E remove(int index) boolean remove(Object o) boolean removeAll(Collection<?> c) E set(int index, E element) int size() List<E> subList(int fromIndex, int toIndex) Object[] toArray() You also need the appropriate Javadoc. To get the outline of the functions please visit the Javadoc at https://docs.oracle.com/javase/8/docs/api/java/util/List.html NOTE - It's OK to leave off the Exceptions for now because you aren't sure which Exceptions you're going to need to throw yet. 5) You need to create a new file, ArrayList.java that implements the List interface. For most of your methods you can create stubs but you will implement the following Constructors: All 3 located here https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html Methods: boolean add(E e) void add(int index, E element) int size() NOTE * You will probably need the add method to perform one of the constructors.
In: Computer Science
In an Inclusion relationship, including a use case is similar to calling another use case, method, function, or a process.
Draw a use case model. In a pantry area a student warms up a cup of coffee in a microwave oven for 55 seconds. (Hint: Use Include relationship between the use cases)
In: Computer Science
RIs BYOD Good for Business? explain in 500 words.
In: Computer Science
This table is used by Mighty Paws Veterinary Clinic. Inspect this table and answer questions below and answer the following 4 questions:
PetId |
PetName |
OwnerName |
OwnerPhone |
PetType |
Legs |
CanFly |
Favorite food |
100 |
Fluffy |
Mary Smith |
614-897-5496 |
Cat |
4 |
No |
MeowMix, FancyCatTM |
101 |
Casper |
Mary Smith |
614-897-5496 |
Cat |
4 |
No |
MeowMix |
102 |
Lori |
Jim Larson |
740-851-0023 |
Parrott |
2 |
Yes |
Seeds |
103 |
Marty |
Kim Jones |
212-505-8578 |
Python |
0 |
No |
|
104 |
Oscar |
Tim Wang |
614-410-5535 |
Dog |
4 |
No |
IAMS, Tim’s new sneakers |
In: Computer Science
You need to make an AngryBear class.(In java)
The AngryBear class must have 2 instance variables.
The first instance variable will store the days the bear has been awake.
The second instance variable will store the number of teeth for the bear.
The AngryBear class will have 1 constructor that takes in values for days awake and number of teeth.
The AngryBear class will have one method isAngry();
An AngryBear is angry if it has been awake for more than 3 days and has less than 10 teeth or has no teeth or has been awake for more than 5 days.
Otherwise, the AngryBear is not really angry but he could be quite annoyed.
to test this code use
public void run() {
AngryBear a = new AngryBear( 10, 3 );
System.out.println( a.isAngry() ); //prints true
AngryBear b = new AngryBear( 10, 35 );
System.out.println( b.isAngry() );
AngryBear c = new AngryBear( 1, 25 );
System.out.println( c.isAngry() );
AngryBear d = new AngryBear( 6, 40 );
System.out.println( d.isAngry() );
AngryBear e = new AngryBear( 1, 1 );
System.out.println( e.isAngry() );
AngryBear f = new AngryBear( 111, 111 );
System.out.println( f.isAngry() );
}
In: Computer Science
"Today’s Attacks and Defenses at the beginning of this chapter
illustrated how a security researcher could manipulate a help desk
support technician into compromising security. If you were to
create your own social engineering attack, what would it be? Using
your place of employment or school, first determine exactly what
your goal would be in the attack, and then craft a detailed
description of how you would carry out the attack using only social
engineering to achieve your goal. You might want to search the
Internet for examples of previously successful attacks that used
social engineering. Why do you think your attack would be
successful? Who would be involved? What would be the problems in
achieving your goal? Why? Write a one-page paper on your
research"
(Ciampa 93).
As instructed, write a one-page paper on your research. Make sure that your paper is double-spaced and has an introduction, conclusion and any appropriate citations and references.
In: Computer Science
Using Python, create a function whose inputs are two matrices and whose output is the element wise product of the two matrices.
In: Computer Science
An electricity company charges electricity consumption
according to the following scale.
Up to 200 Units (0-200) to 0.25 € per unit
The next 1000 Units (201-1200) to 0.40 € per unit
Over 1200 units to 0.50 € per unit.
Write a program in python language that accepts the number of units
consumed by the customer and displays the amount of money owed by
the customer to the electricity company
In: Computer Science
QUESTION 1
The statement char ch = ‘A’ would store in ch
A. |
The character A |
|
B. |
ASCII value of A |
|
C. |
A along with the single inverted commas |
|
D. |
Both (a) and (b) |
2 points
QUESTION 2
Which of the following scanf() statement will you use to accept following variables?
float gravity_a;
double gravity_b;
A. |
scanf("%f %lf", &gravity_a, &gravity_b); |
|
B. |
scanf("%LF %f ", gravity_a, gravity_b); |
|
C. |
scanf("%LF %LF ", &gravity_a, &gravity_b); |
|
D. |
scanf("%f %LF ", gravity_a, gravity_b); |
2 points (Extra Credit)
QUESTION 3
What will be the output of the following program?
#include<stdio.h>
int main()
{
float a=6.15528;
printf("%2.1f\n", a);
return 0; }
A. |
6.00 |
|
B. |
6.15 |
|
C. |
6.2 |
|
D. |
6 |
2 points (Extra Credit)
QUESTION 4
What will be the output of the following statements?
const int count = 10;
count++; printf("%d", count);
A. |
10 |
|
B. |
11 |
|
C. |
Run-time Error |
|
D. |
Compile-time Error |
3 points
QUESTION 5
What will be the output of the following program?
#include<stdio.h>
int main()
{
int a = 5, b = 2;
printf("%d ", a+++b);
printf("%d %d", a, b);
return 0;
}
A. |
Results in Syntax Error |
|
B. |
Prints 7 6 2 |
|
C. |
Prints 8 6 2 |
|
D. |
None of the above |
In: Computer Science
Tables: Write the HTML code for a table data cell that contain the text “Holiday” and spans across 3 rows and 4 columns.
In: Computer Science
Write an algorithm that finds both the smallest and largest numbers in a list of n numbers. Try to find a method that does at most 1.5n comparisons of array items.(but please code in java).
In: Computer Science
C#
Assignment4A: Fibo-what? If you’ve never heard of the Fibonacci series, it’s an infinite series that occurs everywhere in nature. It starts off with two digits – 0 and 1. To get the next value in the series, you add the previous two values. In this case, the third value is 0+1 = 1. The fourth value is 1+1 = 2, the fifth 1+2=3 and so on, to give us a series like:
0, 1, 1, 2, 3, 5, 8, 13, 21, 34,...
I always wondered what it would look like if you changed the starting values from 0 and 1 to some arbitrary (and if it would matter). We’re going to do that here. Ask the user for a pair of starting values as well as a number of times to iterate the series, then produce the correct output. We recommend you use a FOR loop and use a sum variable.
For part 1 of this assignment, design pseudocode to solve this problem. When working on the source code, call the file name Assignment4A(.java, .cs, .cpp) and the class name Assignment4A. When printing the next value in the series, print the comma first. The first two values are special cases for printing.
Sample Output #1: Enter seed 1:
5
Enter seed 2:
8
Number of iterations:
10
5,8,13,21,34,55,89,144,233,377,610,987
Sample Output #2: Enter seed 1:
56
Enter seed 2:
78
Number of iterations:
6
56,78,134,212,346,558,904,1462
In: Computer Science