Questions
Q7: (Currency Conversion) Implement the following double functions: a) Function toAUD takes an amount in US...

Q7: (Currency Conversion) Implement the following double functions: a) Function toAUD takes an amount in US dollars and returns the AUD equivalent. b) Function toYuan takes an amount in US dollars and return the Yuan equivalent c) Use these functions to write a program that prints charts showing the AUD and Yuan equivalents of a range of dollar amounts. Print the outputs in a neat tabular format. Use an exchange rate of 1 USD = 1.42 AUD and 1 USD = 6.793 Yuan. HTML EditorKeyboard Shortcuts

In: Computer Science

-In C Programming- Write a program to display the total rainfall for a year. In addition,...

-In C Programming-

Write a program to display the total rainfall for a year. In addition, display the average monthly rainfall, and the months with the lowest and highest rainfall.

Create an array to hold the rainfall values. Create a 2nd parallel array (as a constant) to hold the abbreviated names of the months. I created my arrays to be 1 element bigger than needed, and then disregarded element [0] (so that my months went from [1] = "Jan" to [12] = "Dec").

Populate the array with the rainfall values entered by the user. Then, display the rainfall values. Display the 1st 6 months, followed by the last 6 months Then display the statistics (the total, average, lowest, and highest rainfall).

Calculate the total rainfall. After you get the total, you should be able to calculate the average (use the size (minus 1 if the array was 1 element bigger than needed) of the array). Then find the index of lowest rainfall and the index of highest rainfall. Finally, display the statistics, using the indexes that were found to get the lowest and highest rainfall value and the name of the month from the arrays.

Format the output to 1 decimal place.

There is no validation.

In: Computer Science

Write a function DIVISORS in MIPS. This function takes a positive number from the register a0...

Write a function DIVISORS in MIPS. This function takes a positive number from the register a0 and prints in a column all of its divisors including 1 and the number itself. Don't forget that printing a number and printing a character requires two different system calls.

Here is an example. If the number in a0 is 6 the following output appears:

1

2

3

6

In: Computer Science

Prove algebraically ABC+A’C’D’+A’BD’+ACD=(A’+C)(A+D’)(B+C’+D)

  1. Prove algebraically

ABC+A’C’D’+A’BD’+ACD=(A’+C)(A+D’)(B+C’+D)

In: Computer Science

Step 1: Edit SumMinMaxArgs.java Download the SumMinMaxArgs.java file, and open it in jGrasp (or a text...

Step 1: Edit SumMinMaxArgs.java

Download the SumMinMaxArgs.java file, and open it in jGrasp (or a text editor of your choice). This program takes a number of command line arguments, parses them as ints, and then displays:

  1. The arithmetic sum of the arguments
  2. The smallest argument
  3. The largest argument

If you're unsure how to pass command-line arguments to a program with jGrasp, see this tutorial. Example output of this program with the command-line arguments 1 2 3 4 5 is shown below:

Sum: 15
Min: 1
Max: 5

Further example output for the command-line arguments 87 23 42 91 -4 is shown below:

Sum: 239
Min: -4
Max: 91

_____________________________

public class SumMinMaxArgs {
    private int[] array;
    // You will need to write the following:
    //
    // 1. A constructor that takes a reference to an array,
    //    and initializes an instance variable with this
    //    array reference
    //
    // 2. An instance method named sum, which will calculate
    //    the sum of the elements in the array.  If the array
    //    is empty (contains no elements), then this will
    //    will return 0.  You will need a loop for this.
    //
    // 3. An instance method named min, which will return
    //    whichever element in the array is smallest.
    //    You can assume that min will only be called if the
    //    array is non-empty (contains at least one element).
    //    You will need a loop for this.  You may use the
    //    Math.min method here (see link below for more)
    //    https://www.tutorialspoint.com/java/lang/math_min_int.htm
    //
    // 4. An instance method named max, which will return
    //    whichever element in the array is largest.
    //    You can assume that max will only be called if the
    //    array is non-empty (contains at least one element).
    //    You will need a loop for this.  You may use the
    //    Math.max method here (see link below for more)
    //    https://www.tutorialspoint.com/java/lang/math_min_int.htm
    //
    // TODO - write your code below


    // DO NOT MODIFY parseStrings!
    public static int[] parseStrings(String[] strings) {
        int[] retval = new int[strings.length];
        for (int x = 0; x < strings.length; x++) {
            retval[x] = Integer.parseInt(strings[x]);
        }
        return retval;
    }

    // DO NOT MODIFY main!
    public static void main(String[] args) {
        int[] argsAsInts = parseStrings(args);
        SumMinMaxArgs obj = new SumMinMaxArgs(argsAsInts);
        System.out.println("Sum: " + obj.sum());
        System.out.println("Min: " + obj.min());
        System.out.println("Max: " + obj.max());
    }
}

In: Computer Science

please provide clarity 1. What is the purpose behind EtherChannel negotiation protocols? 2. What is the...

please provide clarity
1. What is the purpose behind EtherChannel negotiation protocols?
2. What is the difference between LACP and PAgP in terms of the number of interfaces that may be bundled into a group?
3. What instance might you configure an EtherChannel bundle in access mode?
4. Why do you think configuration changes must be done under the port-channel interface for existing port-channel groups?
5. How might the protocols DTP and EtherChannel be confused?
6. What are some configuration settings that might cause a channel group not to successfully come up?
7. Describe EtherChannel technology.
8. What are the possible configuration commands for Configure EtherChannel?
9. What are the possible verification commands for EtherChannel?
10. What are some advantages of EtherChannel?
11. What are EtherChannel Operation Implementation Restriction?
12. What are the possible verification commands for LACP Configuration?
13. What are the possible configuration commands for configure PAgP

In: Computer Science

As in previous labs, please write the Java code for each of the following exercises in...

As in previous labs, please write the Java code for each of the following exercises in BlueJ. For each exercise, write a comment before the code stating the exercise number.

Make sure you are using the appropriate indentation and styling conventions

Exercise 1 (15 Points)

  • In BlueJ, create a new project called Lab6
  • In the project create a class called Company
  • Add instance data (fields) for the company name (a String) and the sales for the current period (a double)
  • Make sure you declare the fields with private visibility.
  • Add a constructor to the Company class that accepts a parameter to set the company name and sets the sales to 0.0.

Exercise 2 (20 Points)

  • Create a second class in the same project called CompanyDemo.
  • Add a main method to this class. This will serve as the driver of this program.
  • In main, create two Company reference variables named c1 and c2.
  • Assign to those variables two Company objects, one with the name Lexcorp and the other with the name Daily Planet.
  • Now print the two objects using separate println statements.
  • Run the main method – you’ll see the default output when printing an object. The value returned by the default version of toString is the class name followed by a hash string created based on the memory location of this object. The displayed number is in hexadecimal – not particularly helpful.

Exercise 3 (20 Points)

  • To improve the output, add a toString method to the Company class that returns a string of the form

Lexcorp made $2517.85 this period.

  • To do the previous step, you need to use the String.format method. Please refer to the String API (Links to an external site.). The String.format method is the same like the prinf method. The only difference is that, the String.format method doesn't print anything to the screen. It just returns the formatted String object. Accordingly, it can be used in the toString method to return the formatted string.
  • Run the main method again to see the new output, though sales for both companies will still be 0.0

Exercise 4 (10 Points)

  • Add a setter (mutator) and getter (accessor) methods for the company name to the Company class.
  • Add println statements (for both companies) to the main method to print just the company name
  • Call the setter on one object to change the name from Lexcorp to Lexcorp, Inc.
  • Then print the company name again.

Exercise 5 (20 Points)

  • Add a method in Company called updateSales that accepts an integer representing the number of units sold and a double representing the unit price.
  • In that method, multiply the units by the unit price and add that value to the sales.
  • In main, call updateSales for c1, passing in 12 units at $24.53 per unit.
  • Then call updateSales for c2, passing in 5 units at $14.17 per unit.
  • Then print both company objects again.

Exercise 6 (10 Points)

  • Add a second constructor to Company with an additional parameter that gives a company an initial sales figure.
  • In main, change the creation of Daily Planet so that it has initial sales of $255.18.
  • Rerun the main method to verify the change.

Exercise 7 (5 Points)

  • Add a resetSales method in Company that resets the sales value to 0.0
  • At the end of main, call resetSales just for Lexcorp and print both companies one more time.

In: Computer Science

The challenge of rolling out television service is a process to be achieved using a number...

The challenge of rolling out television service is a process to be achieved using a number of steps. Answer the four parts below about television service rollouts..
Part 1: What are the required parameters needed to define the business model for a television service rollout?
Part 2: What would be some examples of requirements for service definition of a television service rollout?
Part 3: What might be some examples of equipment approval needed for a television service rollout?
Part 4: How might service assurance affect a television service rollout?

In: Computer Science

#include <stdio.h> int main(void) { float funds = 1.0, cost = 0.1; int candies = 0;...

#include <stdio.h>
int main(void) {
float funds = 1.0, cost = 0.1;
int candies = 0;
while(cost <= funds) {
candies += 1;
funds -= cost;
cost += 0.1;
}
printf("%d candies with $%.2f left over.\n",candies,funds);
return 0;
}

When you compile and run this code you get 3 candies with $0.40 left over.

Without knowing how floating point numbers work in a computer, would this result be expected? Explain why or why not. Explain why this result, in fact, occurred.

In: Computer Science

USE C PROGRAMMING, call all functions in main, and use a 2 by 3 2d array...

USE C PROGRAMMING, call all functions in main, and use a 2 by 3 2d array to test, thanks.

get_location_of_min This function takes a matrix as a 2-D array of integers with NUM_COLS width, the number of rows in the matrix and two integer pointers. The function finds the location of the minimum value in the matrix and stores the row and column of that value to the memory location pointed to by the pointer arguments. If the minimum value occurs in more than one row, the function choses the one with the highest row number. If the minimum value occurs more than once in that row, the function chose the one with the highest column number. You can assume the matrix is not empty. Examples: if get_location_of_min is called with matrix {{1,7},{4,2},{2,-1}}, and NUM_COLS is 2, the number of rows is 3 the smallest value (-1) is at row 2 column 1. After the function is complete the values 2 and 1 are stored at the corresponding locations pointed to by the arguments. if get_location_of_min is called with matrix {{3,7},{4,2},{2,6}}, and NUM_COLS is 2, the number of rows is 3 the smallest value (2) occurs twice and the one at the highest row is at row 2 column 0. After the function is complete the values 2 and 0 are stored at the corresponding locations pointed to by the arguments. if get_location_of_min is called with matrix {{3,7},{2,4},{2,2}}, and NUM_COLS is 2, the number of rows is 3 the smallest value (2) occurs three times and the one at the highest row and column is at row 2 column 1. After the function is complete the values 2 and 1 are stored at the corresponding locations pointed to by the arguments.

get_location_of_max This function takes a matrix as a 2-D array of integers with NUM_COLS width, the number of rows in the matrix and two integer pointers. The function finds the location of the minimum value in the matrix and stores the row and column of that value to the memory location pointed to by the pointer arguments. If the minimum value occurs in more than one row, the function choses the one with the highest row number. If the minimum value occurs more than once in that row, the function chose the one with the highest column number. You can assume the matrix is not empty. Examples: if get_location_of_max is called with matrix {{1,7},{4,2},{2,9}}, and NUM_COLS is 2, the number of rows is 3 the largest value (9) is at row 2 column 1. After the function is complete the values 2 and 1 are stored at the corresponding locations pointed to by the arguments. if get_location_of_max is called with matrix {{3,7},{4,8},{8,6}}, and NUM_COLS is 2, the number of rows is 3 the largest value (8) occurs twice and the one at the highest row is at row 2 column 0. After the function is complete the values 2 and 0 are stored at the corresponding locations pointed to by the arguments. if get_location_of_max is called with matrix {{3,7},{8,4},{8,8}}, and NUM_COLS is 2, the number of rows is 3 the largest value (8) occurs three times and the one at the highest row and column is at row 2 column 1. After the function is complete the values 2 and 1 are stored at the corresponding locations pointed to by the arguments.

swap_min_max_values This function takes a matrix as a 2-D array of integers with NUM_COLS width, the number of rows in the matrix. The function will find the locations of the minimum and maximum values and swap the locations of these values in the matrix. The locations of minimum and maximum values follow the specifications of the get_location_of_min and get_location_of_max functions. You can assume the matrix is not empty. Examples: if get_location_of_max is called with matrix {{1,7},{4,2},{2,9}}, and NUM_COLS is 2, the number of rows is 3. The minimum value (1) and is at row 0 column 0 and the largest value (9) is at row 2 column 1. After the function is complete matrix is {{9,7},{4,2},{2,1}}.

In: Computer Science

In C, create a program that displays the minimum and maximum values stored in a data...

In C, create a program that displays the minimum and maximum values stored in a data file "datafile.txt". Use the following function prototype:  void minmaxarray(float value, float *min, float *max);

In: Computer Science

compare and contrast AdBlock for Chrome and AdBlock for IE(Clearly discuss the results Outline any limitations...

compare and contrast AdBlock for Chrome and AdBlock for IE(Clearly discuss the results Outline any limitations of the systems and include a Conclusion)

In: Computer Science

Modify the linked list code from class to work with strings. Insert the following food items...

Modify the linked list code from class to work with strings. Insert the following food items into the list and display the list. The items are: bread, noodles, milk, bananas, eggs. Insert them in that order. Display the list. Then delete milk and redisplay the list. Then insert ice cream and redisplay the list. Then append zucchini and redisplay the list.

c++

In: Computer Science

A Campus level (LAN) network is to be redesigned to meet the business and technical goals...

A Campus level (LAN) network is to be redesigned to meet the business and technical goals of an university.

1- Discuss the basic steps of an implementation strategy to apply various networking technologies at the campus network (Hint: consider different technologies following the TCP/IP network model).

2-Discuss An optimized routing and addressing for the campus backbone that interconnects buildings, provides access to the server farm and routes traffic to the Internet.

3- Discuss the considered performance and security metrics on the edge of the network where the traffic is routed to and from the network.

4- What additional hardware and protocols are required for transforming the data network to handle real-time voice communications within the campus network ?

In: Computer Science

Using the singly linked list code as a base, create a class that implements a doubly...

Using the singly linked list code as a base, create a class that implements a doubly linked list. A doubly linked list has a Previous link so you can move backwards in the list. Be sure the class is a template class so the user can create a list with any data type. Be sure to test all the member functions in your test program. c++

In: Computer Science