Embedded computer systems:
Configure and code clock for Pic24e referring to the example C code given below.
a) Write code on how to configure bits that uses its fast RC oscillator with PLL to run at 40MHz. Assume the RC's frequency is 7.5MHz.
b) Write code on how to configure bits that uses its primary crystal (XT) with PLL to run at 40MHz. Assume the external clock is a crystal oscillator of 8MHz.
====== Given C Code =======
#include "ConfigurationBits.h"
void initializeSystem() {
// Configure the device PLL to obtain 60 MIPS operation. The crystal
// frequency is 8MHz. Divide 8MHz by 2, multiply by 60 and divide by
// 2. This results in Fosc of 120MHz. The CPU clock frequency is
// Fcy = Fosc/2 = 60MHz.
PLLFBD = 58; /* M = 60 */
CLKDIVbits.PLLPRE = 0; /* N1 = 2 */
CLKDIVbits.PLLPOST = 0; /* N2 = 2 */
/* Initiate Clock Switch to Primary
* Oscillator with PLL (NOSC= 0x3)*/
__builtin_write_OSCCONH(0x03);
__builtin_write_OSCCONL(0x01);
while (OSCCONbits.COSC != 0x3);
// Wait for PLL to lock
while (OSCCONbits.LOCK != 1);
}
In: Computer Science
4. What is ZooKeeper? Who developed it? Describe its main functions.
In: Computer Science
Write a C program in Unix which uses a function called search to find
the location of a value in THREE arrays of floats. The function should
take three parameters :
the value to be found
the array to be searched
the size of the array
N.B.!!!! The main program should read in three arrays of varying size
example : array a has twelve elements
array b has six elements
array c has nine elements
array d has four elements
input to these arrays terminated by illegal input(see handout)
the function should return for each array the index where the
value is found. If not found the function should return -1.
In: Computer Science
JAVA
Stack - Implementation.
You will be able to use the push, pop and peek of Stack concept. Post-Fix calculator - When an arithmetic expression is presented in the postfix form, you can use a stack to evaluate the expression to get the final value. For example: the expression 3 + 5 * 9 (which is in the usual infix form) can be written as 3 5 9 * + in the postfix. More interestingly, post form removes all parentheses and thus all implicit precedence rules.
Program Implementation Requirements
Use the stack concept to create a post-fix calculator. I will be using a test-harnessPreview the document to run your program. Please make sure it meets the requirements to be run by the test harness.
Test harness:
public class StackCalcTest {
public static void main(String[] args) {
StackCalc stackCalc = new StackCalc();
String[] values = {"3", "5", "9", "*", "+"};
for(int i = 0; i < 5; i++) {
stackCalc.stack.push(values[i]);
}
System.out.println(stackCalc.stack);
System.out.println(stackCalc.answer()); }}
In: Computer Science
I need unique answer, NO COPY PLEASE!
What is a Database key?
Explain various types of database keys (Super key, Candidate key, Primary key and Foreign key) with your clear definitions/ideas and at least one appropriate example for each one of them.
In: Computer Science
In C ++, Design and implement a program that reads from the user four integer values between 0 and 100, representing grades. The program then, on separate lines, prints out the entered grades followed by the highest grade, lowest grade, and averages of all four grades. Format the outputs following the sample runs below.
Sample run 1:
You entered: 95, 80, 100, 70
Highest grade: 100
Lowest grade: 70
Average grade: 86.25
In: Computer Science
After downloading the workbook example source-code for Microsoft Visual Studio 2015-2017 Community Ed., and installing, configuring, and running Visual Studio with ASP.NET developers kit, develop and construct an APA formatted paper (also use LIRN (or JSTOR), Internet, and the textbook) that provides a detailed analysis of the following concepts:
The importance and proper of data validation for applications
The use of state(s), object(s) and their relationship to ASP.NET
Strategies for the use and implementation of master pages to enhance content
Implementation and use of Bootstrap in ASP.NET and strategies for generating HTML dynamically to enhance default styles
Advantages of using the FriendlyUrls feature in automating applications
The use of ADO.net in database programming
In: Computer Science
Language: Java
Topic: Deques
Using the following variables/class:
public class LinkedDeque<T> {
// Do not add new instance variables or modify existing
ones.
private LinkedNode<T> head;
private LinkedNode<T> tail;
private int size;
Q1: Write a method called "public void addFirst(T data)" that does the following:
* Adds the element to the front of the deque.
* Must be O(1)
* @param data the data to add to the front of the deque
* @throws java.lang.IllegalArgumentException if data is null
Q2: Write a method called "public void addLast(T data)" that does the following:
* Adds the element to the back of the deque.
* Must be O(1)
* @param data the data to add to the back of the deque
* @throws java.lang.IllegalArgumentException if data is null
In: Computer Science
Examples:
Write a java program to read a line of text and tell if the line is a palindrome. Use a stack to read each non-blank character on a stack. Treat both upper-case and lower-case version of the letter as being the same character.
- Provide these 5 sample outputs and tell if each is a palindrome or not.
Too bad--I hid a boot
Some men interpret eight memos
"Go Hang a Salami! I'm a Lasagna Hog"
(title of a book on palindromes by Jon Agee, 1991)
A man, a plan, a canal—Panama
Gateman sees my name, garageman sees name tag
Show the LinkedtStackADT<T> interface
2. Create a LinkedStackDS<T> with the following methods: default constructor, overloaded constructor, copy constructor, isEmptyStack, push, peek, pop
3. Create a private inner StackNode<T> class with the following methods: default constructor, overloaded constructor, toString
3. Exception classes: StackException, StackUnderflowException, StackOverflowException
4. Create a PalindromeDemo class that instantiates a LinkedStackDS<Character> object. Execute a do-while loop that asks the user using dialog boxes to “Input a String for Palindrome Test:” Use the replaceAll method to remove all blanks and special characters from testStr. Output whether or not it is a palindrome in a dialog box. [Use the 5 inputs given on the other handout sheet for testing.]
In: Computer Science
Brief Introduction
Suppose that you are an analyst for the ABC Company, a large consulting firm with offices around the world. The company wants to build a new knowledge management system that can identify and track the expertise of individual consultants anywhere in the world on the basis of their education and the various consulting projects on which they have worked. Assume that this is a new idea that has never before been attempted in ABC or elsewhere. ABC has an international network, but the offices in each country may use somewhat different hardware and software. ABC management wants the system up and running within a year.
Action Items
Given the situation, what methodology would you recommend that ABC Company use? Why?
Please, Please, Please and Please…
1. I need new and unique answers, please. (Use your own words, don't copy and paste, even when you answer like theses answers before.)
2. Please Use your keyboard to answer my Questions. (Don't use handwriting)
3. Please and please i need a good and a perfect answers.
Thank you..
In: Computer Science
Part 2: What is the difference between historical analytics or predictive analytics in detail and provide some example?
In: Computer Science
Design and implement a program that reads a series of 10 integers from the user and prints their average. Read each input value as a string, then attempt to convert it to an integer using the Integer.parseInt method. If this process throws a NumberFormatException (meaning that the input is not a valid integer), display an appropriate error message and prompt for the number again. Continue reading values until 10 valid integers have been entered.
In: Computer Science
[C++] Find the Recurrence Relation equations for the following functions:
Please explain how you got these equations.
BSTClass::Node* BSTClass::createNode(const string x) {
Node* newNode = new Node;
newNode->data = x;
newNode->left = nullptr;
newNode->right = nullptr;
return newNode;
}
void BSTClass::insertNode(const string x) {
insertNodeUtil(x, root);
}
void BSTClass::insertNodeUtil(const string data, Node* subTreePtr) {
if (root == nullptr) {
root = createNode(data);
}
else if (data <= subTreePtr->data) {
if (subTreePtr->left == nullptr)
{
subTreePtr->left = createNode(data);
}
else {
insertNodeUtil(data, subTreePtr->left);
}
}
else {
if (subTreePtr->right ==
nullptr) {
subTreePtr->right = createNode(data);
}
else {
insertNodeUtil(data, subTreePtr->right);
}
}
}
void BSTClass::printInOrder() {
printInOrderUtil(root);
cout << endl;
}
void BSTClass::printInOrderUtil(Node* subTreePtr) {
if (root == nullptr) {
cout << "The TREE is Empty
..." << endl;
}
else {
if (subTreePtr->left != nullptr)
{
printInOrderUtil(subTreePtr->left);
}
cout << subTreePtr->data << " ";
if (subTreePtr->right !=
nullptr) {
printInOrderUtil(subTreePtr->right);
}
}
}
bool BSTClass::findKey(const string key) {
return findKeyUtil(key, root);
}
bool BSTClass::findKeyUtil(const string key, Node* subTreePtr) {
if (root == nullptr) {
cout << "Key (" << key
<< ") is NOT found, it is an empty tree ..." <<
endl;
return false;
}
if (subTreePtr == nullptr) {
cout << "Key (" << key
<< ") is NOT found" << endl;
return false;
}
else if (subTreePtr->data == key) {
cout << "Key (" << key
<< ") is FOUND" << endl;
return true;
}
else if (key < subTreePtr->data) {
return findKeyUtil(key,
subTreePtr->left);
}
else {
return findKeyUtil(key,
subTreePtr->right);
}
}
int BSTClass::treeHeight() {
if (root == nullptr)
return 0;
else
return treeHeightUtil(root);
}
int BSTClass::treeHeightUtil(Node* subTreePtr) {
if (subTreePtr == nullptr) {
return 0;
}
else {
int lHeight =
treeHeightUtil(subTreePtr->left);
int rHeight =
treeHeightUtil(subTreePtr->right);
return (lHeight >= rHeight ?
lHeight + 1 : rHeight + 1);
}
}
In: Computer Science
Using JES/ Jython
Function Name: decoder()
Parameters:
message1-string containing first part of secret message
message2-string containing second part of secret message
Write a function that decodes them by retrieving every other character from both encrypted messages.
Test Cases:
>>>decoder("Rsupnk","oFpansot")
Run Fast
>>>decoder("Fkrneoem ktthpes","eAvleiselnos")
Free the Aliens
In: Computer Science
For this program you will add and test 2 new member functions to the class in
//************************ intSLList.h ************************** // singly-linked list class to store integers #ifndef INT_LINKED_LIST #define INT_LINKED_LIST class IntSLLNode { public: IntSLLNode() { next = 0; } IntSLLNode(int el, IntSLLNode *ptr = 0) { info = el; next = ptr; } int info; IntSLLNode *next; }; class IntSLList { public: IntSLList() { head = tail = 0; } ~IntSLList(); int isEmpty() { return head == 0; } void addToHead(int); void addToTail(int); int deleteFromHead(); // delete the head and return its info; int deleteFromTail(); // delete the tail and return its info; void deleteNode(int); bool isInList(int) const; void printAll() const; private: IntSLLNode *head, *tail; }; #endif
The two member functions are:
insertByPosn(int el, int pos)
Assuming that the positions of elements of a list begin numbering at 1 and continue to the end of the list, you will insert a new node with info value el at position pos. pos will become the position of the new node in the modified list. For example, if pos = 1, insert the new node at the head of the list. If pos = 2, for example, insert the new node BEFORE the node currently at position 2. If the list is empty prior to insertion, insert the new node in the list and adjust head and tail pointers. If pos is too large, don't do anything. If pos is 0 or negative, don't do anything.
removeByPosn(int pos)
Assume position of elements are defined as above. If pos is zero or negative, do nothing. If the list is empty prior to the request to delete a node, do nothing. If pos is too large, do nothing.
To aid in verifying results, you should use the following modified version of printAll. This requires: #include <string>
void IntSLList::printAll(string locn) const {
cout << "Contents of the list " << locn << endl;
for (IntSLLNode *tmp = head; tmp != 0; tmp = tmp->next)
cout << tmp->info << " ";
if (head != 0)
cout << "Head is: " << head->info << " Tail is: " << tail->info << endl << endl;
}
For extra credit, you can also create the following:
reverseList()
Traverse the existing list beginning at the head and create a new (reversed) list with head newhead and tail newtail. Put new nodes in the new list by putting the new nodes at the head of the new list each time. Do not call any other member functions during this process. If the list to be reversed is empty, make sure that you account for this case. After the new (reversed) list is created, delete the old list using its destructor.
The test program to be used is:
int main()
{
IntSLList singly_linked_list = IntSLList();
singly_linked_list.addToHead(9);
singly_linked_list.addToHead(7);
singly_linked_list.addToHead(6);
singly_linked_list.printAll("at creation:");
singly_linked_list.insertByPosn(8, 2);
singly_linked_list.printAll("after insertion of 8 at position 2:");
singly_linked_list.insertByPosn(10, 4);
singly_linked_list.printAll("after insertion of 10 at position 4:");
singly_linked_list.insertByPosn(12, 6);
singly_linked_list.printAll("after insertion of 12 at position 6:");
singly_linked_list.insertByPosn(14, 8);
singly_linked_list.printAll("after attempted insertion of 14 at position 8:");
singly_linked_list.insertByPosn(5, 1);
singly_linked_list.printAll("after insertion of 5 at position 1:");
singly_linked_list.insertByPosn(4, 0);
singly_linked_list.printAll("after attempted insertion of 4 at position 0:");
singly_linked_list.removeByPosn(2);
singly_linked_list.printAll("after deletion of 6 at position 2:");
singly_linked_list.removeByPosn(6);
singly_linked_list.printAll("after deletion of 12 at position 6:");
singly_linked_list.removeByPosn(10);
singly_linked_list.printAll("after attempted deletion at position 10:");
// insert test for optional list reversal here
return (0);
}
The correct output from running the test program is:
Contents of the list at creation:
6 7 9 Head is: 6 Tail is: 9
Contents of the list after insertion of 8 at position 2:
6 8 7 9 Head is: 6 Tail is: 9
Contents of the list after insertion of 10 at position 4:
6 8 7 10 9 Head is: 6 Tail is: 9
Contents of the list after insertion of 12 at position 6:
6 8 7 10 9 12 Head is: 6 Tail is: 12
Contents of the list after attempted insertion of 14 at position 8:
6 8 7 10 9 12 Head is: 6 Tail is: 12
Contents of the list after insertion of 5 at position 1:
5 6 8 7 10 9 12 Head is: 5 Tail is: 12
Contents of the list after attempted insertion of 4 at position 0:
5 6 8 7 10 9 12 Head is: 5 Tail is: 12
Contents of the list after deletion of 6 at position 2:
5 8 7 10 9 12 Head is: 5 Tail is: 12
Contents of the list after deletion of 12 at position 6:
5 8 7 10 9 Head is: 5 Tail is: 9
Contents of the list after attempted deletion at position 10:
5 8 7 10 9 Head is: 5 Tail is: 9
In: Computer Science