Questions
Explain Business Intelligence in one page or less. Focus upon the concept that ‘BI’ is an...

Explain Business Intelligence in one page or less. Focus upon the concept that ‘BI’ is an umbrella term and explain what the components of a ‘BI’ system are and what its architecture and purpose are.

In: Computer Science

Given the following list of values, perform a binary search for the indicated search item. Use...

Given the following list of values, perform a binary search for the indicated search item. Use the binary search algorithm on pg. 1026 of our textbook. Show the values of first, last and middle, and the number of comparisons made after each iteration of the loop. Your should create a table like the following to show your work, where first and last are the values of the variables at the beginning of the loop, and mid is the midpoint used during that iteration, list[mid] is the value in the list at the midpoint, and No. of key comparisons should be the number of comparisons made during this iteration by the algorithm:

Iteration  first   last    mid  list[mid]   No. of key comparisons
1          0       12      ?    ?           ?

List:
[ 2, 3, 4, 4, 5, 7, 10, 14, 15, 17, 22, 23, 24 ]

Searching for value: 3

In: Computer Science

Language: Python Create a graph and then set initial and goal states such that the number...

Language: Python

Create a graph and then set initial and goal states such that the number of nodes visited for BFS is smaller than that in DFS. Now modify the initial and goal state such that the number of nodes visited for BFS is larger than that in DFS.

In: Computer Science

Write a program, which will act as a simple four-function calculator. That is, it will read...

Write a program, which will act as a simple four-function calculator. That is, it will read a number, read an operator, read another number, then do the operation. The calculator works with integers and uses four functions: +, -, *, and /. After the first operation is completed, the program will read another operator and uses the result of the previous operation as the first value for the next operation. If the user enters either an upper- or lower-case C the result is cleared and then the user starts entering a new number. If the user enters an X, the calculator is turned off. The various input values (i.e. numbers, operators, commands) will be followed by the ENTER key. Your program should prompt the user on what the user is to do. The commands C and X may be entered in place of an operator.

NOTES:

The person using the calculator has a terrible time using a keyboard and may not always enter a valid operator. If this happens the program should ask for another operator. Regardless of the math operation attempted, the program must not die. If the math operation would cause a fatal error in your program you should check for it and issue an error message rather than attempting the operation.

Please write the code for C programming, not C++ or Java

In: Computer Science

USE PYTHON ONLY Please write a Python program to let you or the user play the...

USE PYTHON ONLY

Please write a Python program to let you or the user play the game of rolling a dice and winning/losing money. Initially, you have 100 dollars in your account. You place a bet to roll the dice. The game will be stopped if your bet is zero. First, dealer would roll the dice and get a number from random.randint(1, 6). Then, you would roll the dice and get a number from random.randint(1, 6). Now, compare your number with dealer’s number to see whether you won or lose the bet. If you lose, the bet would be deducted from your account. If you won, the bet would be added to your account. If it’s a tie, your account is not touched. Then, continue the game of putting your bet until your bet is zero. The game is to continue even when you have zero or negative amount of money. You must test your game program 3 times with at least 10 rounds for each game. The output of your test case #1 may like as follows: Welcome to the Rolling Dice Game of TM

1 =============================================. Now, you have 100 dollars to play the game.

2 =============================================. Enter your bet to roll the dice (enter 0 to quit): 10 Dealer got 1 , and you got 5 . You won 10 dollars. Now, you have 110 dollars.

3 =============================================. Enter your bet to roll the dice (enter 0 to quit): 5 Dealer got 5 , and you got 3 . You lost 5 dollars. Now, you have 105 dollars.

4 =============================================. Enter your bet to roll the dice (enter 0 to quit): 30 Dealer got 3 , and you got 3 . It's a tie. Now, you have 105 dollars.

5 =============================================. Enter your bet to roll the dice (enter 0 to quit): 200 Dealer got 3 , and you got 4 . You won 200 dollars. Now, you have 305 dollars.

6 =============================================. Enter your bet to roll the dice (enter 0 to quit): 100 Dealer got 4 , and you got 1 . You lost 100 dollars. Now, you have 205 dollars.

7 =============================================. Enter your bet to roll the dice (enter 0 to quit): 205 Dealer got 2 , and you got 6 . You won 205 dollars. Now, you have 410 dollars.

8 =============================================. Enter your bet to roll the dice (enter 0 to quit): 400 Dealer got 3 , and you got 6 . You won 400 dollars. Now, you have 810 dollars.

9 =============================================. Enter your bet to roll the dice (enter 0 to quit): 500 Dealer got 4 , and you got 1 . You lost 500 dollars. Now, you have 310 dollars.

10 =============================================. Enter your bet to roll the dice (enter 0 to quit): 310 Dealer got 6 , and you got 2 . You lost 310 dollars. Now, you have 0 dollars.

11 =============================================. Enter your bet to roll the dice (enter 0 to quit): 10 Dealer got 3 , and you got 6 . You won 10 dollars. Now, you have 10 dollars.

12 =============================================. Enter your bet to roll the dice (enter 0 to quit): 40 Dealer got 3 , and you got 1 . You lost 40 dollars. Now, you have -30 dollars.

13 =============================================. Enter your bet to roll the dice (enter 0 to quit): 0

14 =============================================. Thank you for playing the Rolling Dice Game of TM

15 =============================================.

In: Computer Science

Network Analysis and Theory a) In your opinion what are the biggest threats to a network...

Network Analysis and Theory

a) In your opinion what are the biggest threats to a network in terms of security and why?

b) Describe what you would do to protect a network from attack, mention any appliances or products you can recommend.

In: Computer Science

Risk analysis is one way to monitor security in an organization. Risk analysis can be a...

Risk analysis is one way to monitor security in an organization. Risk analysis can be a time- consuming process; it involves a number
of steps, some of which require “educated guessing.” Nevertheless, the process alone raises awareness of security issues even if no immediate actions are taken as a result. The steps are:

i. Identify assets (infrastructure, people, hardware, software, reputation, etc.).

For the rest of this list, we’ll concentrate on a single asset.

ii. Determine vulnerability (what event or events might happen to the asset. For example, the building could catch fire, the website could be hacked, etc.).

For the rest of this list, we’ll concentrate on a single asset vulnerable to a single event.

ii. Estimate the probability per year of this event (based on past data, expert estimates, etc.). Take current security measures into account.

iv. Estimate the expected cost if this event occurs (cost to repair or replace, cost of lost business, etc.).

v. Compute risk exposure 5 cost estimate 3 probability estimate.

vi. Identify any additional security measure X that would help protect against this event, determine what it would cost, and do a calculation of the risk exposure with the additional security measure X in place.

vii. Do a cost-benefit analysis:
(Risk exposure without X – Risk exposure with X) − Cost of X

You have a small web-based business that uses a single server to manage your webpage and your customer information. Over the past four years, your website has been hacked and taken down twice. You estimate that the cost of this event is $600 to clean the server and reload the webpage and $12,000 in lost business while the server is down.

  1. You could purchase a backup server for a cost of $3,000, which you estimate would reduce the probability per year of losing your website to 0.2. Would this be a cost- effective security measure?

  2. What if you reevaluate the probability per year with the backup server to be 0.3. Does this change your answer?

In: Computer Science

The Drunkard’s (Random) Walk. Imagine you live on an infinite grid of streets where locations are...

The Drunkard’s (Random) Walk. Imagine you live on an infinite grid of streets where locations are represented as integer pairs (avenue,street). Negative numbers are okay in this example. Now consider a drunkard that randomly picks one of four directions at an intersection and then stumbles to the next intersection doing the same and so on. Write a class Drunkard to simulate this behavior given the drunkard’s initial position. Your Drunkard class should have as instance variables the drunkard’s current avenue (x location) and current street (y location). Your class should have a method called step( ) that moves the drunkard to the next randomly chosen adjacent intersection. Your class should have another method called fastForward(int steps) that takes an integer as a parameter (call it steps) and moves the drunkard steps intersections from his current location. Your class should have a method getLocation( ) that returns a String indicating the drunkard’s current location. Finally your class should have a method called howFar( ) that reports the drunkards distance in blocks from where he started calculated using the Manhattan distance metric.

You will find a test class called DrunkardTester below. Your Drunkard class must work with the test class provided without modification. You must NOT alter the test class.

DrunkardTester.java :

/**
* A tester for the Drunkard class.
*/

import java.util.Scanner;

public class DrunkardTester {
public static void main(String[] args) {

   Scanner input = new Scanner(System.in);

   System.out.println("Please enter the starting avenue integer: ");
   int avenue = input.nextInt();
   System.out.println("Please enter the starting street integer: ");
   int street = input.nextInt();
  
   // make the Drunkard with initial position
   Drunkard ozzy = new Drunkard(avenue,street);

   // have him move 100 intersections
   ozzy.fastForward(100);
  
   // get his current location
   String location = ozzy.getLocation();
  
   // get distance from start
   int distance = ozzy.howFar();

   System.out.println("Current location: " + location);
   System.out.println("That's " + distance + " blocks from start.");

}
}

Additionally, there is a completely empty Drunkard.java file that you must fill out.

(Your code goes here...)

Note that the definition of Manhattan distance is:

“The distance between two points in a grid based on a strictly horizontal and/or vertical path (that is, along the grid lines), as opposed to the diagonal or “as the crow flies” distance. The Manhattan distance is the simple sum of the horizontal and vertical components, whereas the diagonal distance might be computed by applying the Pythagorean theorem.”

In: Computer Science

describe Public Wi-Fi Hotspot Security

describe Public Wi-Fi Hotspot Security

In: Computer Science

Write a Python program that uses while loops to perform the following steps and post the...

Write a Python program that uses while loops to perform the following steps and post the text code. Thanks


a. Prompt the user to input two positive integers (no zero or negative). variables: firstNum and secondNum (firstNum must be less than secondNum). Validate the user's input; prompt the user again if firstNum is not less than secondNum (use while loop).


b. Output all odd numbers between firstNum and secondNum. (use while loop).


c. Output the sum of all even numbers between firstNum and secondNum. (use while loop).


d. Output the sum of the square of the odd numbers between firstNum and secondNum. (use while loop)

Program layout for each step:

#A

while loop

#B

while loop

#C

while loop

#D

while loop

***Allow the user to repeat the program. (requires another while loop).

***Do NOT define any functions.

***Your program output must be exactly the same as the output in the OUTPUT section, except font style.

OUTPUT:

- The bold text is the user's input.

*************************************************************************************

Enter two positive integer numbers.

First number must be less than the second number:
Enter numbers: 8 a

Incorrect Input.
Please try again.

Enter two positive integer numbers.
First number must be less than the second number:
Enter numbers: 

*************************************************************************************

Enter two positive integer numbers.
First number must be less than the second number:
Enter numbers: a 8

Incorrect Input.
Please try again.


Enter two positive integer numbers.
First number must be less than the second number:
Enter numbers: 

*************************************************************************************

Enter two positive integer numbers.
First number must be less than the second number:
Enter numbers: 8 2

First number must be less than the second number!
Please try again.


Enter two positive integer numbers.
First number must be less than the second number:
Enter numbers: 

*************************************************************************************

Enter two positive integer numbers.
First number must be less than the second number:
Enter numbers: -2 8

No negative numbers!
Please try again.


Enter two positive integer numbers.
First number must be less than the second number:
Enter numbers: 

*************************************************************************************

Enter two positive integer numbers.
First number must be less than the second number you enter
Enter numbers: 2 8

Odd integers between 2 and 8 are:
3 5 7

Sum of even integers between 2 and 8 = 20

Sum of the squares of odd integers between 2 and 8 = 83


Do you want to repeat this program?
y/n
> y

*************************************************************************************

Enter two positive integer numbers.
First number must be less than the second number you enter
Enter numbers: 1 9

Odd integers between 1 and 9 are:
1 3 5 7 9

Sum of even integers between 1 and 9 = 20

Sum of the squares of odd integers between 1 and 9 = 165


Do you want to repeat this program?
y/n
> y

*************************************************************************************

Enter two positive integer numbers.
First number must be less than the second number you enter
Enter numbers: 11 15

Odd integers between 11 and 15 are:
11 13 15

Sum of even integers between 11 and 15 = 26

Sum of the squares of odd integers between 11 and 15 = 515


Do you want to repeat this program?
y/n
> n

Bye!

In: Computer Science

Can someone please fix my program? I keep getting a syntax error. Thanks (Python) from tkinter...

Can someone please fix my program? I keep getting a syntax error. Thanks (Python)

from tkinter import *

class LoanCalculator:
def __init__(self):
window = Tk()
window.title("Loan Calculator")

Label(window,text = "Annual Interest Rate").grid(row = 1, column = 1, sticky = W)
Label(window,text = "Number of Years").grid(row = 2, column = 1, sticky = W)
Label(window,text = "Loan Amount").grid(row = 3, column = 1, sticky = W)
Label(window,text = "Monthly Payment").grid(row = 4, column = 1, sticky = W)
Label(window,text = "Total Payment").grid(row = 5, column = 1, sticky = W)

self.annualInterestRateVar = StingVar()
Entry(window,textvariable = self.annualInterestRateVar,Justify=Right).grid(row = 1, column = 2)
self.numberofYearsvar = StringVar()
Entry(window,textvariable = self.numberofYearsVar,Justify=Right).grid(row = 2, column = 2)
self.loanAmountVar = StringVar()
Entry(window,textvariable = self.self.loanAmountVar,Justify=Right).grid(row = 3, column = 2)

self.monthlyPaymentVar = StringVar()
lblMonthlyPayment = Label(window,textvariable = self.monthlyPaymentVar)\
.grid(row = 5, column = 2, Sticky = E)
self.totalPaymentVar = StringVar()
lblTotalPayment = Label(window,textvariable = self.totalPaymentVar)\
.grid(row = 5, column = 2, Sticky = E)

btComputePayment = Button(window, text = "Compute Payment", \
command = self.computePayment).grid(row = 6, column = 2, sticky = E)

window.mainloop()

def computePayment(self):
try:
monthlyPayment = self.getMonthlyPayment(float(self.loanAmountVar.get()),\
float(self.annualInterestRateVar.get())/1200,\
int(self.numberOfYearsVar.get())
self.monthlyPaymentVar.set('%.2f' % monthlyPayment)
totalPayment = float(self.monthlyPaymentVar.get())*12 *int(self.numberOfYearsVar.get())
self.totalPaymentVar.set('%.2f' % totalPayment)

except:
self.totalPaymentVar.set("Error in input")

def getMonthlyPayment(self,loan,Amount,monthlyInterestRate,numberOfYears):
monthlyPayment = loanAmount * monthlyInterestRate/(1-1/ \
(1 + monthlyInterestRate)**(numberOfYears*12))
return monthlyPayment
  

def main():


LoanCalulator()

In: Computer Science

Consider a CSMA-like protocol with n nodes. Assume that the length of a time step equals...

Consider a CSMA-like protocol with n nodes. Assume that the length of a time step equals twice the maximum propagation delay between any two nodes. Recall that if the medium is sensed busy, the node continuously monitors the medium until it becomes idle. When the medium becomes idle, the node sends the frame with probability p and defers it for a later slot with probability 1 − p. Assume that each node has an infinite number of frames to send, and that all frames are of the same size. Also, assume that each frame takes exactly one time step to be completely transmitted. Assume that when the medium experiences a collision during a current time step, it must stay idle during the next time step before it can proceed with transmission attempts again. But when the medium experiences a successful transmission during a current time step, nodes can immediately proceed with transmission attempts without needing to go idle for one time step. Also, assume that when a collision occurs during a time step, each node is able to detect it by the end of the time step during which the collision has occurred. Since the current state of the system depends only on its immediate past state, we can use Markov chains to model and analyze the performance of this system. For this, consider that the system has 3 states: idle i, colliding c, and transmitting t. All answers must be expressed in terms of p and n.

1. Draw the Markov state transition diagram and show the state transition probabilities?

2.Write the balance equation for each state, and derive the stationary probabilities for all states?

3.Derive the system throughput, defined as the average number of successfully delivered frames per time step?

4.Derive the system utilization, defined as the fraction of time the medium is being used for successful transmissions?

5.Drive the average waiting time, defined as the average time from when a frame is ready to be transmitted until the time the frame is transmitted successfully?

In: Computer Science

## Problem Description You are writing a small section of an ATM machine where you accept...

## Problem Description

You are writing a small section of an ATM machine where you accept a string that is a password and accept it or reject it. If the user tries more than three times with a bad password the card is blocked and no password will be accepted until the **resetFailedAttemptCounter** method is called. The password is provided at creation of the AtmPin. Security is a priority!

The class to implement this is referred to as **AtmPin** and consists of the following public methods:

**public AtmPin(String actualCode)** - Creates an AtmPin object with the provided code as the actual PIN

**public boolean verifyPinCode(String code)** - Accepts a string which represents the user's entry of their pin code. If the string matches the actual code provided in the constructor and the account is not blocked then the method returns true. Returns false when the code is bad OR when **isAccountLocked**() is true due to too many consecutive bad verification attempts. If an invalid code was passed or a valid code, but the account is blocked, the system will increment the number of bad password attempts.

**public boolean lastAttemptFailed()** - Returns true if the last invocation of **verifyPinCode** was unsuccessful. Underlying state is updated every time a password is passed to **verifyPinCode**. This method DOES NOT do the verification of the code, but simply is a record of whether the last attempt was successful. Note that you can submit a good password but have it rejected by the system since the account is locked (**verifyPinCode** returns false).

**public boolean isAccountLocked()** - If *more than* three consecutive attempts are made then the password is not accepted (**verifyPinCode** returns false) until **resetFailedAttemptCounter** is called.

**public void resetFailedAttemptCounter()** - Resets the number of failed attempts to zero.

Your **Program.java** should contain code to test your **AtmPin** object.

**Requirements:**

- You may not hard-code the pin in the AtmPin class, but must provide it as a constructor argument

- DO NOT STORE the user's code when attempting to verify

- **verifyPinCode** returns false when

  - code is bad

  - OR

  - when **isAccountLocked**() is true due to too many consecutive bad verification attempts

- **lastAttempt** failed should not do any comparison of actual pin to the tested pin (i.e. you cannot store the user's pin)

## Getting Started

Create the following files in the folder and add the appropriately named classes to them

1. Program.java

2. AtmPin.java

In: Computer Science

SpeechAnalyst The purpose of this assignment is to practice using strings and C-strings. Your task is...

SpeechAnalyst

The purpose of this assignment is to practice using strings and C-strings. Your task is to create a class that counts words (by looking for spaces) and sentences (by looking for periods). The data will either come in dribs-and-drabs. Use the infamous operator "<<" to output the data seen so far. Because std::string is a class, I'd recommend you use it to store the text information that has been entered through calls to addData and addStringData.

Implementation Details

Sample Driver

SpeechAnalyst

SpeechAnalyst( );

void clear( ); // resets everything...
void addData( char * stuff );
void addStringData( std::string stuff );

int getNumberOfWords( ) const;
int getNumberOfSentences( ) const;

friend ostream& operator << ( ostream& outs, const SpeechAnalyst & sa ); // prints the data seen so far!

std::string myData;

SpeechAnalyst sa;
cout << sa << endl;
std::string speech( "Fourscore and seven years ago our fathers brought forth on this continent a new nation, conceived in liberty and dedicated to the proposition that all men are created equal." );
sa.addStringData( speech );
cout << sa << endl;

sa.clear();
char * data = new char[ 50 ];
strcpy( data, "Muffin says Hello." );
sa.addData( data );
cout << sa << endl;
sa.addData( data );
cout << sa << endl;

Sample Output

No data to print out....
Data has 29 words and 1 sentence.
Data has 3 words and 1 sentence.
Data has 6 words and 2 sentences.

HINT: You may add additional methods to the SpeechAnalyst class as long as you implement those defined in the original class definition.

In: Computer Science

Write a java program that takes 5 students final test scores from console when prompting. Store...

Write a java program that takes 5 students final test scores from console when prompting. Store these scores in an array. Iterate thru the array of student scores to find –

  • Highest score entered

  • Lowest score entered

  • Average of all the 5 scores

  • Total of all the scores

Print these values to the console (screen).

In: Computer Science