Questions
Create a 5-step modelling process that can be used to create an enterprise model. Pay specific...

Create a 5-step modelling process that can be used to create an enterprise model. Pay specific attention the aspects of the purpose of modelling and at least 5 steps to follow to create the model [20 marks] - be guided by mark allocation

In: Computer Science

Complete the following four installations:  Virtual Box: o Install Virtual Box. o Capture a screen...

Complete the following four installations:  Virtual Box: o Install Virtual Box. o Capture a screen shot .  Windows OS Workstation: o Create one Windows OS workstation:  You can use windows 7, 8 or 10 (If you have a DVD with OS use the DVD). o Capture a screen shot. Windows Server Image: o Create one Windows Server (2008, 2012 or 2016) images in the workstation you created.  Choose any operating system you want. Packet Tracer: o Install Packet Tracer on your host machine. please post screen shots of each

In: Computer Science

Please write in Python(Python3) Stack: The following was done already in the Lab in the Stacks...

Please write in Python(Python3)

Stack: The following was done already in the Lab in the Stacks Module with Doubly Linked List.(***Code Below***)

Create an application to help you stack and un-stack containers in the ship.

Create a class called container which will have the object (data), the link (next)

Create a class called Pod which is Stack. Include methods addContainer and removeContainer

Implement these classes by creating multiple containers to go inside the pod.

ADD the Following feature:(*This is what I need to ADD to the code.)

Include a class attribute in the container class called name.

In the implementation - Pod:

You should ask the user to enter the name of the container and the program should add the container to the Pod repeatedly.

Once done, You should ask the user which container to remove from the Pod. When the user gives the name of the container, the program should go through the Pod and remove that container alone from the Pod.

Clue: Remember if you want to remove one item from the Stack, you should use only the top to remove. So if you want to remove the fifth item from the top of the Stack, you should remove all the four items above it, remove the fifth item and then put back all the four items in the same order.

Write a method called removeNamedContainer in Pod program for implementing the above.

# DSTACK #
#****************************************************
# the container
class Container:

# initialise the container object
def __init__(self, data):
self.data = data
self.next = None
self.prev = None
# The pod
class Pod:
stack=[]
# push item to the stack
def addContainer(self, data):
c = Container(data)
c.next = None
self.stack.append(c)
# set the next item and prevous
length = len(self.stack)
# print(str(length))
if length>1:
self.stack[length-2].next=self.stack[length-1]
self.stack[length-1].prev=self.stack[length-2]
# pop the stack
def removeContainer(self):
self.stack.pop()
# reset the next link
length = len(self.stack)
self.stack[length-1].next=None
# to print items
def printList(self):
print("Traversal in forward direction")
temp = self.stack[0]
while (temp):
print(temp.data)
temp = temp.next
print("Traversal in reverse direction")
temp = self.stack[len(self.stack)-1]
while (temp):
print(temp.data)
temp = temp.prev
break

# Testing the stack
print("Adding containers...")
pod = Pod()
pod.addContainer(1)
pod.addContainer(2)
pod.addContainer(3)
pod.printList()
# poping the stack
print("Removing containers...")
pod.removeContainer()
pod.printList()

In: Computer Science

Develop a program that creates just 3 identical arrays, mylist_1, mylist_2, and mylist_3, of just 250...

Develop a program that creates just 3 identical arrays, mylist_1, mylist_2, and mylist_3, of just 250 items. For this assignment, the program then will sort mylist_1 using a bubble sort, mylist_2 using a selection sort, and mylist_3 will be using an insertion sort and outputs the number of comparisons and item assignments made by each sorting algorithm.

template <class elemType>
int seqSearch(const elemType list[], int length, const elemType& item)
{
int loc;
bool found = false;

loc = 0;

while (loc < length && !found)
if (list[loc] == item)
found = true;
else
loc++;

if (found)
return loc;
else
return -1;
} //end seqSearch


template <class elemType>
int binarySearch(const elemType list[], int length,
const elemType& item)
{
int first = 0;
int last = length - 1;
int mid;

bool found = false;

while (first <= last && !found)
{
mid = (first + last) / 2;

if (list[mid] == item)
found = true;
else if (list[mid] > item)
last = mid - 1;
else
first = mid + 1;
}

if (found)
return mid;
else
return -1;
} //end binarySearch

template <class elemType>
void bubbleSort(elemType list[], int length)
{
for (int iteration = 1; iteration < length; iteration++)
{
for (int index = 0; index < length - iteration;
index++)
{
if (list[index] > list[index + 1])
{
elemType temp = list[index];
list[index] = list[index + 1];
list[index + 1] = temp;
}
}
}
} //end bubbleSort

template <class elemType>
void selectionSort(elemType list[], int length)
{
int minIndex;

for (int loc = 0; loc < length; loc++)
{
minIndex = minLocation(list, loc, length - 1);
swap(list, loc, minIndex);
}
} //end selectionSort

template <class elemType>
void swap(elemType list[], int first, int second)
{
elemType temp;

temp = list[first];
list[first] = list[second];
list[second] = temp;
} //end swap

template <class elemType>
int minLocation(elemType list[], int first, int last)
{
int minIndex;

minIndex = first;

for (int loc = first + 1; loc <= last; loc++)
if (list[loc] < list[minIndex])
minIndex = loc;

return minIndex;
} //end minLocation

template <class elemType>
void insertionSort(elemType list[], int length)
{
for (int firstOutOfOrder = 1; firstOutOfOrder < length;
firstOutOfOrder++)
if (list[firstOutOfOrder] < list[firstOutOfOrder - 1])
{
elemType temp = list[firstOutOfOrder];
int location = firstOutOfOrder;

do
{
list[location] = list[location - 1];
location--;
}
while(location > 0 && list[location - 1] > temp);

list[location] = temp;
}
} //end insertionSort

template <class elemType>
void quickSort(elemType list[], int length)
{
recQuickSort(list, 0, length - 1);
} //end quickSort

template <class elemType>
void recQuickSort(elemType list[], int first, int last)
{
int pivotLocation;

if (first < last)
{
pivotLocation = partition(list, first, last);
recQuickSort(list, first, pivotLocation - 1);
recQuickSort(list, pivotLocation + 1, last);
}
} //end recQuickSort

template <class elemType>
int partition(elemType list[], int first, int last)
{
elemType pivot;

int smallIndex;

swap(list, first, (first + last) / 2);

pivot = list[first];
smallIndex = first;

for (int index = first + 1; index <= last; index++)
if (list[index] < pivot)
{
smallIndex++;
swap(list, smallIndex, index);
}

swap(list, first, smallIndex);

return smallIndex;
} //end partition

template <class elemType>
void heapSort(elemType list[], int length)
{
buildHeap(list, length);

for (int lastOutOfOrder = length - 1; lastOutOfOrder >= 0;
lastOutOfOrder--)
{
elemType temp = list[lastOutOfOrder];
list[lastOutOfOrder] = list[0];
list[0] = temp;
heapify(list, 0, lastOutOfOrder - 1);
}//end for
}//end heapSort

template <class elemType>
void heapify(elemType list[], int low, int high)
{
int largeIndex;

elemType temp = list[low]; //copy the root node of
//the subtree

largeIndex = 2 * low + 1; //index of the left child

while (largeIndex <= high)
{
if (largeIndex < high)
if (list[largeIndex] < list[largeIndex + 1])
largeIndex = largeIndex + 1; //index of the
//largest child

if (temp > list[largeIndex]) //subtree
//is already in a heap
break;
else
{
list[low] = list[largeIndex]; //move the larger
//child to the root
low = largeIndex; //go to the subtree to
//restore the heap
largeIndex = 2 * low + 1;
}
}//end while

list[low] = temp; //insert temp into the tree,
//that is, list
}//end heapify

template <class elemType>
void buildHeap(elemType list[], int length)
{
for (int index = length / 2 - 1; index >= 0; index--)
heapify(list, index, length - 1);
}

In: Computer Science

create a C++ Program 1. Ask and get a course name 2. Create an array of...

create a C++ Program

1. Ask and get a course name

2. Create an array of students of size 10,

3. Initialize the elements of the students array of appropriate names and grades

4. Create an object of class GradeBook (provide the course name and the created student array, in 3 above, as arguments to the constructor call. The arguments are used to initialize the data members of the class GradeBook.

Desired Output:

=========================================================

Enter course name: Object Oriented Programming

=====================Entering Students' Information===============================

Enter the name and grade for 10 students

student # 1 name: John

Student # 1 grade : 100

student # 2 name: Mark

Student # 2 grade : 100

student # 3 name: Jesus

Student # 3 grade : 89

student # 4 name: Tony

Student # 4 grade : 87

student # 5 name: Leo

Student # 5 grade : 79

student # 6 name: Don

Student # 6 grade : 75

student # 7 name: Devin

Student # 7 grade : 83

student # 8 name: Xavier

Student # 8 grade : 90

student # 9 name: jerry

Student # 9 grade : 25

student # 10 name: Jones

Student # 10 grade : 46

============================================================================

Welcome to the grade book for

Object Oriented Programming!

=====================After Processing Class's Grade===============================

The grades are:

Jonh  : 100

Mark : 100

Jesus: 89

Tony : 87

Leo: 79

Don : 75

Devin: 83

Xavier : 90

Jerry : 25

Jones : 46

Class average is 77.40

Lowest grade is 25

Highest grade is 100

Grade distribution:

0-9:

10-19:

20-29: *

30-39:

40-49: *

50-59:

60-69:

70-79: **

80-89: ***

90-99: *

100: **

Press any key to continue . . .

SAMPLE CODE!!!!!!!!!!!!!!!!!!!!!!!!

GradeBook.h

#pragma once

#include<string>

#include<array>

class GradeBook {

public:

       GradeBook(std::string& cName,std::array<int,10>& sGrades) :

              courseName{ cName }, studentGrades{ sGrades } {

       }

       std::string getCourseName() const {

              return courseName;

       }

       void setCourseName(const std::string& cName) {

              courseName = cName;

       }

       void processGrades() const {

              outputGrades();

              std::cout << "\nClass average: " << getAverage() << std::endl;

              std::cout << "\nClass maximum: " << getMaximum() << std::endl;

              std::cout << "\nClass minimum: " << getMinimum() << std::endl;

              std::cout << "Bar Chart:\n";

              outputBarChart();

       }

       int getMaximum() const {

              int highGrade{ 0 };

              //range-based for loop

              for (int grade : studentGrades) {

                     if (highGrade < grade) {

                            highGrade = grade;

                     }

              }

              return highGrade;

       }

       int getMinimum() const {

              int lowGrade{ 100 };

              for (int grade : studentGrades) {

                     if (lowGrade > grade) {

                            lowGrade = grade;

                     }

              }

              return lowGrade;

       }

       double getAverage() const {

              int sum{ 0 };

              for (int grade : studentGrades) {

                     sum += grade;

              }

              return static_cast<double>(sum) / studentGrades.size();

       }

       void outputGrades() const {

              std::cout << "\n The grades are: \n\n";

              for (size_t i{ 0 }; i < studentGrades.size(); ++i)

              {

                     std::cout <<"Student "<< i + 1 << " grade: " << studentGrades.at(i) << std::endl;

              }

       }

       void outputBarChart() const {

              std::cout << "\nGrade distribution:\n";

              std::array<int, 11> frequency{};

              for (int grade : studentGrades) {

                     ++frequency[grade / 10];

              }

              for (size_t i{ 0 }; i < frequency.size(); ++i)

              {

                     if (i == 0) {

                            std::cout << "  0-9:";

                     }

                     else if (i == 10) {

                            std::cout << "  100:";

                     }

                     else {

                                   std::cout << i * 10 << "-" << (i*10) + 9 << ":";

                     }

                     for (unsigned stars{ 0 }; stars < frequency[i]; ++stars) {

                            std::cout << '*';

                     }

                     std::cout << std::endl;

                     

              }

       }

private:

       std::string courseName;

       std::array<int, 10> studentGrades;

};

GradeBookDriver.cpp

#include<iostream>

#include<string>

#include"GradeBook.h"

#include<array>

using namespace std;

int main()

{

       string courseName = "COSC 1337 Object Oriented Programming";

       array<int, 10> studentGrades{ 87, 68, 94, 100, 83, 78, 85, 91, 76, 87 };

       GradeBook myGradeBook(courseName,studentGrades);

       myGradeBook.setCourseName(courseName);

       myGradeBook.processGrades();

}

In: Computer Science

Minimum Recharging Stops You have decided that your first purchase after graduation will be a Tesla...

Minimum Recharging Stops
You have decided that your first purchase after graduation will be a Tesla Model X. You have further decided to drive from Harrisburg to San Francisco, as quickly (and safely) as possible. In order to minimize your travel time, you wish to minimize the number of recharging stops. You have recorded the distances between charging stations on your route, and you know the maximum range that you can travel on a single charge.

Input: An array g containing the distances of charging stations on the route from the starting point; r the range you can travel on a single charge, and d the length of the route from Harrisburg to San Francisco. You are guaranteed that the distances between the charging stations will be less than or equal to r.

Return: The minimum number of stops needed for charging in order to complete the trip.

a) Suppose that you wrote an exhaustive search algorithm. How many possible solutions would you examine?
b) Write an efficient algorithm to solve this problem.

In: Computer Science

import java.awt.*; import javax.swing.JButton; import javax.swing.JFrame; public class GridBagLayoutDemo { final static boolean shouldFill = true;...

import java.awt.*;
import javax.swing.JButton;
import javax.swing.JFrame;

public class GridBagLayoutDemo {
final static boolean shouldFill = true;
final static boolean shouldWeightX = true;
final static boolean RIGHT_TO_LEFT = false;

public static void addComponentsToPane(Container pane) {
if (RIGHT_TO_LEFT) {
pane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
}

JButton button;
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
if (shouldFill) {
//natural height, maximum width
c.fill = GridBagConstraints.HORIZONTAL;
}

button = new JButton("Button 1");
if (shouldWeightX) {
c.weightx = 0.5;
}
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
pane.add(button, c);

button = new JButton("Button 2");
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0.5;
c.gridx = 1;
c.gridy = 0;
pane.add(button, c);

button = new JButton("Button 3");
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0.5;
c.gridx = 2;
c.gridy = 0;
pane.add(button, c);

button = new JButton("Long-Named Button 4");
c.fill = GridBagConstraints.HORIZONTAL;
c.ipady = 40; //make this component tall
c.weightx = 0.0;
c.gridwidth = 3;
c.gridx = 0;
c.gridy = 1;
pane.add(button, c);

button = new JButton("5");
c.fill = GridBagConstraints.HORIZONTAL;
c.ipady = 0; //reset to default
c.weighty = 1.0; //request any extra vertical space
c.anchor = GridBagConstraints.PAGE_END; //bottom of space
c.insets = new Insets(10,0,0,0); //top padding
c.gridx = 1; //aligned with button 2
c.gridwidth = 2; //2 columns wide
c.gridy = 2; //third row
pane.add(button, c);
}

private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("GridBagLayoutDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set up the content pane.
addComponentsToPane(frame.getContentPane());

//Display the window.
frame.pack();
frame.setVisible(true);
}

public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}

I need someone to go through this program and right more comments that explain a lot more Please. from top to bottom Thanks

In: Computer Science

i want it in C++.You will solve the Towers of Hanoi problem in an iterative manner...

i want it in C++.You will solve the Towers of Hanoi problem in an iterative manner (using Stack) in C++(using data structure).
Note: you have to solve for N number of disks, 3 Towers (Stacks). Do not use recursion.
For better understanding play the game at least once.
Link:https://www.mathsisfun.com/games/towerofhanoi.html

In: Computer Science

You are now the manager of a small team of software engineers. Some of them are...

You are now the manager of a small team of software engineers. Some of them are fresh graduates, while some of them have a few years of working experience in the field. You are tasked with producing a small experimental FinTech (Financial Technology) mobile application. You will need to publish on both Android and iPhone platforms. You are adopting an Agile methodology, with emphasis on Test-Driven Development and extensive automated tests. The concept behind the application is very innovative, so design is constantly changing.

Your team consultant, William, believes the team should spend less time on planning and more time on producing first prototypes, and then revise our design based on further feedback. Do you agree with his approach? If yes, which practice in Agile methodology is in agreement with this approach?

In: Computer Science

write a program using Java language that is- Implement Stack with a linked list, and demonstrate...

write a program using Java language that is-

  1. Implement Stack with a linked list, and demonstrate that it can solve the Tower of Hanoi problem.

  2. Write implementation body of method “infixToPrefix(String[] e)” of class ArithmeticExpression to convert infix expressions into prefix expressions.

In: Computer Science

Consider the language L over alphabets (a, b) that produces strings of the form aa* (a...

Consider the language L over alphabets (a, b) that produces strings of the form aa* (a + b) b*a.
a) Construct a nondeterministic finite automata (NFA) for the language L given above.

b) Construct a deterministic finite automaton (DFA) for the NFA you have constructed above.

In: Computer Science

Using your Barrel class and Temperature class create a VacuumBarrel class that extends the Barrel class...

Using your Barrel class and Temperature class create a VacuumBarrel class that extends the Barrel class and incorporates a Temperature as the private data of the VacuumBarrel. Provide constructors, add(VacuumBarrel), subtract(VacuumBarrel), divide(int), equals(VacuumBarrel), greaterThan(VacuumBarrel) (that has one parameter and returns true if the this is greater than the parameter), toKelvin(), toFahrenheit(), toCelsius(), and toString() methods. Use a similar demo to the one you used with the Temperature class. This demo will put instances of VacuumBarrel in three arrays and manipulates them.

The VacuumBarrel class extends Barrel so it is a Barrel. The data of the Barrel class should be private so the code answer.marbles = this.marbles + other.marbles; will not compile. The Barrel methods are inherited however and they can be used to make the addition. The Barrel class should have method set(int) that can be used to set the value of marbles to the integer parameter. The Barrel class should have method get() that will return the value of a Barrel. If the values of the two Barrels can be found then an addition is easy. It is also possible that the Barrel class has method set(Barrel) that will set the value of marbles to the parameter’s value. The method add(Barrel) of the Barrel class returns a Barrel. Using these two methods will also give the value for VacuumBarrel answer.

The VacuumBarrel has a private Temperature that can use the methods from the Temperature class. In the VacuumBarrel the private data degree and scale of the Temperature class cannot be used. If the private data in the VacuumBarrel is called temp then this value can be accessed with this code: answer.temp, this.temp and other.temp.

In: Computer Science

Python Programming I have a skeleton code here for this project but do not know exactly...

Python Programming

I have a skeleton code here for this project but do not know exactly where to start. My task is to implement a reliable File Transfer Protocol (FTP) service over UDP. I need help to write the reliable FTP client and server programs based on an Alternating Bit Protocol (ABP) that will communicate with a specially designated server. In socket-level programming as well...

# program description

# Library imports

from socket import *

import sys

import time

# Variable declarations

server = "harp.ece.vt.edu" # server

tcpPort = 21000 # TCP listening port

buffer = 4096 # defines the size of acceptable data for receipt

message ="debug" # controls condition of transfered data. debug: no delay or corruption

# normal: server introduces delays and errors into transmission

# Initialize variables

# sequence number value 1

# sequence number value 0

# Temporary variable for alternating sequence numbers

# control value transfer in progress

# initial setting is for ACK1 but changes during execution

# calculated by a char by char ordinal sum of the packet

# value is then converted to 4-digit ASCII value via

# sum mod 10000

PAYLOAD = ""

udpPort = 0 # variable to hold udpPort number

completeFile = [] # accumulation of complete file transfer

serverResponse = "" # server response variable

endFile = False # flag for end of transmission

badPacket = False #flag for bad checksum comparison

# Create socket variable

sTCP = socket(AF_INET, SOCK_STREAM) # TCP socket definition

sUDP = socket(AF_INET, SOCK_DGRAM)  # UDP socket definition

# send ACK packet to server

Some further instructions include:

The four fields of the “RFP” protocol are:

● SEQUENCE: This is the sequence number of the packet, and can legally assume either of the two values: “0000” or “0001”.

● CHECKSUM: This is a 4-digit ASCII number that is the byte-by-byte sum, modulo-10000, of all data in the payload including the header SEQUENCE and header CONTROL.

● CONTROL: Used by the server to indicate Transfer in Progress “0000” or All Done “0001”. The client should set this field to “0000”. “0002” is reserved for future use.

● DATA: Used by the server to send part of the data file it is transferring

We will establish a “channel”  here, the server will respond with a unique UDP port for you to use for your file transfer: 1. Open a TCP connection to harp.ece.vt.edu over port 21000 2. Send the word “normal” to the server over this port. 3. The server will respond with a number formed in an ASCII string. This is the UDP port that you shall use in the file transfer session. 4. Close the TCP connection. Once you have been assigned a UDP port, you are ready to start the file transfer after you open the socket.

To initiate the file transfer, the client should send an ACK1 packet (sequence number = “0001”, control = “0000”, a computed checksum, and zero bytes of data). As stated above, the checksum is the character-by-character ordinal sum over the entire packet (excluding the checksum field). For the ACK1 packet, checksum = “0”+”0”+“0”+”1”+“0”+”0”+“0”+”0” = ASCII 48 + 48 + 48 + 49 +48 + 48 + 48 + 48 = 385. The 4-digit modulo-10000 ASCII decimal equivalent of this checksum is “0385.” 1 The server will then start sequentially sending the file data, starting with a packet with Sequence Number 0. Abide by the Alternating Bit Protocol to transfer the contents of the file. When the server has completed the file transfer, it will send a final packet with no data with the control field set to “0001.” You must ACK this packet. Then you can close your UDP session and save the output file.

Since the file will be larger than a single packet, the server will segment the file into chunks that will fit within packets. The client will need to reassemble these and put them in a file called reliable.txt.

8.5.2

In: Computer Science

Consider that time could be internally represented as 3 integers. hour (between 0 - 23) minute...

Consider that time could be internally represented as 3 integers.

  • hour (between 0 - 23)
  • minute (between 0 - 59)
  • second (between 0 - 59)

MyTime class consists of the following members:

  • Default constructor: set the time to 00:00:00
  • Constructor taking 3 integers i.e., hour, minute and second respectively. This constructor sets this object's Time based on the given parameters.
  • Constructor taking 2 integers i.e., hour and minute respectively. This constructor sets this object's hour and minute based on the given parameters. Second will be 0 by default.
  • Constructor taking 1 integer i.e., hour. This constructor sets this object's hour based on the given parameter. Minute and second will be 0 by default.
  • Accessors (getter) for each field.
  • Mutators (setter) for each field. Make sure that each field is set within its proper ranges.
  • to12HourFormat() method
    Returns the string representation of this Time object in 12-hour format.
    For instance, if the time is 13:05:58 in 24-hour format, it returns "01:05:58 PM".
    If the time is "12:05:14", it returns "12:05:14 PM".
    If the time is "00:00:00", it returns "12:00:00 AM".
  • toString() method
    Returns the string representation of time in 24-hour format i.e., HH:MM:SS
    For instance, 13:05:58

Complete the MyTime class definition and write a main program to test your class in Java.

In: Computer Science

Explain how you would secure your company’s internal wireless network to prevent unauthorized access, including how...

Explain how you would secure your company’s internal wireless network to prevent unauthorized access, including how it’s configured and what policies might need to be created and enforced to ensure employee compliance.

In: Computer Science