Propose an algorithm in C to match numbers / tokens (words) from one array to another array and pull out the matching numbers.
In: Computer Science
1. Write a superclass encapsulating a rectangle. A rectangle has two attributes representing the width and the height of the rectangle. It has methods returning the perimeter and the area of the rectangle. This class has a subclass, encapsulating a parallelepiped, or box. A parallelepiped has a rectangle as its base, and another attribute, its length; it has two methods that calculate and return its area and volume. You also need to include a client class (with the main method) to test these two classes i need this in python
In: Computer Science
(must be done in JAVA code)
A company dedicated to parking management has decided to renew itself by automating its control process since this process is done manually. The company has hired its development team to automate the process and gave it an October 19th deadline until 6 pm. An analyst defined the system requirements as follows:
1. The system must allow configuring the number of spaces that a vehicle parking lot will contain.
2. The system must allow the person in charge (normally a security person) to consult the available spaces to be able to indicate to the arriving users where to park.
3. The system must allow the person in charge (normally a security person) to enter the space where they will park, the license plate, brand, color and commercial value of the vehicle to be parked. In some cases, the person in charge may omit the commercial value of the vehicle due to ignorance, for these cases a default value of 30 million will be saved.
4. The system must allow the status of all the spaces in the building to be consulted.
5. The system must allow printing all the information of the parked vehicles.
6. The system must allow consulting the information of a parked vehicle.
7. The system must be able to change the sensor status (available to occupied) when a car occupies a parking space.
In: Computer Science
Write a neural network in python for multiclass classification of an imbalanced dataset that makes a successful model that both trains and evaluates the model and prints the Accuracy, Precision, Recall, and F1 score. Data will be in the form of a CSV file with 600,000 samples (or rows in the CSV) of 15 classes (for y_train and y_test) and 78 input dimensions/features. The imbalance will have some classes that have a low of only 8 samples taken. Your job is the make a neural network to fix those imbalances and optimize the network for the best Accuracy, Precision, Recall, and F1 score for all 15 classes.
Sample data -
22 | 6 | 386359 | 22 | 20 | 1912 | 2665 | 640 | 0 | 86.90909 | 137.688 | 976 | 0 | 133.25 | 268.7713 | 11846.5 | 108.7072 | 9423.39 | 22717.21 | 122019 | 5 | 385442 | 18354.38 | 29591.49 | 122019 | 212 | 386353 | 20334.37 | 43298.97 | 161209 | 10 | 0 | 0 | 0 | 0 | 712 | 648 | 56.94186 | 51.76533 | 0 | 976 | 106.4419 | 207.2919 | 42969.92 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 108.9762 | 86.90909 | 133.25 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 1912 | 20 | 2665 | 26883 | 230 | 16 | 32 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | Class 4 |
0 | 0 | 1.13E+08 | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026634 | 56319965 | 33.23402 | 56319988 | 56319941 | 1.13E+08 | 56319965 | 33.23402 | 56319988 | 56319941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.026634 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3 | 0 | 0 | 0 | -1 | -1 | 0 | 0 | 0 | 0 | 0 | 0 | 56319965 | 33.23402 | 56319988 | 56319941 | Class 7 |
In: Computer Science
Problem 2. Purpose: practice algorithm design using dynamic programming. A subsequence is palindromic if it is the same whether read left to right or right to left. For instance, the sequence A,C,G,T,G,T,C,A,A,A,A,T,C,G has many palindromic subsequences, including A,C,G,C,A and A,A,A,A (on the other hand, the subsequence A,C,T is not palindromic). Assume you are given a sequence x[1...n] of characters. Denote L(i,j) the length of the longest palindrome in the substring x[i,...,j]. The goal of the Maximum Palindromic Subsequence Problem (MPSP) is to take a sequence x[1,...,n] and return the length of the longest palindromic subsequence L(1,n).
a) (4 points) Describe the optimal substructure of the MPSP and give a recurrence equation for L(i,j).
b) (6 points) Describe an algorithm that uses dynamic programming to solve the MPSP. The running time of your algorithm should be O(n2).
In: Computer Science
This is Java programming question
Basic sales tax is applicable at a rate of 10% on all goods, except books, food, and medical products that are exempt. Import duty is an additional sales tax applicable on all imported goods at a rate of 5%, with no exemptions.
When I purchase items I receive a receipt which lists the name of all the items and their price (including tax), finishing with the total cost of the items, and the total amounts of sales taxes paid. The rounding rules for sales tax are that for a tax rate of n%, a shelf price of p contains (np/100 rounded up to the nearest 0.05) amount of sales tax.
Write an application that prints out the receipt details for these shopping baskets...
Input:
Input 1:
1 book at 12.49
1 music CD at 14.99
1 chocolate bar at 0.85
Input 2:
1 imported box of chocolates at 10.00
1 imported bottle of perfume at 47.50
Input 3:
1 imported bottle of perfume at 27.99
1 bottle of perfume at 18.99
1 packet of headache pills at 9.75
1 box of imported chocolates at 11.25
Output:
Output 1:
1 book : 12.49
1 music CD: 16.49
1 chocolate bar: 0.85
Sales Taxes: 1.50
Total: 29.83
Output 2:
1 imported box of chocolates: 10.50
1 imported bottle of perfume: 54.65
Sales Taxes: 7.65
Total: 65.15
Output 3:
1 imported bottle of perfume: 32.19
1 bottle of perfume: 20.89
1 packet of headache pills: 9.75
1 imported box of chocolates: 11.85
Sales Taxes: 6.70
Total: 74.68
In: Computer Science
Why would a host contact a DNS server? If a local DNS server does not know the IP address for a host name, what will it do? What kind of organization must maintain one or more DNS servers? Why? How does your organization protect itself from DNS cache poisoning? Do you think this is sufficient? Why or why not?
In: Computer Science
1) Draw a diagram showing the relationship of the EDX, DX, DL and DH registers. Page 29 shows EAX that you can follow as a template.
2) What does the program counter (EIP register in 80x86) point to?
In: Computer Science
Java Programming Activity Description: This lab requires you to simulate the rolling of two dice. Two dice consisting of 6 sides are rolled. Write a program that simulates this. The user will be asked if he/she wishes to continue the roll of dice. If the answer is, “Y” or “y”, then your application will continue to roll the two dice. Each roll of the dice must occur 6 times, each time the user agrees to continue (see sample output). Use a for loop in order to keep track of the number of times the dice are rolled.
In: Computer Science
8. Create a truth table and determine the results for the following equation and values
Equation : bool b = ((a+4< 7) || ((b-a > 10) && !(c*a == 8)))
Values : a = 2; b = 8; c = 4
9. Write a program using Atom and submit via Blackboard.
a. Request an integer whole dollar amount from the console.
b. Using the least amount of bills ($50,$20,$10,$5,$1) necessary, calculate how many of each bill type you will need to get to that value.
Output Example 1 (input is bold and italicized)
Enter a whole dollar amount as n integer: 633
You will need:
12 $50 bill(s).
1 $20 bill(s).
1 $10 bill(s).
0 $5 bills(s).
3 $1 bill(s).
Output Example 2 (input is bold and italicized)
Enter a whole dollar amount as an integer: 364
You will need:
7 $50 bill(s).
0 $20 bill(s).
1 $1 bill(s).
0 $5 bills(s).
4 $1 bills(s).
In: Computer Science
You are recently appointed as an International IT Consultant and IoT
Specialist in a Multi-national IT Company. As first project, you are
assigned by the Managing Director (MD) to propose and design a
feasible technical architecture for IoT ecosystem in a smart city. The
smart city assigned to you is Kuala Lumpur (KL), the capital of
Malaysia.
a. Design and draw the technical architecture for the IoT
ecosystem. that you propose to be implemented in
KL.
In: Computer Science
Suppose that you have gloves of 4 colours in the drawer: black, brown, grey and white, 6 pairs of each colour. Every glove is either left or right and does not fit on the other hand.
If you are taking gloves out in the dark, without looking, what is the minimum number you need to take out to guarantee that you have a pair (that is, a left and a right of the same colour)?
What is the minimum number of gloves you need to take out to guarantee that you have three pairs of gloves? (Here, colours do not matter, as long as each pair consists of a left and a right of the same colour)
What is the minimum number of gloves you need to take out to guarantee that you have a pair of white gloves?
What is the minimum number of gloves you need to take out to guarantee that you have three pairs of three different colours?
What is the minimum number of gloves you need to take out to guarantee that you have a pair which is not white?
In: Computer Science
How the token buckets and WFQs can be used together to provide policing mechanisms.
book: Computer networking: a top-down approach
In: Computer Science
5. Write a C++ statement or statements that will:
Print the first two digits and the last two digits of any 4 digit number stored in an integer variable n.
For example, given int n = 5623, print
56 23.
6. Write C++ statements that will align the following three lines as printed in two 20 character columns.
Name Years President
Abraham Lincoln 1860-1865
Thomas Jefferson 1801-1809
7. Write a C++ statement or statements that will Output if a string has a length greater than 10, equal to 10 or less than 10.
Examples :
string str1 = “Four Score and Seven Years Ago” would output “String Length > 10”
string str2 = “Good Day” would output “String Length < 10”
string str3 = 0123456789” would output “String Length = 10”
In: Computer Science
Write a program in C that does the following:
1. Declares an array called numbers_ary of 6 integer numbers.
2. Declares an array called numbers_ary_sq of 6 integer numbers.
3. Reads and sets the values of numbers_ary from the keyboard using a loop.
4. Sets the values of numbers_ary_sq to the square of the values in numbers_ary using a loop.
5. Displays the values of numbers_ary and the values of numbers_ary_sq beside each other using a loop.
Example Output
Assume that both arrays have only 3 integer numbers and numbers_ary has [2 3 4]. Then,numbers_ary_sq will have [4 9 16] and the following would be displayed:
2 -> 4
3 -> 9
4 -> 16
Rubrics
In: Computer Science