Questions
For the Exploitation tools, find the usage and the required counter measures to avoid effects of...

For the Exploitation tools, find the usage and the required counter measures to avoid effects of the following tools:

B). Safe tools, FACEBOOK DEMETRICATOR, TWITTER DEMETRICATOR, INSTAGRAM DEMETRICATOR, TEXTBOOK, GO RANDO, AND TRACING YOU, EXPLAIN ALL IN 500 WORDS.

In: Computer Science

JAVA 1. Create an Interface Vehicle. Declare one public void method in it paint( ). 2....

JAVA

1. Create an Interface Vehicle. Declare one public void method in it paint( ).

2. Create a class Car. Implements Vehicle. It's paint() method prints "Car Painted". It's drive( ) method prints "Car Driven".

3. Create a class Bus. Implements Vehicle. It's paint() method prints "Bus Painted" . It's drive( ) method prints "Bus Driven".  

4. Create a method AutoWork which accepts an object of type Vehicle. The method makes a call to the vehicle's paint( ) and drive() methods.

5. In the main method of your Main class, create a reference and object of Car class. Pass it to the AutoWork method.

6. In the main method of your Main class, create a reference and object of Bus class. Pass it to the AutoWork method.

------

7. In the main method of your Main class, create a reference v of Vehicle interface and object of Car class. Pass it to the AutoWork method. (You may have to remove/comment the call to the drive() method in AutoWork)

8. Using the same reference v, create object of Bus. Pass it to the AutoWork method. (Again you may have to remove/comment the call to the drive() method in AutoWork)

In: Computer Science

In C++ Create two functions called TheNumber. One version of TheNumber should accept a string and...

In C++

Create two functions called TheNumber. One version of TheNumber should accept a string and output the accepted string 10 times. The other version of TheNumber should accept a double and output the accepted double 10 times. This uses function overloading.

In: Computer Science

using c++. ALWAYS GRADE MY ANSWERS nstructions Write a program that prompts the user to input...

using c++. ALWAYS GRADE MY ANSWERS

nstructions

Write a program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits.

For example, it should output the individual digits of:

  • 3456 as 3 4 5 6
  • 8030 as 8 0 3 0
  • 2345526 as 2 3 4 5 5 2 6
  • 4000 as 4 0 0 0
  • -2345 as 2 3 4 5

#2

Instructions

Write a program that prompts the user to input a sequence of characters and outputs the number of vowels.
(Use the function isVowel written in Programming Exercise 2.)

Your output should look like the following:

There are # vowels in this sentence.

... where # is the number of vowels.

#3

Instructions

You are given a file consisting of students’ names in the following form: lastName, firstName middleName. (Note that a student may not have a middle name.)

Write a program that converts each name to the following form: firstName middleName lastName. Your program must read each student’s entire name in a variable and must consist of a function that takes as input a string, consists of a student’s name, and returns the string consisting of the altered name. Use the string function find to find the index of ,; the function length to find the length of the string; and the function substr to extract the firstName, middleName, and lastName

here is the file:

Miller, Jason Brian
Blair, Lisa Maria
Gupta, Anil Kumar
Arora, Sumit Sahil
Saleh, Rhonda Beth
Spilner, Brody

In: Computer Science

JAVA Write a class to implement a list with the ability to insert a new item...

JAVA

Write a class to implement a list with the ability to insert a new item at any location within the list, remove an item, and search for an item. The list should use a linked list implementation. This implementation should make use of a dummy node at the head of the list and should have explict references head and previous. Add a method to the list that inserts elements in acsending order assuming the list is already sorted before each insert.

In: Computer Science

JAVA Write a class for a Stack of characters using a linked list implementation. Write a...

  • JAVA
  • Write a class for a Stack of characters using a linked list implementation.
  • Write a class for a Queue of characters using a linked list implementation.
  • Write a class for a Queue of integers using a circular array implementation.

In: Computer Science

A sequential file contains at most four billion 32-bit integers in random order, we need to...

A sequential file contains at most four billion 32-bit integers in random order, we need to find a 32-bit integer that isn’t in the file. Note that certainly we can simply read them all into memory (if we have enough memory) and sort them. That would cost O(n log n) for sorting and O(n) for searching. Think if we do better than that WITHOUT sorting and answer the following questions with better solutions.

(a) Explain why there must be at least one such integer missing?

(b) If you have some memory that is enough to hold one bit for each such integer, i.e., with such bitmap approach, how would you solve the problem?

(c) If you only have a few hundred bytes of main memory but you could use several external files, how would you solve it? (hint: use binary search)

In: Computer Science

Abstraction is a key part of object-oriented programming and the concepts apply particularly well to classes....

Abstraction is a key part of object-oriented programming and the concepts apply particularly well to classes. How would the same concepts apply to data structures and how we tend to define and think of ADTs?

In: Computer Science

Using the Java programming language: Create and implement a class Car that models a car. A...

Using the Java programming language: Create and implement a class Car that models a car. A Car is invented to have a gasoline tank that can hold a constant max of 12.5 gallons, and an odometer that is set to 0 for a new car. All cars have an original fuel economy of 23.4 miles per gallon, but the value is not constant.

Provide methods for constructing an instance of a Car (one should be zero parameter, and the other should take one parameter, namely a value for the fuel efficiency). Additional method simulates the car traveling a given number of miles (at the end of traveling that user-specified distance, the odometer is updated and the gas tank level is reduced by an elementary calculation using the miles driven and fuel efficiency), to fill a given number of gallons to the tank, to get the odometer reading, and to get the gas tank level in gallons. (Test case that makes sure the tank isn’t already at capacity)

In: Computer Science

CS 400 Assignment 2: applying ArrayList In this assignment, you are going to build a program...

CS 400 Assignment 2: applying ArrayList
In this assignment, you are going to build a program that can help rental car companies to manage their rental fleet. 

Requirement:
- build ArrayList class as container.
- build Car class/structure to represent car objects.
- An ArrayList object is to hold Car objects. 

Car class should have following fields: 
- id (int)
- make (string)
- model (string)
- color (string)

Instructions: 
- make up 15 cars and save them into a file: cars.data
- load these cars' info from the file, initialize 15 Car objects, place them into the Arraylist
- if new cars are added by user, they should be appended to the cars.data file when exiting the program
- design a menu based user interface that allows following operations:
-- search by id
-- search by make
-- search by model
-- search by color
-- add a new car (new car id cannot be same as existing ones)
-- delete an existing car by id
-- list all cars
-- exit the program

Grading: 
- compilable and meaningful attemps: 30 points. 
- functionality: 60 points (ArrayList 10p, Car 10p, file io 10p, menu functions 30p)
- comments and indentation: 10 points.

Submission: 
- submit related .h files, .cpp files and cars.data via blackboard. Do not forget to submit cars.data! 


In: Computer Science

Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use...

  1. Use a recursion tree to determine a good asymptotic upper bound on the following recurrences. Use the substitution method to verify your answer.
    1. T(n) = 3T(n/2) + n.
    2. T(n) = T(n/2) + n2.

In: Computer Science

Task You will write a class called Grid, and test it with a couple of programs....

Task

You will write a class called Grid, and test it with a couple of programs. A Grid object will be made up of a grid of positions, numbered with rows and columns. Row and column numbering start at 0, at the top left corner of the grid. A grid object also has a "mover", which can move around to different locations on the grid. Obstacles (which block the mover) and other objects (that can be placed or picked up) are also available. Here is a sample picture of a Grid object in its display format:

0 . . .    This is a Grid object with 4 rows and 4 columns (numbered 0 - 3). 
. . > .    The mover '>' is at row 1, column 2, facing east. 
. . . .    The obstacle '#' is at row 3, column 1 
. # . .    The other item '0' is at row 0, column 0

The @ character indicates that the mover and an item (0) currently occupy the same position on the grid.

Program Details and Requirements

1) Grid class

Download this starter file: grid_starter.h and rename it as grid.h. Your member function prototypes are already given in this file. You will need to add appropriate member data. You will also need to define each of the member functions in the file grid.cpp. You may add whatever member data you need, but you must store the grid itself as a two-dimensional array. Maximum grid size will be 40 rows and 40 columns. (Note that this means dynamic allocation will NOT be needed for this assignment).

Meaning of Grid symbols

.       empty spot on the grid
0       an item that can be placed, or picked up
#       a block (an obstacle).  Mover cannot move through it
<    mover facing WEST
>    mover facing EAST
^       mover facing NORTH
v       mover facing SOUTH
@       mover occupying same place as item (0)

A printed space ' ' in a grid position represents a spot that the mover has already moved through when the path display is toggled on

public Member function descriptions

  • Grid()
    The default constructor should create a 1 x 1 grid, with the mover in the only position, facing EAST
  • Grid(int r, int c)
    The two-parameter constructor will accept two integers, representing rows and columns. Create a grid with r rows and c columns. If either of these is less than 3, default it to 3. If either is greater than the max number of rows or columns, default it to the max number. This grid should be built such that blocks are placed all around the edge, with one random exit (i.e. with no block). The mover should be in a random position and facing a random direction within the grid. When setting up the randomness, make sure each possibility has an equal chance of happening. For example, the random direction has 4 possibilities, so each one should happen about 25% of the time. For the random exit, it will be sufficient to pick a random wall first, then pick a random location on that wall (note that the exit cannot be in a corner spot).

    You'll need the library cstdlib for the srand and rand functions. While it's not normally the best place to do it, you can go ahead and seed the random number generator here in the constructor in some appropriate way so that it's different for seperate program runs.

    If you need a refresher on pseudo-random number generation, see this notes set from COP 3014: http://www.cs.fsu.edu/~myers/c++/notes/rand.html

  • Grid(int r, int c, int mr, int mc, int d)
    This constructor (5 parameters) takes in the following information, in this order:
    • number of starting rows for the grid (if out of range, adjust like in the 2-parameter constructor, although minimum in this case is 1)
    • number of starting columns for the grid (if out of range, adjust like in the 2-parameter constructor, although minimum in this case is 1)
    • The starting row position of the mover (if out of range, adjust to the first or last row, whichever is closer)
    • The starting column position of the mover (if out of range, adjust to the first or last column, whichever is closer)
    • The starting direction of the mover
    Build the starting grid based on the incoming parameters and their descriptions above. Other than the mover, this grid starts out empty.
  • Display()
    This function should print out "The Grid:" on one line, then output the full grid below it -- place spaces between columns so that outputs line up more evenly. End with a newline (so that any next output will be on a separate line). If the path setting is toggled to ON, then any position the mover has already moved through should show up blank. If the path setting is toggled to OFF, then all empty grid spaces show up as dots '.'
    Examples of the full Display format can be seen in the sample run for test1.cpp linked below under "Test Programs".
    For description of the path setting, see the funtion TogglePath() below
  • TogglePath()
    This function, when called, should reverse whatever the current "path" setting is. The path setting can be either ON or OFF. If it's ON, it means that displays of the grid should indicate where the mover has been by showing those positions as spaces. If the path is OFF, then all blank spots on the grid show as the dot character '.' no matter what. The initial default setting for any grid should be ON.
  • Simple Accessors (Getters)
    These are "getter" functions that should return the requested information:
    • GetRow() should return the current row of the mover
    • GetCol() should return the current column of the mover
    • GetNumRows() should return the number of rows in the grid
    • GetNumCols() should return the number of columns in the grid
  • Predicate functions
    These two functions return boolean values (true or false) to answer simple questions:
    • FrontIsClear() should return an indication of whether the space in front of the mover is clear (i.e. not blocked and on the grid)
    • RightIsClear() should return an indication of whether the space to the right of the mover is clear (i.e. not blocked and on the grid)
  • Placing blocks and/or items
    These functions involve placing things on the grid:
    • PutDown(): This function should place an "item" at the current location of the mover. If the location already contains an item, then nothing changes (i.e. the item is still there)
    • PutDown(int r, int c): This function should place an "item" at position (r,c) where r is the row and c is the column. This function should return true for a successful placement, and false for failure. For successful placement, the position has to exist within the grid boundaries and not already contain a block or another item. (It can, however, be placed in a spot where only the mover is located).
    • PlaceBlock(int r, int c): This function should place a "block" at position (r,c) where r is the row and c is the column. This function should return true for a successful placement, and false for failure. For successful placement, the position has to exist within the grid boundaries and be an empty space (i.e. not containing a block, an item, or the mover)
  • PickUp()
    This function should pick up the "item" at the mover's position. This means removing it from the grid. This function should return true for a successful pick-up (i.e. the item is at the mover's current position), and false for failure (there is no item there).
  • Move(int s)
    This function should move the mover forward, in the current direction, for s spaces. Return true for success, false for failure. A successful move must be a positive number of spaces, must remain on the grid, and must not attempt to move through a "block". On a failed move, the mover should remain in the original position. (i.e. the move must be all or nothing, based on the number of spaces given by the parameter).
  • TurnLeft()
    This function will cause the mover to turn 90 degrees to the left, from whichever way it is currently facing. (example: if the mover is facing NORTH, then TurnLeft() will make it face WEST).
  • void Grow(int gr, int gc)
    This function should increase the size of the grid by gr rows and gc columns. If the increase causes either the number of rows or columns to exceed the maximum, simply set that (rows or columns) to the maximum. The grow should not change the current position of any item, mover, or block on the grid.
  • Note that the list of member functions given in the provided starter file (and described above) constitute the entire public interface of the class. These should be the ONLY public member functions in your class. If you create any extra member functions as helpers, put them in the private section of the class

2) Test Program

  1. Trapped!

    Write a main program in a file called trap.cpp that solves the following scenario, using your Grid class:

    Giant Mole People have risen from their underground lairs and are taking over the world. You have been taken prisoner and placed in an underground jail cell. Since the Mole People are blind and don't know how to build doors, your cell has one open exit (no door). Since you are deep underground, it is completely dark and you cannot see. Your task is to escape your prison to join the human resistance!

    Your program should ask the user to input the number of rows, then columns, for the grid. (Note that this is the ONLY keyboard input for this program). Create a grid with the specified number of rows and columns, using the constructor with two parameters -- (this is the one that should automatically create a fenced-in grid containing one exit and a randomly placed mover). Display the initial grid. Since the placement of the exit and the mover is random, execution of this program will look a little different every time. Your task is to escape the trap! You will need to create an algorithm that will instruct the mover to find its way to the exit. (Hint: Think about how to use the Predicate functions before you move). Upon reaching the exit, you should print a message of success, like "We escaped!", and then output the final position of the mover. Keep the path toggled ON. You only need to display the initial setup grid and the final grid for this program.

General Requirements:

  • All class member data (other than the provided static constants) must be private
  • As your only output in the Grid class is the Display function, your output should match mine exactly. (i.e. if I check your output against mine with the "diff" command, there should be no differences in the output of a grid).
  • Adhere to the good programming practices discussed in class. (No global variables, use const in all appropriate places, don't #include .cpp files, document your code. etc).
  • You may use the iostream library, as well as any of the basic C function libraries. You'll probably want to take a look at ctime and cstdlib for setting up random number generation
  • Do not use any C++11 - only features

Submit the following files through the web page in the usual manner:

  grid.h
  grid.cpp
  trap.cpp

// ---------------------------------------

// header file grid.h

// Grid class

class Grid
{
public:
   // public static class constants, for direction indicators
   static const int NORTH = 0;
   static const int WEST = 1;
   static const int SOUTH = 2;
   static const int EAST = 3;

   // public member funcitons

   Grid();                      // build 1 x 1 grid with mover in only
                                //  square, facing east
   Grid(int r, int c);          // build grid with r rows, c cols,
                                //  blocks around edge with random exit
                                //  and random mover position and direction

   Grid(int r, int c, int mr, int mc, int d);
                        // build empty grid with r rows, c cols, and mover
                        //  at row mr, col mc, and facing direction d

   bool Move(int s);            // move forward s spaces, if possible
   void TogglePath();           // toggle whether or not moved path is shown
   void TurnLeft();             // turn the mover to the left
   void PutDown();              // put down an item at the mover's position
   bool PutDown(int r, int c);  // put down an item at (r,c), if possible
   bool PickUp();               // pick up item at current position
   bool PlaceBlock(int r, int c);       // put a block at (r,c), if possible
   void Grow(int gr, int gc);   // grow the grid by gr rows, gc columns


   void Display() const;        // display the grid on screen

   // Accessors
   bool FrontIsClear() const;   // check to see if space in front of 
                                //  mover is clear
   bool RightIsClear() const;   // check to see if space to right of 
                                //  mover is clear
   int GetRow() const;          // return row of the mover
   int GetCol() const;          // return column of the mover
   int GetNumRows() const;      // return number of rows in the grid
   int GetNumCols() const;      // return number of columns in the grid
   
private:

};

In: Computer Science

Artificial Intelligence Question. This topic is about AI representation stochastic methods. I will like it if...

Artificial Intelligence Question. This topic is about AI representation stochastic methods. I will like it if this is good explained and answer

Represent the robot arm problem from earlier sections as a production system. For simplicity use the basic representation that doesn’t care exactly where the blocks are, just if they’re stacked or not. It will only be given four blocks a, b, c, d in some configuration and have to move them until a goal configuration is reached.

In: Computer Science

JAVA CODE BEGINNERS, I already have the demo code included Write a Bottle class. The Bottle...

JAVA CODE BEGINNERS, I already have the demo code included

Write a Bottle class. The Bottle will have one private int that represents the countable value in the Bottle. Please use one of these names: cookies, marbles, M&Ms, pennies, nickels, dimes or pebbles. The class has these 14 methods: read()(please use a while loop to prompt for an acceptable value), set(int), set(Bottle), get(), (returns the value stored in Bottle), add(Bottle), subtract(Bottle), multiply(Bottle), divide(Bottle), add(int), subtract(int), multiply(int), divide(int), equals(Bottle), and toString()(toString() method will be given in class). All add, subtract, multiply and divide methods return a Bottle. This means the demo code b2 = b3.add(b1) brings into the add method a Bottle b1 which is added to b3. Bottle b3 is the this Bottle. The returned bottle is a new bottle containing the sum of b1 and b3. The value of b3 (the this bottle) is not changed. Your Bottle class must guarantee bottles always have a positive value and never exceed a maximum number chosen by you. These numbers are declared as constants of the class. Use the names MIN and MAX. The read() method should guarantee a value that does not violate the MIN or MAX value. Use a while loop in the read method to prompt for a new value if necessary. Each method with a parameter must be examined to determine if the upper or lower bound could be violated. In the case of the add method with a Bottle parameter your code must test for violating the maximum value. It is impossible for this add method to violate the minimum value of zero. The method subtract with a Bottle parameter must test for a violation of the minimum zero value but should not test for exceeding the maximum value. In the case of a parameter that is an integer, all methods must be examined to guarantee a value that does not violate the MIN or MAX values. Consider each method carefully and test only the conditions that could be violated.

import java.util.Scanner;
// test driver for the Bottle class
                public class BottleDemo3
{
        public static void main(String[] args)
        {
                Scanner scan = new Scanner(System.in);
                int x;
                Bottle bottle1 = new Bottle();
                Bottle bottle2 = new Bottle();
                Bottle bottle3 = new Bottle();
                Bottle bottle4 = new Bottle();
                Bottle bottle5 = new Bottle();
                System.out.println("please enter a number for bottle1:");
                bottle1.read();
                System.out.println("Bottle1 is this value " + bottle1 + ".");
                System.out.println("Please enter a number for bottle2:");
                bottle2.read();
                bottle3 = bottle2.add(bottle1);
                System.out.println("The sum of bottle2 and bottle1 is: " + bottle3 + ".");
                bottle4 = bottle3.divide(2);
                System.out.println("The 2 bottle average is: " + bottle4 + ".");
                System.out.print("Subtracting bottle1 from bottle2 is: " );
                bottle3 = bottle2.subtract(bottle1);
                System.out.println( bottle3);
                bottle3 = bottle2.divide(bottle1);
                System.out.println("Dividing bottle2 with bottle1 is: " + bottle3 + ".");
                if (bottle1.equals(bottle2))
                {
                        System.out.println("Bottle1 and bottle2 are equal.");
                }
                else
                {
                        System.out.println("Bottle1 and bottle2 are not equal.");
                }
                System.out.println("Bottle4 is now given the value of 10 with the set() method.");
                bottle4.set(10);
                System.out.println("The value of bottle4 is " + bottle4 + ".");
                System.out.println("Bottle4 is now multipled with bottle1.  The value is placed in " +
                                "bottle5.");
                bottle5 = bottle1.multiply(bottle4);
                System.out.println("The value of bottle5 is " + bottle5 + ".");
                System.out.println("Enter an integer to add to the value bottle1 has.");
                System.out.println("The sum will be put in bottle3.");
                x = scan.nextInt();
                bottle3 = bottle1.add(x);
                System.out.println("Adding your number " + x +
                        " to bottle1 gives a new Bottle with " + bottle3 + " in it.");
                System.out.print("Adding the number " + bottle2 + " which is the number" +
                                " in bottle2 to the\nnumber in ");
                bottle2 = bottle1.add(bottle2);
                System.out.println("bottle1 which is " + bottle1 +" gives " + bottle2 + ".");
                bottle2.set(bottle2.get());
        }
}

In: Computer Science

briefly describe the characteristics of Sermo and Doximity as social media platforms with respect to; platform...

briefly describe the characteristics of Sermo and Doximity as social media platforms with respect to; platform type, user population, scope of medicine and health problems, and member interaction style.

In: Computer Science