[ad_1]

Get college assignment help at uniessay writers WNZ. i will give extra bonus.

“For each of the following two statements, decide whether it is true or false. If true, give a short explanation. If false provide a counterexample. a) Suppose we are given an instance of the Minimum Spanning Tree Problem on a graph G, with edge costs that are all positive and distinct. Let T be a minimum spanning tree for this instance. Now, suppose we replace each edge cost Ce by its square, Ce^2, thereby creating a new instance of the problem with the same graph but different costs. True or false? T must still be a minimum spanning tree for this new instance. b) Suppose we are given an instance of the Shortest s-t Path problem on a directed graph G. We assume that all edge costs are positive and distinct. Let P be a minimum cost s-t path for this instance. Now suppose we replace each edge cost Ce with its square, Ce^2, thereby creating a new instance of the problem with the same graph but different costs. True or false? P must still be a minimum cost s-t path for this new instance. ”

create an a[10].your array must be filled with integer typed by user from the keyboard using bubble sort algorithm sort elements in your array in decreasing order.do not indexes .use pointers.

CSC716 Homework 3 Fall 2008 Assigned on Nov. 3, 2008 Due on Nov. 17, 2008 1. Construct the schedule for the following set of jobs if multi-level feedback queue is used. Assume we use 3 levels in the multi-level feedback queue and that the time quantum for level 1 is 1 time units and the time quantum for level 2 is 1.5 time units. Jobs Arrival Time Service Time A 0 4 B 1 2 C 2 5 D 4 3 E 5 4 F 6 5 2. Question on the textbook Page 713: 19.4 3. Question on the textbook Page 713: 19.5 4. Shown below are two sets of real-time, periodic tasks. For (a), will the schedule produced by the Earliest Deadline First algorithm meet all the deadlines? For (b), will the scheduled produced by the Deadline Monotonic algorithm meet all the deadlines? Ti si di pi ei T1 3 4 4 1 T2 1 5 6 2 T3 2 3 3 1 (a) Ti si di pi ei T1 0 3 4 1 T2 3 4 4 1 T3 2 2 2 1 (b)

CHOICEPOINT

Race conditions are possible in many computer systems. Consider a banking system with the following two functions: deposit(amount) and withdraw(amount). These two functions are passed the amount that is to be deposited or withdrawn from a bank account. Assume a shared bank account exists between a husband and wife and concurrently the husband calls the withdraw() function and the wife calls deposit(). Describe how a race condition is possible and what might be done to prevent the race condition from occurring.

industrialization has essentially made us less independent and more closely connected to other people than ever before

3. Explain the following unexpected result: $ where is date date: /bin/date … $ echo $PATH .:/usr/local/bin:/usr/bin:/bin $ cat > date echo “This is my own version date.” $ date Sat May 24 11:45:49 PDT 2008

A 1024 × 768 image is displayed, noninterlaced, at a rate of thirty frames per second. a. If the image is stored with 64K-color resolution, which uses 2 bytes per pixel, how much memory is required to store the picture? b. How much video memory is required to store the picture as a ‘‘true color’’ image, at 3 bytes per pixel? c. What is the transfer rate, in bytes per second, required to move the pixels from video memory to the screen for the ‘‘true color’’ image

Perry and Wolf define software architecture as some combination of elements, form, and rationale. Express, in your own words, the meaning of each of these terms with respect to developing a software system. Give an example of each in terms of the Aqualush example we discussed in class.

Get college assignment help at uniessay writers File Sales.java contains a Java program that prompts for and reads in the sales for each of 5 salespeople in a company. It then prints out the id and amount of sales for each salesperson and the total sales. Study the code, then compile and run the program to see how it works. Now modify the program as follows: 1. Compute and print the average sale. (You can compute this directly from the total; no loop is necessary.) 2. Find and print the maximum sale. Print both the id of the salesperson with the max sale and the amount of the sale, e.g., “Salesperson 3 had the highest sale with $4500.” Note that you don’t need another loop for this; you can do it in the same loop where the values are read and the sum is computed. 3. Do the same for the minimum sale.

I need help with excel 2007 tutorial 7 case problem 3. I am trying to do number 8 within the problem.

Design an If-Then statement ( or flowchart with a single alternative decision structure) that assigns 20 to the variable y and assigns 40 to the variable z if the variable is greater than 100.

Suppose we place a wireless access point (WAP) at every gas station. The Internet bandwidth for the WAP is 1 Mbps. The communication range for the WAP is 100 meters (i.e., any computer within 100 meters from a WAP can communicate with the WAP). The wireless capacity is 11 Mbps. A taxi passes by a gas station once every 10 minutes at the speed of 30 miles per hour. Our goal is to deliver (stored) streaming media to the smartphone of a passenger on the taxi. We have two options: (i) let the smartphone directly download streaming media from the Internet whenever the taxi is in contact with a WAP, (ii) predict the set of WAPs that the taxi will visit, push streaming media to WAPs before they are visited by the taxi, and let the smartphone directly download pre-fetched locally from WAPs (instead of the Internet). In both options, with sufficient buffering, the smartphone can play streaming media smoothly even when it is offline (i.e. not in contact with any WAPs). Clearly, the second option can potentially achieve much higher average data rate. The following two questions try to quantify the potential performance benefit of prefetching. (3a) Download from Internet without prefetching. Suppose that we can download data at the full Internet/wireless capacity (i.e. we ignore loss, transport dynamics, MAC dynamics, protocol overhead, etc.) What is the average streaming media data rate that we can sustain by using Internet download only without prefetching? (3b) Download prefetched data from WAP. Suppose that we can download data at the full Internet/wireless capacity. Also suppose we can accurately predict the set of WAPs that the taxi will visit. What is the average streaming media data rate that we can sustain by downloading prefetched data from WAPs?

A Shopping Cart Write a program that simulates shopping. The program should have a loop that continues as long as the user wants to shop. Each time through the loop read in the name, price, and quantity of the item the user wants to add to the cart. After adding an item to the cart, the cart contents should be printed. After the loop print a “Please pay …” message with the total price of the items in the cart. // ********************************************************************** // ShoppingCart.java // // ********************************************************************** import java.text.NumberFormat; public class ShoppingCart { private int itemCount; // total number of items in the cart private double totalPrice; // total price of items in the cart private int capacity; // current cart capacity // ———————————————————– // Creates an empty shopping cart with a capacity of 5 items. // ———————————————————– public ShoppingCart() { capacity = 5; itemCount = 0; totalPrice = 0.0; } // ——————————————————- // Adds an item to the shopping cart. // ——————————————————- public void addToCart(String itemName, double price, int quantity) { } // ——————————————————- // Returns the contents of the cart together with // summary information. // ——————————————————- public String toString() { NumberFormat fmt = NumberFormat.getCurrencyInstance(); String contents = “nShopping Cartn”; contents = “nItemttUnit PricetQuantitytTotaln”; for (int i = 0; i < itemCount; i ) contents = cart[i].toString() "n"; contents = "nTotal Price: " fmt.format(totalPrice); contents = "n"; return contents; } // ——————————————————— // Increases the capacity of the shopping cart by 3 // ——————————————————— private void increaseSize() { } }

Question: The Faculty of Computing and Informats Technology wishes to install a Retailing Machine on Level One of its new complex. The machine will sell products like cakes, cans of coke, pens, and writing pads among others to students. Your group has been hired to write a complete formal specification for the machine. The following is the informal specification for the machine: 1 The machine will only accept Bank of Uganda notes in the denominations of 50000, 20000, 10000, 5000, 2000, and 1000. The products the machine will sell only include cakes, cans of coke, pens, writing pads, pencils, CDs, flash disks, and books. Operations on the machine will include; Initializing the machine: In the initial state, the machine will not contain any notes, products, and will not know the price of any product. Pricing of products: This operation will allow pricing a new stock item. In case the product and price is already in the system, the machine should give an error message. Update of price of a product: This operation will allow updating of the price of the products. In case the product is not in the system, the system should give an error message. Restocking of products: This operation allows addition of more goods to the machine. If an attempt is made to add goods that are not priced to the machine, the system should give an error message. Selling of goods: The selling operation allows a user to buy goods. For the operation to be successful; the buyer must enter enough money to buy the product, and the item being purchased must be in stock. If the buyer has entered money greater than the cost of the product, the machine must give him/her change. If the machine does not have change, it must give the buyer a receipt indicating his/her balance. In case of failure of the operation, the system should give an error message.

I need a solution manual algorithms by sanjoy dasgupta

Magic Squares One interesting application of two-dimensional arrays is magic squares. A magic square is a square matrix in which the sum of every row, every column, and both diagonals is the same. Magic squares have been studied for many years, and there are some particularly famous magic squares. In this exercise you will write code to determine whether a square is magic. File Square.java contains the shell for a class that represents a square matrix. It contains headers for a constructor that gives the size of the square and methods to read values into the square, print the square, find the sum of a given row, find the sum of a given column, find the sum of the main (or other) diagonal, and determine whether the square is magic. The read method is given for you; you will need to write the others. Note that the read method takes a Scanner object as a parameter. File SquareTest.java contains the shell for a program that reads input for squares from a file named magicData and tells whether each is a magic square. Following the comments, fill in the remaining code. Note that the main method reads the size of a square, then after constructing the square of that size, it calls the readSquare method to read the square in. The readSquare method must be sent the Scanner object as a parameter. You should find that the first, second, and third squares in the input are magic, and that the rest (fourth through seventh) are not. Note that the -1 at the bottom tells the test program to stop reading. // **************************************************************** // Square.java // // Define a Square class with methods to create and read in // info for a square matrix and to compute the sum of a row, // a col, either diagonal, and whether it is magic. // // **************************************************************** import java.util.Scanner; public class Square { int[][] square; //————————————– //create new square of given size //————————————– public Square(int size) { } //————————————– //return the sum of the values in the given row //————————————– public int sumRow(int row) { } //————————————– //return the sum of the values in the given column //————————————– public int sumCol(int col) { } //————————————– //return the sum of the values in the main diagonal //————————————– public int sumMainDiag() { } //————————————– //return the sum of the values in the other (“reverse”) diagonal //————————————– public int sumOtherDiag() { } //————————————– //return true if the square is magic (all rows, cols, and diags have //same sum), false otherwise //————————————– public boolean magic() { } //————————————– //read info into the square from the input stream associated with the //Scanner parameter //————————————– public void readSquare(Scanner scan) { for (int row = 0; row < square.length; row ) for (int col = 0; col < square.length; col ) square[row][col] = scan.nextInt(); } //————————————– //print the contents of the square, neatly formatted //————————————– public void printSquare() { } }

Consider the information stored on your personal computer. For each of the terms listed, find an example and document it: threat, threat agent, vulnerability, exposure, risk, attack, and exploit.

Can I get a solution to Question 4 on this old final exam to check my answers? Thanks.

Magic Squares One interesting application of two-dimensional arrays is magic squares. A magic square is a square matrix in which the sum of every row, every column, and both diagonals is the same. Magic squares have been studied for many years, and there are some particularly famous magic squares. In this exercise you will write code to determine whether a square is magic. File Square.java contains the shell for a class that represents a square matrix. It contains headers for a constructor that gives the size of the square and methods to read values into the square, print the square, find the sum of a given row, find the sum of a given column, find the sum of the main (or other) diagonal, and determine whether the square is magic. The read method is given for you; you will need to write the others. Note that the read method takes a Scanner object as a parameter. File SquareTest.java contains the shell for a program that reads input for squares from a file named magicData and tells whether each is a magic square. Following the comments, fill in the remaining code. Note that the main method reads the size of a square, then after constructing the square of that size, it calls the readSquare method to read the square in. The readSquare method must be sent the Scanner object as a parameter. You should find that the first, second, and third squares in the input are magic, and that the rest (fourth through seventh) are not. Note that the -1 at the bottom tells the test program to stop reading. // **************************************************************** // Square.java // // Define a Square class with methods to create and read in // info for a square matrix and to compute the sum of a row, // a col, either diagonal, and whether it is magic. // // **************************************************************** import java.util.Scanner; public class Square { int[][] square; //————————————– //create new square of given size //————————————– public Square(int size) { } //————————————– //return the sum of the values in the given row //————————————– public int sumRow(int row) { } //————————————– //return the sum of the values in the given column //————————————– public int sumCol(int col) { } //————————————– //return the sum of the values in the main diagonal //————————————– public int sumMainDiag() { } //————————————– //return the sum of the values in the other (“reverse”) diagonal //————————————– public int sumOtherDiag() { } //————————————– //return true if the square is magic (all rows, cols, and diags have //same sum), false otherwise //————————————– public boolean magic() { } //————————————– //read info into the square from the input stream associated with the //Scanner parameter //————————————– public void readSquare(Scanner scan) { for (int row = 0; row < square.length; row ) for (int col = 0; col < square.length; col ) square[row][col] = scan.nextInt(); } //————————————– //print the contents of the square, neatly formatted //————————————– public void printSquare() { } }

The post WNZ. i will give extra bonus. appeared first on uniessay writers.

[ad_2]

Source link

November 3, 2019