Questions
Discuss the best type of network and protocol to use in organizations to ensure protection of...

Discuss the best type of network and protocol to use in organizations to ensure protection of customer information. Justify your selection with specific reasons, facts, and examples.

In: Computer Science

Array-based implementations of stacks and queues require the knowing the location of data within the arrays....

Array-based implementations of stacks and queues require the knowing the location of data within the arrays. However, these two data structures store data differently. What is this difference and why does it exist? Could the stack-approach be used to store information within queues (or the other way around)? Why or why not? If it is possible, what would be the side effects of such an approach?

In: Computer Science

Describe the major differences between traditional waterfall and agile software developments. In your opinion, what are...

Describe the major differences between traditional waterfall and agile software developments. In your opinion, what are the most notable advantages and disadvantages of each methodology?

In: Computer Science

State if the given statements are true or false by reporting your answers (T for ``true’’...

State if the given statements are true or false by reporting your answers (T for ``true’’ and F for ``false’’) in the last column of the following table.

(i)

1000 bits equal one byte.

(ii)

Batch processing allows the creators of computing jobs to interact with the jobs during their completion.

(iii)

Multiprogramming assigns the same time interval to all computing jobs.

(iv)

1000 bytes equal one kilobyte.

(v)

Multiprogramming is used only in multi-user settings.

(vi)

1 terabyte equals more bits than 1 gigabyte.

(vii)

Batch processing is a kind of multitasking.

(viii)

Scaling in the context of operating systems is same as speeding up or slowing down the processes aimed at completion of computing jobs based on the deadlines given by the creators of the jobs.

(ix)

Load balancing in the context of operating systems means splitting the computer programs written in  high-level programming languages into smaller programs, to make sure that all processors are assigned equal number of lines of code written in the high-level programming languages.

(x)

1 megabyte equals 8 terabytes.

(xi)

There are multiple criteria for classifying computer networks.

(xii)

The only way to create a larger computer network from bus networks is to connected them with a bridge.

(xiii)

File manager is a part of user interface.

(xiv)

Booting is the process of transferring the operating system from the main memory to the mass storage.

(xv)

1 exabyte equals 250 kilobytes.

(xvi)

Device drivers are a part of user interface.

(xvii)

Star networks are same as networks of computers used to process data about stars in the sky.

(xviii)

1 petabyte equals 253 bits.

(xix)

Auditing software in the context of operating systems is a software that creates a software during an attack on a computer/computers, to defend the computer/computers.

(xx)

A dispatcher in the context of operating systems chooses the activities to consider for execution.

In: Computer Science

Does agile development work for every project? In your opinion, why might agile development not be...

Does agile development work for every project? In your opinion, why might agile development not be suitable for companies all the time? What are some notable reasons why agile would not be the most effective or efficient methodology?

In: Computer Science

Hello i need someone to implement for me RADIX SORT IN JAVA for Characters NOT numbers...

Hello i need someone to implement for me RADIX SORT IN JAVA for Characters NOT numbers

and i need the code super fast please

In: Computer Science

1) What are import libraries ? 2) What commands are found in the #include library that...

1) What are import libraries ? 2) What commands are found in the #include library that we will use ? 3) What is syntax ? 4) What does the computer do when it encounters a statement that Declares a variable ? 5) What are the byte sizes for int, double and char data types ? 6) Why is an int variable only able to store a range of values from approx -2.1 billion to +2.1 billion ? 7) What is PEMDAS ? How is it also important when doing math in a computer program ? 8) Is the ‘=’ sign the same for math and programming ? Explain your answer. 9) What happens when you Assign a value to a variable ? How does it work ? 10) What is variable Initialization, is it necessary in JAVA ?

In: Computer Science

DO IN JAVA If you have downloaded this book’s source code (the companion Web site is...

DO IN JAVA

If you have downloaded this book’s source code (the companion Web site is available at www.pearsonhighered.com/gaddis), you will find the following files in the Chapter 07 folder:

  • GirlNames.txt – This file contains a list of the 200 most popular names given to girls born in the United States for the years 2000 through 2009.

  • BoyNames.txt – This file contains a list of the 200 most popular names given to boys born in the United States for the years 2000 through 2009.

Write a program that reads the contents of the two files into two separate arrays, or ArrayLists. The user should be able to enter a boy’s name, a girl’s name, or both, and the application will display messages indicating whether the names were among the most popular.

BoyNames:

Jacob
Michael
Joshua
Matthew
Daniel
Christopher
Andrew
Ethan
Joseph
William
Anthony
David
Alexander
Nicholas
Ryan
Tyler
James
John
Jonathan
Noah
Brandon
Christian
Dylan
Samuel
Benjamin
Zachary
Nathan
Logan
Justin
Gabriel
Jose
Austin
Kevin
Elijah
Caleb
Robert
Thomas
Jordan
Cameron
Jack
Hunter
Jackson
Angel
Isaiah
Evan
Isaac
Mason
Luke
Jason
Gavin
Jayden
Aaron
Connor
Aiden
Aidan
Kyle
Juan
Charles
Luis
Adam
Lucas
Brian
Eric
Adrian
Nathaniel
Sean
Alex
Carlos
Bryan
Ian
Owen
Jesus
Landon
Julian
Chase
Cole
Diego
Jeremiah
Steven
Sebastian
Xavier
Timothy
Carter
Wyatt
Brayden
Blake
Hayden
Devin
Cody
Richard
Seth
Dominic
Jaden
Antonio
Miguel
Liam
Patrick
Carson
Jesse
Tristan
Alejandro
Henry
Victor
Trevor
Bryce
Jake
Riley
Colin
Jared
Jeremy
Mark
Caden
Garrett
Parker
Marcus
Vincent
Kaleb
Kaden
Brady
Colton
Kenneth
Joel
Oscar
Josiah
Jorge
Cooper
Ashton
Tanner
Eduardo
Paul
Edward
Ivan
Preston
Maxwell
Alan
Levi
Stephen
Grant
Nicolas
Omar
Dakota
Alexis
George
Collin
Eli
Spencer
Gage
Max
Cristian
Ricardo
Derek
Micah
Brody
Francisco
Nolan
Ayden
Dalton
Shane
Peter
Damian
Jeffrey
Brendan
Travis
Fernando
Peyton
Conner
Andres
Javier
Giovanni
Shawn
Braden
Jonah
Cesar
Bradley
Emmanuel
Manuel
Edgar
Erik
Mario
Edwin
Johnathan
Devon
Erick
Wesley
Oliver
Trenton
Hector
Malachi
Jalen
Raymond
Gregory
Abraham
Elias
Leonardo
Sergio
Donovan
Colby
Marco
Bryson
Martin

GirlsNames:

Emily
Madison
Emma
Olivia
Hannah
Abigail
Isabella
Samantha
Elizabeth
Ashley
Alexis
Sarah
Sophia
Alyssa
Grace
Ava
Taylor
Brianna
Lauren
Chloe
Natalie
Kayla
Jessica
Anna
Victoria
Mia
Hailey
Sydney
Jasmine
Julia
Morgan
Destiny
Rachel
Ella
Kaitlyn
Megan
Katherine
Savannah
Jennifer
Alexandra
Allison
Haley
Maria
Kaylee
Lily
Makayla
Brooke
Mackenzie
Nicole
Addison
Stephanie
Lillian
Andrea
Zoe
Faith
Kimberly
Madeline
Alexa
Katelyn
Gabriella
Gabrielle
Trinity
Amanda
Kylie
Mary
Paige
Riley
Jenna
Leah
Sara
Rebecca
Michelle
Sofia
Vanessa
Jordan
Angelina
Caroline
Avery
Audrey
Evelyn
Maya
Claire
Autumn
Jocelyn
Ariana
Nevaeh
Arianna
Jada
Bailey
Brooklyn
Aaliyah
Amber
Isabel
Danielle
Mariah
Melanie
Sierra
Erin
Molly
Amelia
Isabelle
Madelyn
Melissa
Jacqueline
Marissa
Shelby
Angela
Leslie
Katie
Jade
Catherine
Diana
Aubrey
Mya
Amy
Briana
Sophie
Gabriela
Breanna
Gianna
Kennedy
Gracie
Peyton
Adriana
Christina
Courtney
Daniela
Kathryn
Lydia
Valeria
Layla
Alexandria
Natalia
Angel
Laura
Charlotte
Margaret
Cheyenne
Mikayla
Miranda
Naomi
Kelsey
Payton
Ana
Alicia
Jillian
Daisy
Mckenzie
Ashlyn
Caitlin
Sabrina
Summer
Ruby
Rylee
Valerie
Skylar
Lindsey
Kelly
Genesis
Zoey
Eva
Sadie
Alexia
Cassidy
Kylee
Kendall
Jordyn
Kate
Jayla
Karen
Tiffany
Cassandra
Juliana
Reagan
Caitlyn
Giselle
Serenity
Alondra
Lucy
Kiara
Bianca
Crystal
Erica
Angelica
Hope
Chelsea
Alana
Liliana
Brittany
Camila
Makenzie
Veronica
Lilly
Abby
Jazmin
Adrianna
Karina
Delaney
Ellie
Jasmin

In: Computer Science

Why is building security into the SDLC important?"

Why is building security into the SDLC important?"

In: Computer Science

Implement a version of merge() that copies the second half of a[] to aux[] in decreasing...

Implement a version of merge() that copies the second half of a[] to aux[] in decreasing order and then does the merge back to a[]. This change allows you to remove the code to test that each of the halves has been exhausted from the inner loop. Note: the resulting sort is not stable.

Algorithms Fourth Edition Exercise 2.2.10

In: Computer Science

Python Assignement Programm Assignement 1 # Description: This program is a function which calculates pi per...

Python Assignement

Programm Assignement 1

# Description: This program is a function which calculates pi per Leibniz

formula,based on the number of values passed to it.

def calculate_pi(n):

    total, sign = 0, 1

    for i in range(n):

        term = 1 / (2 * i + 1)

       total += term * sign

        sign *= -1

    total *= 4

    return total

n = int(input("How many terms: "))

print(calculate_pi(n))

PRogramm Assignement2

# This program is to modify the program for Homewor

k Assignment 1

so that it includes exception

# handling, is

, and allows the user to execute the program

multiple times

# without exiting it.

def calculate_pi(n):

   try:

       total, sign = 0, 1

       for i in range(n):

           term = 1 / (2 * i + 1)

           total += term * sign

           sign *= -1

       total *= 4

       return total

   except Exception as e:

       print("Exception occurred..")

       return 0

choice = "yes"

while(choice=="yes"):

   n = int(input("How many terms: "))

   print(calculate_pi(n))

   choice = input("Want to run it again (yes/no)? "

)

PB

Divide the program for Assignment 2 into two modules: 1. A class module which contains a class based on the Leibniz formula, including a constructor for use with the class, and 2. A program module which creates an instance of the class defined in the class module and uses the class attribute to perform the functionality required in Assignement 2. Be sure to correct any issues found with Assignement 2.

In: Computer Science

Complete the following assignment in C programming language. 1. Declare the following float variables: -Maximum exam...

Complete the following assignment in C programming language.

1. Declare the following float variables:

-Maximum exam score, user's exam score, and percentage.

2. Ask the user to input data into your variables, such as:

-"What is the max score of your exam:"

-"What was your score:"

3. Use if statements to validate user inputs. For example, score received should not be more than maximum possible score.

-Display an error message when the user enters invalid data.

-You can restart the program if use enters invalid input by pressing the RESET button on the processor board.

4. Build your Software logic to calculate the percentage and the letter grade.

-Hint: Store your letter grade to a char variable.

-Hint: Use if and else if statements. Scan from A to D leaving F to else statement.

5. Print out summary for the user:

-If the user's grade is either B, C, or D, print-out how many percent points the user is away from the next letter grade.

-Hint: (Score % 10) will tell you the remainder. If grade is B, C or D, calculate the remainder and subtract from 10.

-Example print-out:

-"You scored a B, and you were 3 percent away from the next letter grade."

In: Computer Science

C++ Class involving union. The goal is to overload the function: void Bag<T>::operator+=(const Bag<T>& a_bag) //...

C++ Class involving union.

The goal is to overload the function:

void Bag<T>::operator+=(const Bag<T>& a_bag)

// The union of two sets A and B is the set of elements which are in A, in B, or in both A and B. For instance, Bag<int> bag1 = 1,2,3 and Bag<int> bag2 = 3,4,5 then bag1+=bag2 should return 1,2,3,4,5.

//Since type is void, it should not return an array.

#include <iostream>
#include <string>

#include <vector>
using namespace std;

template<class T>
class Bag
{
public:
    Bag();
    int getCurrentSize() const;
    bool isEmpty() const;
    bool add(const T& new_entry);
    bool remove(const T& an_entry);
    /**
     @post item_count_ == 0
     **/
    void clear();
    /**
     @return true if an_etry is found in items_, false otherwise
     **/
    bool contains(const T& an_entry) const;

    /**
     @return the number of times an_entry is found in items_
     **/
    int getFrequencyOf(const T& an_entry) const;

    /**
     @return a vector having the same cotntents as items_
     **/
    std::vector<T> toVector() const;

    void display() const;  // displays the output 

    void operator+=(const Bag<T>& a_bag); //DO NOT CHANGE RETURN TYPE

protected:
    static const int DEFAULT_CAPACITY = 200;  //max size of items_
    T items_[DEFAULT_CAPACITY];              // Array of bag items
    int item_count_;                         // Current count of bag items
    int getIndexOf(const T& target) const;


};
template<class T>
Bag<T>::Bag(): item_count_(0)
{
}  // end default constructor

template<class T>
int Bag<T>::getCurrentSize() const
{
    return item_count_;
}  // end getCurrentSize

template<class T>
bool Bag<T>::isEmpty() const
{
    return item_count_ == 0;
}  // end isEmpty


template<class T>
bool Bag<T>::add(const T& new_entry)
{
    bool has_room = (item_count_ < DEFAULT_CAPACITY);
    //bool notDup = items_.getFrequencyOf(new_entry) == 0; 
    if (has_room) //&& notDup) 
    {
        items_[item_count_] = new_entry;
        item_count_++;
        return true;
    }  // end if

    return false;
}  // end add

template<class T>
void Bag<T>::display() const {
    for(int x = 0; x < item_count_;x++)
        cout << items_[x] << ", "; 
}


/**
 @return true if an_etry was successfully removed from items_, false otherwise
 **/
template<class T>
bool Bag<T>::remove(const T& an_entry)
{
   int found_index = getIndexOf(an_entry);
    bool can_remove = !isEmpty() && (found_index > -1);
    if (can_remove)
    {
        item_count_--;
        items_[found_index] = items_[item_count_];
    }  // end if

    return can_remove;
}  // end remove


/**
 @post item_count_ == 0
 **/
template<class T>
void Bag<T>::clear()
{
    item_count_ = 0;
}  // end clear

template<class T>
int Bag<T>::getFrequencyOf(const T& an_entry) const
{
   int frequency = 0;
   int cun_index = 0;       // Current array index
   while (cun_index < item_count_)
   {
      if (items_[cun_index] == an_entry)
      {
         frequency++;
      }  // end if

      cun_index++;          // Increment to next entry
   }  // end while

   return frequency;
}  // end getFrequencyOf

template<class T>
bool Bag<T>::contains(const T& an_entry) const
{
    return getIndexOf(an_entry) > -1;
}  // end contains

template<class T>
std::vector<T> Bag<T>::toVector() const
{
   std::vector<T> bag_contents;
    for (int i = 0; i < item_count_; i++)
        bag_contents.push_back(items_[i]);

   return bag_contents;
}  // end toVector
template<class T>
void Bag<T>::operator+=(const Bag<T>& a_bag)

{}

In: Computer Science

edit the code to make sure that if the user enter any city coordinates out the...

edit the code to make sure that if the user enter any city coordinates out the ranges ( x and y should be between 1 and 25). Also write the calc_plant() method in different way.

import java.io.*;
import java.util.*;
public class State {
  
private int citi1x,citi1y;
private int pop1;
private int citi2x,citi2y;
private int pop2;
private int citi3x,citi3y;
private int pop3;
private int citi4x,citi4y;
private int pop4;
private int plantx,planty;
public int getCity1X(){
return citi1x;
}
public int getCity1Y(){
return citi1y;
}
public int getCity2X(){
return citi2x;
}
public int getCity2Y(){
return citi2y;
}
public int getCity3X(){
return citi3x;
}
public int getCity3Y(){
return citi3y;
}
public int getCity4X(){
return citi4x;
}
public int getCity4Y(){
return citi4y;
}
public void setCity1(int a, int b){
citi1x = a;
citi1y = b;
}
public void setCity2(int a, int b){
citi2x = a;
citi2y = b;
}
public void setCity3(int a, int b){
citi3x = a;
citi3y = b;
}
public void setCity4(int a, int b){
citi4x = a;
citi4y = b;
}
public void setPop1(int a){
pop1 = a;
}
public void setPop2(int a){
pop2 = a;
}
public void setPop3(int a){
pop3 = a;
}
public void setPop4(int a){
pop4 = a;
}
public int getPop1(int a){
return pop1;
}
public int getPop2(int a){
return pop2;
}
public int getPop3(int a){
return pop3;
}
public int getPop4(int a){
return pop4;
}
public int getPlantX(){
return plantx;
}
public int getPlantY(){
return planty;
}
public void setPlantX(int a){
plantx = a;
}
public void setPlantY(int a){
planty = a;
}
public void read_input(){
int x,y;
int pop;
Scanner sc = new Scanner(System.in);
do {
System.out.print("Enter X and Y for city 1: ");
x = sc.nextInt();
y = sc.nextInt();
} while ((x < 1 || x > 25) && (y < 1 && y > 25));
setCity1(x,y);
System.out.print("Enter population for city 1: ");
pop = sc.nextInt();
setPop1(pop*1000);
do {
System.out.print("Enter X and Y for city 2: ");
x = sc.nextInt();
y = sc.nextInt();
} while ((x < 1 || x > 25) && (y < 1 && y > 25));
setCity2(x,y);
System.out.print("Enter population for city 2: ");
pop = sc.nextInt();
setPop2(pop*1000);

do {
System.out.print("Enter X and Y for city 3: ");
x = sc.nextInt();
y = sc.nextInt();
} while ((x < 1 || x > 25) && (y < 1 && y > 25));
setCity3(x,y);
System.out.print("Enter population for city 3: ");
pop = sc.nextInt();
setPop3(pop*1000);
do {
System.out.print("Enter X and Y for city 4: ");
x = sc.nextInt();
y = sc.nextInt();
} while ((x < 1 || x > 25) && (y < 1 && y > 25));
setCity4(x,y);
System.out.print("Enter population for city 4: ");
pop = sc.nextInt();
setPop4(pop*1000);
  
}

public void calc_plant(){

double min = 100000;
for (int i = 1; i<=25; i++){
  
for (int j = 1; j<=25; j++){
  
double unhappy1 = 0;
double unhappy2 = 0;
double unhappy3 = 0;
double unhappy4 = 0;
  
if ((i == citi1x && j == citi1y) || (i == citi2x && j == citi2y) || (i == citi3x && j == citi3y) || (i == citi4x && j == citi4y))
continue;
double dist = Math.sqrt((i-citi1x)*(i-citi1x) + (j-citi1y)*(j-citi1y));
if (dist <= 2){
unhappy1 = 10000000;
}
else {
unhappy1 = pop1/dist;
}
dist = Math.sqrt((i-citi2x)*(i-citi2x) + (j-citi2y)*(j-citi2y));
if (dist <= 2){
unhappy2 = 1000000;
}
else {
unhappy2 = pop2/dist;
}
dist = Math.sqrt((i-citi3x)*(i-citi3x) + (j-citi3y)*(j-citi3y));
if (dist <= 2){
unhappy3 = 1000000;
}
else {
unhappy3 = pop3/dist;
}
dist = Math.sqrt((i-citi4x)*(i-citi4x) + (j-citi4y)*(j-citi4y));
if (dist <= 2){
unhappy4 = 1000000;
}
else {
unhappy4 = pop4/dist;
}
double unhappy = (unhappy1 + unhappy2 + unhappy3 + unhappy4)/(pop1+pop2+pop3+pop4);
  
if (unhappy < min){
min = unhappy;
plantx = i;
planty = j;

}
}
}
  
}
  
public void display_map(){
for (int i = 1; i <=25; i++){
for (int j = 1; j <=25; j++){
if (i == citi1x && j == citi1y)
System.out.print("C1");
else if (i == citi2x && j == citi2y)
System.out.print("C2");
else if (i == citi3x && j == citi3y)
System.out.print("C3");
else if (i == citi4x && j == citi4y)
System.out.print("C4");
else if (i == plantx && j == planty)
System.out.print("PP");
else
System.out.print("<>");
}
System.out.println();
}
System.out.println();
}


}

import java.util.Scanner;

public class StatePlant {
   public static void main(String[] args){
  
   Scanner sc = new Scanner(System.in);
   State s = new State();
   s.read_input();
   s.calc_plant();
   System.out.println("Locate the plan at : " + s.getPlantX() + " " +s.getPlantY() );
   System.out.println("Enter 1 to view a Map of the scenario, or 0 to exit:");
   String inp = sc.nextLine();
   if (inp.charAt(0) == '1'){
   s.display_map();
   }
  
   }
}

Thank you so much:)

In: Computer Science

Hi, please could someone be of assistance with this assignment for me. Thank you The objective...

Hi, please could someone be of assistance with this assignment for me. Thank you

The objective of this assignment is to practice the use of control objects in GUI design.
You are required to create a 4- function calculator. See pic below.

Calculator.png



The calculator should have buttons for all 10 numbers, the decimal point, the four operations (+,-,/,*), an equal “=” button, a "main display" (TextBox or RichTextBot), a backspace button and a clear “C” button.
When you create your controls, you need to give them proper names (e.g. ButtonOne, ButtonResult, ButtonClear,etc)
The only programming in this assignment is

  • To make sure that whenever a number button is clicked, that number will appear in the mainDiaply
    • e.g. if the user click 3, then the number 3 will appear. If the user then clicks 4, then 34 will appear.
    • make sure that include fractional numbers like "5.44", this means that you need to activate the '.' button
  • If the user clicks on the 'C' button, the main Display will be cleared

In: Computer Science