Questions
How do I covert a char from a sting that is made up of hex values...

How do I covert a char from a sting that is made up of hex values into a long int, without using istringstream and istring in c++?

In: Computer Science

Due to cyber threats in the digital world, an aspiring penetration testers are in demand to...

Due to cyber threats in the digital world, an aspiring penetration testers are in demand to enter the field of cybersecurity. A penetration testeris a professional who hasthe skills of a hacker; they are hired by an organisation to perform simulations of real world attacks because there are wide reaching consequences if systems in any organisation are compromised. Assume, yourself as an aspiring pen tester, how you will showcase the impact of session hijacking, session prediction, session fixation, session side jacking, cross-site scripting and illustrate some of the infamous session hijacking exploitsto your prospective employer BAGAD Pty. Ltd.

In: Computer Science

London Hydro (LH), the electricity provider of London, Ontario, and surrounding areas, is wrapping up a...

London Hydro (LH), the electricity provider of London, Ontario, and surrounding areas, is wrapping up a lengthy and costly system upgrade that was sparked by government regulations. Ontario prides itself on using the latest technologies to conserve electricity. In 1998 it passed two regulations that paved the way for smart-metering: the Electricity Act, 1998 and the Ontario Energy Board Act, 1998. Smart-metering uses computerized electric meters on homes and small businesses that can record electricity use on an hourly basis. So, rather than totalling up kilowatt-hours on a monthly basis as traditional meters do, smart meters provide a record of electricity use every hour. Smart meters are able to report usage directly to utility companies over phone lines or the Internet. The benefit of smart meters, in addition to saving the electric company the cost of sending an employee to read meters, is setting time-of-use pricing. Time-of-use pricing charges customers more for electricity during peak hours (11 a.m.– 5 p.m.), less during mid-peak hours (7 a.m.–11 a.m. and 5 p.m.–10 p.m.), and even less during off-peak hours (10 p.m.– 7 a.m.). Time-of-use pricing should encourage consumers to consume less during peak hours, adding up to big savings for Ontario, its citizens, and the environment. Ontario’s smart metering initiatives have power companies across the province scrambling to meet specifications and deadlines. Software and hardware must be purchased and installed to prepare for the arrival of a tidal wave of customer consumption data. London Hydro started to prepare early in hopes of getting a jump on the competition. Rather than adding a new system to accommodate smart metering, London Hydro decided it was time to upgrade all of its systems. London Hydro’s old custom-built system could barely keep up with current usage. The company decided to shop around for a new system that could not only accommodate smart metering but could tie that data in with core business systems. Mridula Sharma, London Hydro’s Director of Information Services, stated that LH was in need of “a more integratable solution that was scalable and flexible.” The company needed to “prepare for future growth as well as enhance business process workflow,” Sharma said. Sharma and her team set to work outlining the details of the new system based on government mandates and internal needs. With a systems analysis report in hand, Sharma began searching for a company that could design and implement the system. Soon, she narrowed the field to three candidates: SPL Solutions (Oracle), another customer-built solution, and SAP for utilities. Sharma chose SAP primarily because the system was designed for use by a utility company and required little customization. London Hydro selected another outside firm, Wipro Technologies, to implement the system because Wipro had extensive experience implementing utility software. The resulting system provides powerful management of smart metering data flowing from the government’s central smart metering data repository. The task of assigning time-of-use prices based on customer consumption is fully automated and will cause London Hydro no additional overhead.

[Source: Chapter 12, R. M. Stair and G. W. Reynolds, Principles of Information Systems: A Managerial Approach, 9th ed. Cengage, 2010.]

a) Why did London Hydro initiate its smart-metering system development?

b) What benefits did London Hydro enjoy by purchasing an off-the-shelf system and outsourcing the implementation?

In: Computer Science

1.) Modify your Student class to overload the following operators: ==, !=, <, >, <=, >=...

1.) Modify your Student class to overload the following operators: ==, !=, <, >, <=, >= as
member operators. The comparison operators will compare students by last name first
name and id number. Also, overload << and >> as friend operators in the Student class.
Overload << and >> operators in Roster class as well to output Rosters in a nice format as
well as input Roster. Provide a function sort in a Roster class as a private function to sort
out all the students in a Roster according to their Last Name, First Name, and Student id
using the comparison operators that you overloaded in the Student class.

2.) Modify your Roster class so that it will now store a dynamic array of pointers to Student
objects. The Roster is identified by the course name, course code, number of credits,
instructor name, and contains a list of students stored in an array of pointers to Students.
The array must have the ability to grow if it reaches the capacity (for that provide a
private function grow ()). Modify your functions to add a student to a Roster, delete
student from a Roster, and search for a student to reflect the changes.

Down below are the student.h and roster.h files. If you can make the changes in BOLD text, it will be easier for me to see the changes. Thanks!

//STUDENT.H
#ifndef STUDENT_H
#define STUDENT_H

class Student
{
private:
   //member variables
   std::string firstName, lastName, standing, dateOfBirth, dateOfMatriculation;
   int credits;
   double gpa;
   string id; //add id
   //private member function to correct standing when credits change
   void correctStanding();
  
public:
   //constructors
   Student();
   Student(std::string fn, std::string ln, std::string dob, std::string dom, int c, double g);
  
   //mutators
   void setFirst(std::string);
   void setLast(std::string);
   void setDateOfBirth(std::string);
   void setDateOfMatriculation(std::string);
   void setCredits(int);
   void setGPA(double);
  
   //accessors
   std::string getFirst();
   std::string getLast();
   std::string getDateOfBirth();
   std::string getDateOfMatriculation();
   std::string getStanding();
   int getCredits();
   double getGPA();
  
   //console i/o functions
   void input();
   void output();
};
#endif
//END STUDENT.H
-----------------------------------------
//ROSTER.H
#ifndef ROSTER_H
#define ROSTER_H
#define MAX_CAPACITY 10
#include "student.h"

class Roster
{
public:
   //Constructors
   Roster();
   Roster(std::string, std::string, std::string, int);
  
   //Accessors
   std::string getCourseName() const;
   std::string getCourseCode() const;
   std::string getInstructor() const;
   int getCredits() const;
   int getNumStudents() const;
   Student getStudent(int) const;
  
   //Mutators
   void setCourseName(std::string);
   void setCourseCode(std::string);
   void setInstructor(std::string);
   void setCredits(int);
  
   //Array Functions
   void addStudent(Student);
   void delStudent(int);
   int findStudent(std::string, std::string);
   void outputArray();
private:
   std::string courseName, courseCode, instructor;
   int credits, numStudents = 0;
   Student studentList[MAX_CAPACITY];
};
#endif
//END ROSTER.H
----------------------------------

In: Computer Science

Write a class named GroceryList that represents a list of items to buy from the market,...

Write a class named GroceryList that represents a list of items to buy from the market, and another class named GroceryItemOrder that represents a request to purchase a particular item in a given quantity (example: four boxes of cookies). It also has client class called GroceryClient which creates objects of GroceryList and GroceryItemOrder. (For this assignment, you will have to submit 3 .java files: one for each class and 3 .class files associated with these .java files. So in total you will be submitting 6 files for this problem.) The GroceryList class should use an array field to store the grocery items and to keep track of its size (number of items in the list so far). Assume that a grocery list will have no more than 10 items. A GroceryList object should have the following methods: public GroceryList() Constructs a new empty grocery list. public void add(GroceryItemOrder item) Adds the given item order to this list if the list has fewer than 10 items. public double getTotalCost() Returns the total sum cost of all grocery item orders in this list. The GroceryItemOrder class should store an item quantity and a price per unit. A GroceryItemOrder object should have the following methods: public GroceryItemOrder(String name, int quantity, double pricePerUnit) Constructs an item order to purchase the item with the given name, in the given quantity, which costs the given price per unit. public double getCost() Returns the total cost of this item in its given quantity. For example, four boxes of cookies that cost 2.30 per unit have a total cost of 9.20. public void setQuantity(int quantity) Sets this grocery item’s quantity to be the given value. The GroceryClient class has static main(..) method and initializes objects for GroceryItemOrder class by adding different items along with their unit item price and available quantity and then creates a GroceryList class object and adds the required grocery list using add() method and determines the total cost using getTotalCost() method and displays it on the console.

In: Computer Science

1. Find the number of unique addresses accessed by a 16-bit microprocessor. If the width of...

1. Find the number of unique addresses accessed by a 16-bit microprocessor. If the width of the data bus is also 8 bits, determine the word size in bytes.

2. What is the difference between DRAM and SRAM in terms of their applications? Why do synchronous DRAMs make use of a register, called a mode register?

In: Computer Science

. Recommend appropriate data analytic techniques for security prevention at IMC.

. Recommend appropriate data analytic techniques for security prevention at IMC.

In: Computer Science

Give asymptotic tight bounds for T(n) in each of the following recurrences using recursion tree. a....

Give asymptotic tight bounds for T(n) in each of the following recurrences using recursion tree.

a. T(n) = 2T(n − 1) + 1

b. T(n) = t(n − 1) + n

c. T(n) = 2T (n/4) + √n

In: Computer Science

Please Use Javascript and P5 Pongish Create a one player pong game. This should have: 1....

Please Use Javascript and P5

Pongish

Create a one player pong game. This should have:

1. A paddle/rectangle controlled by the player on the right of the screen (moves up/down)

2. A ball/circle that starts moving to the left of the screen.

3. This ball bounces off the TOP, BOTTOM, and LEFT of the screen.
4. This ball bounces off the paddle (use hitTestPoint)
5. If the ball goes beyond the right of the screen, place the ball back at the center of the screen and set its velocity to the left again.
7. (optional) Display a "score" number on the screen that ticks up by 1 every time the player catches the ball with the paddle. Resets to zero when the ball resets.

Ideally, this project would use objects for both paddle and ball.

In: Computer Science

The Mayo Clinic and IBM have partnered in a venture to improve medical imaging technology. The...

The Mayo Clinic and IBM have partnered in a venture to improve medical imaging technology. The clinic’s current technologies are not keeping up with the intense processing demands required to analyse digital medical images such as x-rays, CT scans, and MRIs. Bradley Erickson, chairman of radiology at the Rochester-based Mayo Clinic, was quoted in Computerworld as saying, "We are facing significant problems in medical imaging because the number of images produced in CT scanners basically tracks Moore’s Law. My eyes and brain can’t keep up. I see more and more images I have to interpret. ... The innovation here is to take computer chips and extract the information in these increasing number of images and help present it usefully to the radiologist.” This is a case of technology outpacing the human ability to manage the information it produces. In such cases, we turn to technology for solutions. For doctors and radiologists at the Mayo Clinic, standard computer processors cannot keep up with their need to analyse digital images. So, they are turning to the Cell processor from IBM in hopes that it will provide a solution. The Cell processor is the chip that makes Sony’s PlayStation video-game console the most powerful console in the industry, according to many game enthusiasts. The Cell processor was created in a joint effort by IBM, Sony, and Toshiba, with an architecture that is specially designed to accelerate graphics processing. Researchers at IBM and Mayo believe that it could turn a 10-minute CT image analysis into a four-second job. One of the tasks in which the Cell processor could be useful is in comparing scan images of a patient over time. For example, to track the progression or regression of cancer in a patient, physicians compare CT scans of the tumour over time to look for change. Changes are often too subtle for the human eye to notice, so software that implements a complex algorithm is used to analyse the photos. Using a standard PC processor, the algorithm may take several minutes to complete. While this may not sound like much, typically a physician needs to run several analyses in sequence, consuming significant amounts of time. The process of transforming 2-D images into 3-D—something the Cell processor was designed for—also requires significant time using traditional processors. With the Cell processor, these tasks might be completed in a matter of a seconds. Whether it is working to save a life, to finish design specifications for a new product, or to analyse stock market trends, the difference between a minute and a second can mean success or failure. For professionals in most industries, having the best processor for the task at hand, and matching it with the best hardware and software, provides them with a winning solution. [Source: Chapter 3, R. M. Stair and G. W. Reynolds, Principles of Information Systems: A Managerial Approach, 9th ed. Cengage, 2010.]

a) Explain why the Cell processor is the best choice for the Mayo Clinic’s tasks?

b) In what other industry and scenario might the time play an important role when it comes to processing? Explain how reducing minutes to seconds has an impact in such a scenario.

In: Computer Science

How would I make a bubble sort and an optimized bubble sort with the code given?...

How would I make a bubble sort and an optimized bubble sort with the code given? I also need to implement a timer into each sort and display runtime with the sorts.

NODE.H
_______________________________________________________________________________________________________

/* node.h */
/*

two classes 1: node.h 2. singlylinkedlist.h

nod1 (value + pointer) ---> node2 ---> node3 ---> |||| <--- node.h
^
| singlylinkedlist
----------------*node head;

*/

#ifndef NODE_H
#define NODE_H

#include <iostream>
using namespace std;

class Node {
   friend class singlyLinkedList;
public:
   Node();
   Node (int value);
   ~Node();
   int displayValue();
private:
   int value;
   Node* next;
};

#endif

SINGLYLINKEDLIST.H
_______________________________________________________________________________________________________

/* singlylinkedlist.h */

#ifndef SINGLY_LINKED_LIST_H
#define SINGLY_LINKED_LIST_H

#include <iostream>
using namespace std;

#include "node.h"

class singlyLinkedList
{
public:
   singlyLinkedList();
   ~singlyLinkedList();
   void addFront(Node* newNode);
   void displaySinglyLinkedList();
   void bubbleSort();
   void optimizedBubbleSort();
private:
   Node *head;
};

#endif

NODE.CPP
_______________________________________________________________________________________________________

/* node.cpp */

#include <iostream>
using namespace std;

#include "node.h"

Node::Node()
{
   value = 0;
   next = NULL;
}

Node::Node(int v)
{
   value = v;
   next = NULL;
}

Node::~Node()
{
}

int Node::displayValue()
{
   return value;
}

SINGLYLINKEDLIST.CPP
_______________________________________________________________________________________________________

/* singlylinkedlist */

#include <iostream>
using namespace std;

#include "singlylinkedlist.h"

singlyLinkedList::singlyLinkedList()
{
   head = NULL;
}

singlyLinkedList::~singlyLinkedList()
{
}

void singlyLinkedList::addFront(Node *newNode)
{
   if (head == NULL)
       head = newNode;
   else
   {
       // Add code here!
       /* node1-->||| (before) what is after node2 --> node1 -->||| */

       newNode->next = head;
       head = newNode;
   };
}

void singlyLinkedList::displaySinglyLinkedList()
{
   Node *tempHead;

   tempHead = head;

   while (tempHead != NULL)
   {
       cout << tempHead->value << " ";
       tempHead = tempHead->next;
   }
   cout << endl;
}

void singlyLinkedList:: bubbleSort()
{
   // Your Code Starts Here!
   // Please display the runtime for this task before exit
   // start clock
   // ....
   // stop the clock
   // display the (stop-clock - start-clock
}

void singlyLinkedList:: optimizedBubbleSort()
{
   // Your Code Starts Here!
   // Please display the runtime for this task before exit
   // start clock
   // ....
   // stop the clock
   // display the (stop-clock - start-clock
}

MAIN.CPP
_______________________________________________________________________________________________________

// In Project 1, your are required to implement the code for bubble sort and optimized bubble sort
// using the data structure of sinngly linked list (nothing else).

/* Bubble Sort:
for (int i = 0; i < n; i++)
for (int j = i; j < n; j++)
{
if (A[i] > A[j])
{
temp = A[i];
A[i] = A[j];
A[j] = temp;
}
}
}
*/

/* Optimized Bubble Sort:
flag = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < n-1; j++)
{
if (A[j] > A[j+1])
{
temp = A[j];
A[j] = A[j+1];
A[j+1] = temp;
   flag = 1; // if swapping occurs
}
}
   if (flag == 0)
break; // the input list already sorted, no need for the inner loop
}
*/

// The main program will create 10 nodes for storing a sequence of 10 integers
// bubble Sort() will be invoked to sort these 10 integers
// then optimizedBubbleSort will be invoked to sort the sorted sequence (degenerate case) again
// You will find out optimizedBubbleSort will take O(1) running time to do the sorting
// unlike bubbleSort taking O(n^2) run time to sort a sorted sequence.

// Lastly, in order to see the differences of bubbleSort and optimizedBubbleSort,
// also implement timer into both code, after the sorting, print out the runtime
// of sorting the sequence. For bubbleSort, no matter sorted or unsorted, it always
// take O(n^2) runtime. But for optimizedBubbleSort, for unsorted sequence, like
// bubbleSort, it takes O(n^2) runtime. However, for a sorted sequence,
// optimizedBubbleSort will take O(1) only. For a sorted sequence as a
// degenerate case, optimizedBubbleSort is more efficienct than bubbleSort
// for sorting a sequence of integers.

// You MUST use this provided code for Project 1

#include <iostream>
using namespace std;

#include "node.h"
#include "singlylinkedlist.h"


int main()
{
   /* create 10 nodes */
   Node *n1 = new Node(23); // objects creation (class instantiation)
   Node *n2 = new Node(-20);
   Node *n3 = new Node(7);
   Node *n4 = new Node(174);
   Node *n5 = new Node(56);
   Node *n6 = new Node(-98);
   Node *n7 = new Node(101);
   Node *n8 = new Node(46);
   Node *n9 = new Node(31);
   Node *n10 = new Node(5);

   /* create singly linked list */
   singlyLinkedList *sLL;
   sLL = new singlyLinkedList();

   /* insert 10 nodes into the singly linked list in First in, Last out manner */
   sLL->addFront(n1);
   sLL->addFront(n2);
   sLL->addFront(n3);
   sLL->addFront(n4);
   sLL->addFront(n5);
   sLL->addFront(n6);
   sLL->addFront(n7);
   sLL->addFront(n8);
   sLL->addFront(n9);
   sLL->addFront(n10);

   /* display the contents of the 10 nodes in the singly linked list */
   sLL->displaySinglyLinkedList();

   /* The following code will act it is supposed to do
   when you are successfully implment bubbleSort and
   optimizedBubbleSort. */
   sLL->bubbleSort(); // bubble sort the unsorted sequence
   sLL->displaySinglyLinkedList(); // a sorted sequence displayed


   sLL->optimizedBubbleSort(); // optimized bubble sort the already sorted sequence (a degenerate case)
   // the runtime should show O(1), it means time should be musch less than runtime
   // of bubbleSort()
   sLL->displaySinglyLinkedList(); // a sorted sequence displayed

   system("PAUSE");
   return 0;
}

In: Computer Science

Create a Java application NumberLoops to practice loops. The draft has one loop to calculate a...

Create a Java application NumberLoops to practice loops. The draft has one loop to calculate a product and the final will add another loop to print integers in a required format. There is no starter code for the problem.

Use a Scanner to input an integer then compute and display the product of all positive integers that are less than the input number and multiple of 3. If no numbers satisfy the conditions, then print out 1 for the product.

Use a double for the product to avoid overflow and print out it without any decimal digits using the format specifier “%.0f”. Numbers 1 and 3 are allowed for the draft and will not be considered as magic numbers.

After printing out the product, enter another integer then print out all non-negative integers less than the input integer, starting with 0. Print one space after each integer and one additional space before an integer if it is less than 10. Print 10 integers per row, except the last row which may have less than 10 integers. In addition to 1 and 3, numbers 9 and 10 are allowed for the final and will not be considered as magic numbers.

The remainder operator (%) will help you here to decide when to call println() to go to the next line. Use only one loop. Do not use nested loops.

Sample run Enter an integer: 36

The product is 7071141369600.

Enter another integer: 36

0 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19

20 21 22 23 24 25 26 27 28 29

30 31 32 33 34 35

CODE CHECK:

In: Computer Science

Suppose that a software developer is creating a program to store lists of supermarket products. Each...

Suppose that a software developer is creating a program to store lists of supermarket products. Each product has a code made up of the digits 0 and 1, for example 010011010000, and an availability, either yes or no. Further suppose that the software developer decides to store the lists in base-10, believing that base-10 will simplify calculations. Briefly explain why this is a bad idea.

In: Computer Science

In April 2019, Paul Marrapese, an independent security researcher from San Jose, California, has published research...

In April 2019, Paul Marrapese, an independent security researcher from San Jose,
California, has published research warning that peer-to-peer software developed by
Shenzhen Yunni Technology firm, that's used in millions of IoT devices around the world,
has a vulnerability that could allow an attacker to eavesdrop on conversations or press
household items into service as nodes in a botnet.
The software, called iLnkP2P, is designed to enable a user to connect to IoT devices from
anywhere by using a smartphone app. The iLnkP2P functionality is built into a range of
products from companies that include HiChip, TENVIS, SV3C, VStarcam, Wanscam, NEO
Coolcam, Sricam, Eye Sight, and HVCAM.
What Marrapese found is that as many as 2 million devices, and possibly more, using
iLnkP2P software for P2P communication do not have authentication or encryption
controls built-in, meaning that an attacker could directly connect to a device and bypass
the firewall. Marrapese discovered the iLinkP2P flaw after buying an inexpensive IoT-
connected camera on Amazon.
"I found that I was able to connect to it externally without any sort of port forwarding,
which both intrigued and concerned me," Marrapese told Information Security Media
Group. "I found that the camera used P2P to achieve this, and started digging into how
it worked. From there, I quickly learned how ubiquitous and dangerous it was."
While the flaws with the iLnkP2P peer-to-peer software apparently have not yet been
exploited in the wild, Marrapses believes it's better for consumers to know now before
an attacker decides to start taking advantage of this particular vulnerability.
"There have been plenty of stories in the past about IP cameras and baby monitors being
hacked, but I believe iLnkP2P is a brand new vector not currently being exploited in the
wild," Marrapese says. "With that being said, the biggest motivation behind this
disclosure is to inform consumers before it's too late - because I believe it's only a matter
of time."
As part of his research, Marrapese says he attempted to contact not only Shenzhen
Yunni Technology but also several of the IoT manufacturers that use the company's P2P

software. As of Monday, even after publishing results, he had not heard back from
anyone.
Users of IoT devices that make use of the iLnkP2P software scan a barcode or copy a six-
digit number that is included in the product. From there, the owner can access the
device from a smartphone app.
It's through these unique identifier numbers that Marrapese was able to discover that
each device manufacturer used a specific alphabetic prefix to identify their particular
product. For instance, HiChip uses "FFFF" as a prefix for the identification number for its
devices. Once Marrapese was able to identify these devices through the unique number
systems, he created several proof-of-concept attacks that took advantage of the flaws
in the software.
[Source: https://www.databreachtoday.com/2-million-iot-devices-have-p2p-software-
flaw-researcher-a-12428 Accessed July 2020]

a) In this case study, it is mentioned that vulnerable IoT devices can service as nodes
in a botnet. Explain the working mechanism of a Botnet. Discuss any two attacks
carried out by a botnet.

b) Report the importance of security in IoT devices. How does encryption help improve
security for these devices?

c) Discuss the importance of lightweight cryptography in IoT enabled low-power
devices. List the potential lightweight cryptographic algorithms for low-power IoT
devices.

In: Computer Science

7. Using the provided schema of a Purchase Order Administration database, write the following queries in...

7. Using the provided schema of a Purchase Order Administration database, write the following queries in SQL.

(In the schema, bold attributes are primary keys and italicized attributes are foreign keys.)

SUPPLIER (SUPNR, SUPNAME, SUPADDRESS, SUPCITY, SUPSTATUS)

SUPPLIES (SUPNR, PRODNR, PURCHASE_PRICE, DELIV_PERIOD)

PRODUCT (PRODNR, PRODNAME, PRODTYPE, AVAILABLE_QUANTITY)

PO_LINE (PONR, PRODNR, QUANTITY)

PURCHASE_ORDER (PONR, PODATE, SUPNR)

7d) Write a nested SQL query to retrieve the supplier number, supplier name, and supplier status of each supplier who has a higher supplier status than supplier number 21.

7e) Write a nested SQL query using the keyword IN to retrieve the supplier name of each supplier who supplies more than five products.

7f) Write an SQL query that retrieves all pairs of suppliers who supply the same product, along with their product purchase price if applicable.

7g) Create a view, SUPPLIEROVERVIEW, which retrieves for each supplier the supplier number, the supplier name, and the total quantities ordered. Once created, query this view to retrieve suppliers for which the total ordered quantity exceeds 30.

In: Computer Science