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, 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 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
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 editor of your choice). This program takes a number of command line arguments, parses them as ints, and then displays:
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
In: Computer Science
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)
Exercise 2 (20 Points)
Exercise 3 (20 Points)
Lexcorp made $2517.85 this period.
Exercise 4 (10 Points)
Exercise 5 (20 Points)
Exercise 6 (10 Points)
Exercise 7 (5 Points)
In: Computer Science
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;
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 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 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 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 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 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 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