Compare and contrast the 3 types of facts tables: Additive, Semi-Additive, and Non-Additive.
In: Computer Science
Answer all the questions given below
Explain the difference between edge triggered and level triggered interrupt by sketch. Where the starting address of the memory location of every interrupt is stored?
(b) Consider the following 8051 interfacing problem. Crystal frequency: 11.059MHz. The LED
D8 will light up with every key press as shown below.
Initialize IE register for external interrupt at INT0
Initialize TCON register for the appropriate type of interrupt
Declare and define the interrupt service routine
Access and configure relevant pin as needed
Call back action in the main function as needed
In: Computer Science
what are Media Selection Criteria? Include in your descriptions Cost, Speed, Distance and expandability, Environment and Security. Why each criteria is important?
In: Computer Science
(Python language)
Going out with the gang?
You are planning an outing with some friends and need to calculate the total price of the tickets. A regular ticket usuallycosts$3.99 and a student ticket costs only $2.99. If the total number of tickets being ordered (including both students andregular tickets) is at least 10, then a 10% discount is applied to the order. However, if it is a holiday, then the at-least-tengroup discount is only 5% (not 10%).Write a functiontotalticketprice: given three parameters (the number of regular tickets, the number of studenttickets, and whether or not it is a holiday), compute and return the total. Be sure to define and use constants forREGULARTICKETPRICEandSTUDENTTICKETPRICE. We’ll check for this.
Is it time for tea?
Your friend lives in London, England in a timezone that is normally 6−hours ahead of Toronto, Canada. But sometimesEngland and Canada switch to daylight savings time on different dates. If Toronto is on daylight savings time and Londonis not, then the time difference is only 5−hours. Conversely, if London is on daylight savings time and Toronto is not, thetime change is 7−hours. Of course, if both are on daylight savings time, the difference is back to the standard 6−hours. Write the functionbritishtimewhose first parameter is a float value representing the time in Toronto as 24-hour time.The next two parameters are booleans indicating whether Toronto and London are on daylight savings time, respectively.Your function should return the time in London as a float.One last complication is that your function should not return a time greater or equal to 24.0 or less than 0.0.Suggestion: at first do not consider this final complication and write test cases where the expected output is already less than24.0(in the same day). Once that is working, add a test case where the time in Toronto is so late at night that London isalready the next morning. Fix the body of your function to work correctly.For the purpose of this lab, afunctiontakes some input (not always) and returns some output (not always). Go back and makesure that none of your functions print anything!Printing is notthe same as returning!
In: Computer Science
Write a program in Java Swing that can Display all the name list then will generate and display the longest name out of a list of names. Thank you...
In: Computer Science
Structured query language (SQL):
A. Does not allow conditions to be put on the query. B. Is a complex language used to extract data from a limited number of tables. C. Isolates data within tables. D. Takes advantage of the primary record key to link tables.
In: Computer Science
Use the Web, University Library, or other sources to find out specifics about the Encrypted File System that is part of Windows. Describe this file system, and any strengths and any weaknesses you find. Write a 3 to 4 page paper use APA format and adhere to the writing rubric.
In: Computer Science
Conduct some research and find a recent computer virus that has attacked either a company or individuals. Explain how the virus effects computers or networks and how to stop the virus.
In: Computer Science
I am taking TECH490: Integrated Technology Management Assessment and need to show that I have accoplished this task by school work or on my job.
What examples can I use to show that I met this outcome?
Apply knowledge of mathematics to problem-solving in management contexts.
In: Computer Science
The purpose of the program is to play the game of M.A.S.H. (Mansion, Apartment, Shack, House). This program asks the user multiple questions and then randomly generates answers based on the answers to predict the user’s future. By the time you finish this program, you will have learned how to make a menu based program, use switch statements, validate user input with loops, allow a program to run multiple times until user wants to quit, and mix cin>> and getline() intermittently in a program.
You will be predicting the user’s future by selecting one of their three choices randomly. You will need to create a random number for each “category” – this means there should be in total 7 numbers randomly generated between 1 and 3. So for example, you will generate a random number between 1 and 3 for the names of people.
You will also generate one more random number (this would make 8 total) between 1 and 4 which will indicate if the user will live in a mansion (1), apartment (2), shack (3), or house(4).
In: Computer Science
In Java, code an intelligent system for diagnosis breast cancer. There are no special requirements, you have free range to do so, as this is a learning experience. Be sure to use block comments and it would be beneficial to provide explanation. Thanks
In: Computer Science
Cplusplus
Task: You are to write a class called Monomial, using filenames monomial.h and monomial.cpp, that will allow creation and handling of univariate monomials, as described below.
Monomial Description
Each monomial object has following properties:
Class Details
The single constructor for the Monomial class should have 2 parameters: an floating point coefficient value (optional, with a default value of 1.0); and an integer power value (optional, with a default value of 1). If the power value is less then 1, set the power to 1. The class will need to provide internal storage for any member data that must be kept track of.
There should be member functions GetCoefficient, and GetPower, which will return the monomial’s coefficient value, and monomial’s power value, respectively. The GetPower method should return integer results. The GetCoefficient function should return its result as a float.
There should be member functions SetPower, which will set the monomial’s power to the arbitrary positive value. If the parameter is not positive then set the power to the default value 1.
There should be member function Add, which adds the one monomial to the other. The parameter of this member function need to be a constant reference to the other monomial object. The monomials can only be added if they have the same power, otherwise error message must be printed. The result of the addition is saved in the caller object.
There should be two member functions Multiply (overrides), which each allow to multiply a monomial to a number and to another monomial. The first member function need to accept floating point parameter that is used to perform multiplication of the real number on the the monomial object. The second member function need to accept a constant reference to the other monomial object. Use monomials to coefficients and powers to perform their multiplication. The result of the multiplication is saved in the caller object.
There should be a member function called Exponent that perform exponentiation (raise to power) of the monomial to the specified power value. You only can raise monomial to the positive power, if the power parameter is not positive print error message. The result of the exponentiation is saved in the caller object.
A sample driver program (called monomial-driver.cpp) is provided. It uses objects of type Monomial and illustrates sample usage of the member functions.
Your class declaration and definition files must work with my main program from the test driver, as-is (do not change my program to make your code work!). You are encouraged to write your own driver routines to further test the functionality of your class, as well. Most questions about the required behavior of the class can be determined by carefully examining my driver program and the sample execution. Keep in mind, this is just a sample. Your class must meet the requirements listed above in the specification - not just satisfy this driver program. (For instance, I haven’t tested every illegal fill character in this driver program - I’ve just shown a sample). Your class will be tested with a larger set of calls than this driver program represents.
General Requirements
Test Driver:
//
// driver.cpp -- driver program to demonstrate the behavior of
// the Monomial class
#include <iostream>
#include "monomial.h"
using namespace std;
int main()
{
// create some monomial: x, 2x, 12.5x³, -3xâ¶
Monomial m1, m2( 2.0 ), m3( 12.5, -1 ), m4( -3.0 , 6);
// display monomial
cout << "Monomial `m1` has the coefficient " << m1.GetCoefficient()
<< " and power " << m1.GetPower() << ": ";
m1.Print();
cout << "Monomial `m2` has the coefficient " << m2.GetCoefficient()
<< " and power " << m2.GetPower() << ": ";
m2.Print();
cout << "Monomial `m3` has the coefficient " << m3.GetCoefficient()
<< " and power " << m3.GetPower() << ": ";
m3.Print();
cout << "Monomial `m4` has the coefficient " << m4.GetCoefficient()
<< " and power " << m4.GetPower() << ": ";
m4.Print();
// Change monomial power
cout << "Monomial `m3` power wasn't changed: ";
m3.SetPower(-1);
m3.Print();
cout << "Monomial `m3` power was changed: ";
m3.SetPower(3);
m3.Print();
// can add monomials with the same powers
cout << "Monomial addition" << endl;
m1.Add(m2);
cout << "x + 2x = ";
m1.Print();
// cannot add monomials with different powers
cout << "x³ + 12.5x³ = ";
m2.Add(m3);
// can multiply monomial to a number
cout << "Monomial multiplication by a number" << endl;
m2.Multiply(2.5);
cout << "2x * 2.5 = ";
m2.Print();
// can multiply monomials
cout << "Monomial multiplication by a monomial" << endl;
m3.Multiply(m4);
cout << "12.5x³ * -3xⶠ= ";
m3.Print();
// can raise monomial to the power
cout << "Monomial exponentiation" << endl;
m4.Exponent(3);
cout << "(-3xâ¶)³ = "; // -27x^18
m4.Print();
cout << "(3x)â° = "; // -27x^18
m1.Exponent(-10);
return 0;
}
Test Driver Output
Monomial `m1` has the coefficient 1 and power 1: 1x^1 Monomial `m2` has the coefficient 2 and power 1: 2x^1 Monomial `m3` has the coefficient 12.5 and power 1: 12.5x^1 Monomial `m4` has the coefficient -3 and power 6: -3x^6 Monomial `m3` power wasn't changed: 12.5x^1 Monomial `m3` power was changed: 12.5x^3 Monomial addition x + 2x = 3x^1 x³ + 12.5x³ = Cannot add monomials with different powers Monomial multiplication by a number 2x * 2.5 = 5x^1 Monomial multiplication by a monomial 12.5x³ * -3x⁶ = -37.5x^9 Monomial exponentiation (-3x⁶)³ = -27x^18 (3x)⁰ = Can raise only to a positive power
In: Computer Science
C++ ONLY Binary Search and Selection Sort
A binary search first requires a sort.
Use a selection sort to organize an array, then find the value using a binary search.
Input the array, and a value to find.
Output the sorted array and the value if contained in the array.
/*
* File: main.cpp
* Author:
* Created on:
* Purpose: Binary Search
*/
//System Libraries
#include <iostream> //Input/Output Library
#include <cstdlib> //Random Functions
#include <ctime> //Time Library
using namespace std;
//User Libraries
//Global Constants, no Global Variables are allowed
//Math/Physics/Conversions/Higher Dimensions - i.e. PI, e,
etc...
//Function Prototypes
void fillAry(int [],int);
void prntAry(int [],int,int);
void selSrt(int [],int);
bool binSrch(int [],int,int,int&);
//Execution Begins Here!
int main(int argc, char** argv) {
//Set the random number seed
srand(static_cast<unsigned int>(time(0)));
//Declare Variables
const int SIZE=100;
int array[SIZE];
int indx,val;
//Initialize or input i.e. set variable values
fillAry(array,SIZE);
//Sorted List
selSrt(array,SIZE);
//Display the outputs
prntAry(array,SIZE,10);
cout<<"Input the value to find in the
array"<<endl;
cin>>val;
if(binSrch(array,SIZE,val,indx))
cout<<val<<" was found at indx =
"<<indx<<endl;
//Exit stage right or left!
return 0;
}
In: Computer Science
Java Question
I have a Queue containing String type taking in a text file with an iterator.
I need to use ArrayList and HashMap for freqHowMany to get a frequency table in descending order by the highest frequency words in the text. Any help would be much appreciated and thanks!
final Iterator input = new Scanner(System.in).useDelimiter("(?U)[^\\p{Alpha}0-9']+");
final Queue queueFinal = new CircularFifoQueue<>(wordsLast);
while (input.hasNext()) {
final String queueWord = input.next();
if (queueWord.length() > minimumLength) {
queueFinal.add(queueWord); // the oldest item automatically gets evicted
}
System.out.println(queueFinal);
}
}
}
EXAMPLE:
Your program prints an updated word cloud for each sufficiently long word read from the standard input.
The program takes up to three positive command-line arguments:
Your program then reads a continuous stream of words, separated by whitespace or other non-word characters, from the standard input. (A word can have letters, numbers, or single quotes.) For each word read, your program prints to standard output, on a single line, a textual representation of the word cloud of the form
The idea is to connect this tool to a streaming data source, such as Twitter, or speech-to-text from a 24-hour news channel, and be able to tell from the word cloud in real time what the current "hot" topics are.
THANKS!
In: Computer Science
CPP Task: You are to write a class called Monomial, using filenames monomial.h and monomial.cpp, that will allow creation and handling of univariate monomials, as described below.
Monomial Description
Each monomial object has following properties:
Class Details
The single constructor for the Monomial class should have 2 parameters: an floating point coefficient value (optional, with a default value of 1.0); and an integer power value (optional, with a default value of 1). If the power value is less then 1, set the power to 1. The class will need to provide internal storage for any member data that must be kept track of.
There should be member functions GetCoefficient, and GetPower, which will return the monomial’s coefficient value, and monomial’s power value, respectively. The GetPower method should return integer results. The GetCoefficient function should return its result as a float.
There should be member functions SetPower, which will set the monomial’s power to the arbitrary positive value. If the parameter is not positive then set the power to the default value 1.
There should be member function Add, which adds the one monomial to the other. The parameter of this member function need to be a constant reference to the other monomial object. The monomials can only be added if they have the same power, otherwise error message must be printed. The result of the addition is saved in the caller object.
There should be two member functions Multiply (overrides), which each allow to multiply a monomial to a number and to another monomial. The first member function need to accept floating point parameter that is used to perform multiplication of the real number on the the monomial object. The second member function need to accept a constant reference to the other monomial object. Use monomials to coefficients and powers to perform their multiplication. The result of the multiplication is saved in the caller object.
There should be a member function called Exponent that perform exponentiation (raise to power) of the monomial to the specified power value. You only can raise monomial to the positive power, if the power parameter is not positive print error message. The result of the exponentiation is saved in the caller object.
A sample driver program (called monomial-driver.cpp) is provided. It uses objects of type Monomial and illustrates sample usage of the member functions.
Your class declaration and definition files must work with my main program from the test driver, as-is (do not change my program to make your code work!). You are encouraged to write your own driver routines to further test the functionality of your class, as well. Most questions about the required behavior of the class can be determined by carefully examining my driver program and the sample execution. Keep in mind, this is just a sample. Your class must meet the requirements listed above in the specification - not just satisfy this driver program. (For instance, I haven’t tested every illegal fill character in this driver program - I’ve just shown a sample). Your class will be tested with a larger set of calls than this driver program represents.
General Requirements
Test Driver:
//
// driver.cpp -- driver program to demonstrate the behavior of
// the Monomial class
#include <iostream>
#include "monomial.h"
using namespace std;
int main()
{
// create some monomial: x, 2x, 12.5x³, -3xâ¶
Monomial m1, m2( 2.0 ), m3( 12.5, -1 ), m4( -3.0 , 6);
// display monomial
cout << "Monomial `m1` has the coefficient " << m1.GetCoefficient()
<< " and power " << m1.GetPower() << ": ";
m1.Print();
cout << "Monomial `m2` has the coefficient " << m2.GetCoefficient()
<< " and power " << m2.GetPower() << ": ";
m2.Print();
cout << "Monomial `m3` has the coefficient " << m3.GetCoefficient()
<< " and power " << m3.GetPower() << ": ";
m3.Print();
cout << "Monomial `m4` has the coefficient " << m4.GetCoefficient()
<< " and power " << m4.GetPower() << ": ";
m4.Print();
// Change monomial power
cout << "Monomial `m3` power wasn't changed: ";
m3.SetPower(-1);
m3.Print();
cout << "Monomial `m3` power was changed: ";
m3.SetPower(3);
m3.Print();
// can add monomials with the same powers
cout << "Monomial addition" << endl;
m1.Add(m2);
cout << "x + 2x = ";
m1.Print();
// cannot add monomials with different powers
cout << "x³ + 12.5x³ = ";
m2.Add(m3);
// can multiply monomial to a number
cout << "Monomial multiplication by a number" << endl;
m2.Multiply(2.5);
cout << "2x * 2.5 = ";
m2.Print();
// can multiply monomials
cout << "Monomial multiplication by a monomial" << endl;
m3.Multiply(m4);
cout << "12.5x³ * -3xⶠ= ";
m3.Print();
// can raise monomial to the power
cout << "Monomial exponentiation" << endl;
m4.Exponent(3);
cout << "(-3xâ¶)³ = "; // -27x^18
m4.Print();
cout << "(3x)â° = "; // -27x^18
m1.Exponent(-10);
return 0;
}
Test Driver Output
Monomial `m1` has the coefficient 1 and power 1: 1x^1 Monomial `m2` has the coefficient 2 and power 1: 2x^1 Monomial `m3` has the coefficient 12.5 and power 1: 12.5x^1 Monomial `m4` has the coefficient -3 and power 6: -3x^6 Monomial `m3` power wasn't changed: 12.5x^1 Monomial `m3` power was changed: 12.5x^3 Monomial addition x + 2x = 3x^1 x³ + 12.5x³ = Cannot add monomials with different powers Monomial multiplication by a number 2x * 2.5 = 5x^1 Monomial multiplication by a monomial 12.5x³ * -3x⁶ = -37.5x^9 Monomial exponentiation (-3x⁶)³ = -27x^18 (3x)⁰ = Can raise only to a positive power
In: Computer Science