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. 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 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 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:
#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 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
In: Computer Science
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. 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 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 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
In: Computer Science
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
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
2) Test Program
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:
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 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 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 type, user population, scope of medicine and health problems, and member interaction style.
In: Computer Science