Questions
For the following Paging configuration discuss what must be done to ensure a processes address space...

For the following Paging configuration discuss what must be done to ensure a processes address space is not violated.
Process with five pages of 2048 words.

In: Computer Science

Find the bit length of a LAN if the data rate is 1 Gbps and the...

Find the bit length of a LAN if the data rate is 1 Gbps and the medium length in meters for a communication between two stations is 200 m. Assume the propagation speed in the medium is 2 *10^8 m/s.

In: Computer Science

Objectives To use selection statements To use repetition statement Problem Specification Skip by 7’s and 9’s...

Objectives

  • To use selection statements
  • To use repetition statement

Problem Specification

Skip by 7’s and 9’s

1. Generate n numbers between -100 and 100.

2. If the value is multiple of 7 or 9, replaced by *

3. Then change to new line after the multiple of 7 or 9 is appeared

Design Specification

  • Use if
  • Use if … else
  • Use while

Example:

In: Computer Science

Java Program. Please read carefully. i need the exact same output as below. if you unable...

Java Program. Please read carefully. i need the exact same output as below. if you unable to write the code according to the question, please dont do it. thanks

To the HighArray class in the highArray.java program (Listing 2.3), add the following methods:

1.      getMax() that returns the value of the highest key (value) in the array without removing it from the array, or 1 if the array is empty.

2.      removeMax() that removes the item with the highest key from the array.

3.      reverse() method for the HighArray class to reverse the order of elements of the array.

Sample output of HighArray class once you do the above methods:

current array items: 77 99 44 55 22 88 11 0 66 33

Can't find 35

array items after delete some values: 77 44 22 88 11 66 33

the Max is 88

the array after calling max method: 77 44 22 88 11 66 33

the array after calling remove max method: 77 44 22 11 66 33

the new max is 77

the array after calling reverse method   33 66 11 22 44 77

In: Computer Science

Given an IP address and mask of 192.168.0.0 /24 (address / mask), design an IP addressing...

Given an IP address and mask of 192.168.0.0 /24 (address / mask), design an IP addressing scheme that satisfies the following requirements. Network address/mask and the number of hosts for Subnets A and B will be provided by your instructor.

Subnet

Number of Hosts

Subnet A

55

Subnet B

25

The 0th subnet is used. No subnet calculators may be used. All work must be shown on the other side of this page.

Subnet A

Specification

Student Input

Points

Number of bits in the subnet

(5 points)

IP mask (binary)

New IP mask (decimal)

Maximum number of usable subnets (including the 0th subnet)

Number of usable hosts per subnet

IP Subnet

First IP Host address

Last IP Host address

Subnet B

Specification

Student Input

Points

Number of bits in the subnet

(5 points)

IP mask (binary)

New IP mask (decimal)

Maximum number of usable subnets (including the 0th subnet)

Number of usable hosts per subnet

IP Subnet

First IP Host address

Last IP Host address

Host computers will use the first IP address in the subnet. The network router will use the LAST network host address. The switch will use the second to the last network host address.

Write down the IP address information for each device:

Device

IP address

Subnet Mask

Gateway

Points

PC-A

(5 points)

R1-G0/0

N/A

R1-G0/1

N/A

S1

N/A

PC-B

In: Computer Science

In java please, thank you :) For this assignment, you will continue your practice with dynamic...

In java please, thank you :) For this assignment, you will continue your practice with dynamic structures. Specifically, you will be implementing a different version of a linked-list, called a Queue. Queues are very important and useful linear structures that are used in many applications. Follow the link below for a detailed description:

tutorialspoint - Queue (Links to an external site.)

The queue description above uses an array implementation for examples. As usual you will be not be using arrays, you will be using linked-lists. Specifically a singly-linked list.

Our job will be to implement the four basic queue methods which are enqueue(), dequeue(), peek() and isEmpty() as described in the tutorial mentioned above. You will not need to implement the isFull() method since we will be using linked-lists and linked-lists are theoretically never full.

For this assignment we will need to implement an uncommon version of enqueue(). In our version, if the element that is being processed is already in the queue then the element will not be enqueued and the equivalent element already in the queue will be placed at the end of the queue.

Additionally, you will be implementing a special kind of queue called a circular queue. A circular queue is a queue where the last position is connected back to the first position to make a circle. Therefore it does not have the traditional front and back data elements. It only has one data element, called rear that keeps track of the last element in the queue.

This structurally similar to a circular singly-linked list described here:

tutorialspoint - Circular Linked List (Links to an external site.)

The program's input will a single string that consists of single-character elements. You program will process each character in the string according the descriptions below. Where "->" signifies the front of the queue (blue designates input, red designates output):

  • 'A' - 'Z': Puts the character on the queue.
    ABCD
    (nothing will be outputted)
    
    ABCDA* 
    B C D A
  • '*': displays the elements of the queue separated by a space.
    ABCD*
    -> A B C D
    
  • '$': prints the element at the front of the queue.
    ABCD$
    peek: A 
    
  • '#': empties out the queue.
    ABCD#*
    -> 
    
  • '!': deletes an element from the queue.
    ABCD!*
    -> B C D
    
  • all other characters: prints an error message for each element, does not put the element in the queue and clears the queue.
    a
    The illegal character 'a' was encountered in the input stream. 

Programming Notes:

  1. You can not delete any code in the Queue class.
  2. If you need additional methods you must add them to the MyQueue class.
  3. If you do not need any additional methods then you can delete the myQueue class.
  4. You must use a singly-linked list with only a rear pointer.
  5. Do not assume any maximum length for any input string.
  6. You need not test for the null or empty string ("") cases.

Programming Rules:

  1. You are not allowed to add any arrays or ArrayLists or any Java built-in (ADTs), such as Lists, Sets, Maps, Stacks, Queues, Deques, Trees, Graphs, Heaps, etc. Or add any class that inherits any of those ADTs.
  2. For your node and list class you can use the code that was used in the book, video and lecture notes related to the node and lists class examples.
  3. You are not allowed to use Java Generics.
  4. If hard-coding detected in any part of your solution your score will be zero for the whole assignment.  

Please use started code:

import java.util.Scanner; // Import the Scanner class

public class Homework7 {
  
public static void main(String[] args) {
// place your solution here
}

}

class SLLNode {
  
public char data;
public SLLNode next;

public SLLNode(char c) {
data = c;
next = null;
}

}

class Queue {
  
public SLLNode rear;
  
public Queue() {
// place your solution here
}
  
public void enqueue(char c) {
// place your solution here
}
  
public SLLNode dequeue() {
// place your solution here
}
  
public char peek() {
// place your solution here
}
  
public boolean isEmpty() {
// place your solution here
}

}
  

In: Computer Science

    2.1) What is the kernel mode?     2.2) What is the user mode?     2.3)...

    2.1) What is the kernel mode?

    2.2) What is the user mode?

    2.3) Which mode has more different instructions?

    2.4) Why do we need these two modes in designing an operating system?

In: Computer Science

A byte is made up of 8 bits although a byte is rarely represented as a...

A byte is made up of 8 bits although a byte is rarely represented as a string of binary digits or bits. Instead, it is typically presented as a pair of hexadecimal digits where each digit represents 4 bits or half a byte or "nibble." We have been reading in hex digits and outputting their decimal value, but what we really want to do is create a byte from a pair of hex digits read from input.

Create a C program that:

  1. Reads a pair of hexadecimal characters from input. For example: 3B or CF.
  2. Converts each of them into their decimal value. For example: 3 (0011 in binary) and 11 (1011 in binary)
  3. Packs the two nibbles into a single byte. For example, 3 and B packed into an 8 bit byte would be 0011 1011.
  4. Outputs the merged byte in hexadecimal to verify that the byte was packed correctly.

The printf() function supports outputting an integer as a hexadecimal number using the %x (where the hexadecimal letters are presented in lower-case) and %X (where the hexadecimal letters are presented in upper-case).

To pack two integers that have values represented with only 4 bits, you need to perform two operations with the integers:

  1. Shift the integer holding the decimal value of the first hexadecimal digit in the pair to the left 4 bits.
  2. OR the integer holding the decimal value of the second hexadecimal in the pair with the shifted integer.

After the shift and the OR, the first integer will not have the lower 8 bits (byte) set to the values represented by the two characters read from input.

In: Computer Science

Write a program that uses a two dimensional array to store the highest and lowest temperatures...

Write a program that uses a two dimensional array to store the highest and lowest temperatures for each month of the calendar year. The temperatures will be entered at the keyboard. This program must output the average high, average low, and highest and lowest temperatures of the year. The results will be printed on the console. The program must include the following methods:

  • A method named inputTempForMonth whose purpose is to input a high and a low temperature for a specific month. The month and the array of temperatures will both be passed as input arguments to the method. The method will not have a return value.
  • A method named inputTempForYear whose purpose is to input a high and a low temperature for every month of the year. There are no input arguments for this method, but the method does return a completed multidimensional array of temperatures for the year.
  • A method named calculateAverageHigh whose purpose is to calculate the average high temperature for the year. This method will take the array of temperatures as input and will return the average high temperature for the year.
  • A method named calculateAverageLow whose purpose is to calculate the average low temperature for the year. This method will take the array of temperatures as input and will return the average low temperature for the year.
  • A method named findHighestTemp whose purpose is to return the index value of the highest temperature for the year. If the highest temperature of the year occurs more than once in the year, then the method should return the index of the first month that had the temperature. The method will take the array of temperatures as an input argument and return the index of the highest temperature.
  • A method named findLowestTemp whose purpose is to return the index value of the lowest temperature for the year. If the lowest temperature of the year occurs more than once in the year, then the method should return the index of the first month that had the temperature. The method will take the array of temperatures as an input argument and return the index of the lowest temperature.
  • A main method that uses the previous methods to determine the average high temperature, average low temperature, and highest and lowest temperatures for the year. The main method must print out these average temperatures as well as the month and temperature for the highest and lowest temperatures for the year.

Directions

  • You may only use statements that are discussed in the book through Chapter 7.
  • You must not use an ArrayList class from Java libraries to solve this problem.
  • Console input and output must be used to solve this problem.
  • Use the following input values for the final test of this program:
  • January has a High of 40 and Low of -10
  • February has a High of 55 and Low of 25
  • March has a High of 60 and Low of 40
  • April has a High of 88 and Low of 20
  • May has a High of 72 and Low of 55
  • June has a High of 95 and Low of 80
  • July has a High of 97 and Low of 87
  • August has a High of 110 and Low of 98
  • September has a High of 79 and Low of 68
  • October has a High of 31 and Low of 30
  • November has a High of 58 and Low of -25
  • December has a High of 32and Low of -20

In: Computer Science

According to NIST 800-61 r2, Incident response teams should use which staffing model? All Employees Partially...

According to NIST 800-61 r2, Incident response teams should use which staffing model?

All Employees

Partially outsourced and partially employees

All Outsourced

Any of the above    

In: Computer Science

Write a C++ program that : 1. Allow the user to enter the size of the...

Write a C++ program that :

1. Allow the user to enter the size of the matrix such as N. N must be an integer that is >= 2 and < 11.

2. Create an vector of size N x N.

3. Call a function to do the following : Populate the vector with N2 distinct random numbers. Display the created array.

4. Call a function to determines whether the numbers in n x n vector satisfy the perfect matrix property. Look at the sample run for the exact output

5. Repeat steps 1 - 4 until the user terminates the program.

The program needs a main and 2 functions

In: Computer Science

FOR JAVA: Need to write a code for the implementation of this public static method: findLongestPalindrome...

FOR JAVA: Need to write a code for the implementation of this public static method: findLongestPalindrome takes a Scanner scn as its parameter and returns a String. It returns the longest token from scn that is a palindrome (if one exists) or the empty string (otherwise). (Implementation note: You'll find your isPalindrome method helpful here. This method calls for an optimization loop.)

In: Computer Science

Explain the difference between Arrays and ArrayList. What are the limitation of arrays? How many primitive...

Explain the difference between Arrays and ArrayList. What are the limitation of arrays? How many primitive data types Java have? Please list them out and list the corresponding wrapper classes for each type. What is the different between String class and StringBuilder class?

In: Computer Science

C++, Java, Python. Assume we have two sequences of values S1 containing 1, 5, 3, 6,...

C++, Java, Python. Assume we have two sequences of values S1 containing 1, 5, 3, 6, 7, 8 while S2 containing 2, 5, 6, 9, 7. We’d store these two sequences as sets and performance set intersection and set difference. Write C++, Java, Python codes to do that respectively. Compare and contrast the readability and writability.

In: Computer Science

Please use Java language! with as much as comment! thanks! Write a program that displays a...

Please use Java language! with as much as comment! thanks!

Write a program that displays a frame with a three labels and three textfields. The labels should be "width:", "height:", and "title:" and should each be followed by one textfield. The texfields should be initialized with default values (Example 400, 600, default title), but should be edited by the user. There should be a button (label it whatever you want, I don't care). If you click the button, a new frame should become visible that has the title and dimensions the user entered in the textfields on the first frame (or the default values, if the user did not enter anything).

Use JPanels and the EXIT_ON_CLOSE statement. Give the first panel some proper dimensions using the setSize method.

In: Computer Science