In: Computer Science
Use the following network address: 172.192.0.0/10 to create four (4) different /12 subnet addresses.
In: Computer Science
for python 3
a. Ask the user to enter 10 numbers. Each number is stored in a list called myList. Compute and print out the sum and average of the items in the list. Print the numbers that are divisible by 2 from myList.
b. Instead of using a list to store the numbers, create a loop to accept the numbers from the user, and find the average of all the numbers. Hint: use an accumulator to store the numbers that are entered by the user. An accumulator is set to zero before the start of the loop (e.g. total =0).
In: Computer Science
Hello, I am studying and I am a bit confused about registers. There are segments registers, data registers, pointer registers, index registers. But I do not really understand where these are found. Are they found in 8086 architecture? For instance if I ask what type of registers are found in 8086 architecture what will be the answer? All of these or only segment registers?
In: Computer Science
In: Computer Science
2. Specification - Given the following code base, add the appropriate function that will give the correct results/output.
CODE:
# TODO : Add Two Missing Functions HERE
mlist = [(" Orange ", 10 , 0.25) ,( " Apple ", 5 , .20) ,
(" Banana ", 2 , 0.3) ,(" Kiwi ", 1 , 0.5)]
addFruit (10 ," Lemon " ,0.1)
displayFruitList ( mlist )
OUTPUT:
Orange --- $ 2.50
Apple --- $ 1.00
Banana --- $ 0.60
Kiwi --- $ 0.50
Lemon --- $ 1.00
In: Computer Science
PYTHON 3 Your team has been hired by the new burgers place called “The hungry snake.” Per the client, you have the following information: the client’s name, burger’s name, time of the day, and the total bill. By the end of the day, your program will provide the following information:
1. Top three best clients (highest bills)
2. Name of the client with the second-to-last lowest bill
3. Busiest hour of the day (number of clients)
Assumptions
1. Your program will not handle more than 100 clients per day
2. The restaurant only has six types of burgers
3. The restaurant works from 10:00 am until 10:00 pm
In: Computer Science
Please submit a Netbeans project with a class called RecursionExercises.java implementing the following methods:
public static int reverse(int number)
This method returns the positive integer obtained when the digits of the parameter is reversed. For example, when called with the parameter 12345, this method would return 54321. (Do this with proper integer arithmetic instead of just simply converting to String, reversing that and then using parseInt to extract the result).
Hint: The number of digits of a number can be obtained by taking the integer part of the logarithm in base 10 of the number + 1 (i.e, num digits = log10(n) + 1).
public static int countPaths(int n, int m)
You are standing at the point (n,m) of the grid of positive integers and want to go to origin (0,0) by taking steps either to left or down: that is, from each point (n,m) you are allowed to move either to the point (n-1,m) or the point (n,m-1). Implement the method that based on recursion counts the number of different paths from the point (n,m) to the origin.
public static String ordString(int number)
Write a recursive method that given an integer number n that returns a String based on the following pattern:
number = 0, method returns {}
number = 1, method returns {{}}
number = 2, method returns {{}, {{}}}
number = 3, method returns {{}, {{}}, {{}, {{}}}}
In other words, given number > 0, the ordString method returns all ordStrings from 1 to number. Write a recursive method that accomplish this.
In: Computer Science
You want to train a feedforward network to recognize a hand written symbol. The network should have 7 hidden layers with 4 neurons each and categorize the image into one of 8 possible categories. The input is an image with resolutions 5 x 2 and a color depth of 2. Each layer - including the input - must have one additional neuron outside what was allocated, as a bias term. In total, how many trainable individual weight parameters (not matrices) are there within the network?
In: Computer Science
Problem 3 (4+2+2 marks). (a) Implement the following algorithm, which is given a duplicate-free array array as input, in C++. whatDoIDo (array): 1) Build a heap from array (using buildHeap as explained in class), where the heap starts at position array[0]. 2) Starting from j = size of array - 1, as long as j>0: i. Swap the entries array[0] and array[j]. ii. Percolate down array[0], but only within the subarray array[0..j-1]. iii. Decrement j by 1. Provide three input/output examples for duplicate-free arrays of size about 10. (b) What does whatDoIDo do? Explain your answer. (c) What is the worst-case running time of whatDoIDo, in dependence of the size N of the given array? Explain your answer
In: Computer Science
3. Write a function named "countNonAlpha" that accepts a string.
It will return the number of non-alphabet characters (excluding
blanks) in the string.
For example, if the string is "Hello, World!", it will return 2 for
',' and '!" in the string.
4. Write a function named "deleteZeros" that takes two
arguments:
a. an array of integer values;
b. an integer for the number of elements in the array;
The function will return the number of zeros that it has deleted
from the array
The function should shift the contents of each element in the array
whenever a zero
element is deleted
For example, if the array is defined as
int numList[] = {10, 0, 20, 30, 40, 0, 50};
The function will return 2 and shift to make the array to
contain
10 20 30 40 50
5. Write a function named "reverseCase" that takes only one
argument of a C-string (an array of characters that terminates with
a NULL ('\0') character).
The function will change all lower cases to upper case and vice
versa in that given
C-string. If the character is not an alphabet, it will be
unchanged.
The function will return the number of letters that it has
changed.
For example, if the array is defined as
char greeting[] = " Hello, World! ";
It will return 10 and change the array to contain
hEELO, wORLD!
In: Computer Science
Write a MIPS assembly program that prompts the user for some number of cents (integer) and read the user input. Then translate that number of into a number of quarters, dimes, nickels and pennies (all integers) equal to that amount and outputs the result. The output should adequately tell the user what is being output (not just the numeric results). (Make sure you use comments next to each line to describe what actions you are taking in your code. )
Sample Execution 1: Enter some number of cents: 118
118 cents is equivalent to 4 quarter(s), 1 dime(s), 1 nickel(s), and 3 penny(s).
Sample Execution 2: Enter some number of cents: -8
Error! You must enter a positive number. Please try again.
(Make sure to write a program where both sample execution should run. )
In: Computer Science
Write a program that displays a single character at 100 random screen locations, using a timing delay of 100 milliseconds.
Hint: Use the GetMaxXY procedure to determine the current size of the console window.
How to code this program with a defined character 'A' (I do not want to write a character to get a single character in the output console)
In: Computer Science
Problem: Grading Function
#Write a function called getScore() that does not take any parameter. Inside the function, it asks the user to input scores for 3 items (Each of the items is out of 100). The final score is calculated by 20% of item1 + 30% of item2 + 50% of item3. After calculating the final score, the function returns it to the caller. The scores are floating-point numbers.
#Write another function called getLetterGrade() that takes a float parameter and returns the letter grade based on the number passed to it as an actual parameter.
#Write the main function to test your program.
Call the getScore() function from the main function and after getting the final score from the getScore function, you should call the getLetterGrade() function to get the Grade for that score. Then print the letter grade returned by the getLetterGrade() function.
Here is the scale of the letter grade:
A [>=90]
B [80 – 90)
C [70 – 80)
D[ 60 – 70)
F [<60]
In: Computer Science
Question #11. Write a script that uses the menu function to prompt the user to select the current day of the week. Then use the menu function to prompt the user to select their favorite day of the week. Print a message telling the user how many days it will be until their favorite day. The output must include the current day, the favorite day, and the number of days until the favorite day. Debug your programming by running it many times and testing it with different input combinations. Here are some sample runs
matlab
In: Computer Science