Questions
1.What will the result of this form be? (cadr ‘(1 2 3 4 5 6)) a....

1.What will the result of this form be? (cadr ‘(1 2 3 4 5 6))

a. '(1 2 3 4 5 6)

b. 2

c. '(2 3 4 5 6)

d. 1

.

2.How does Prolog try to resolve our Queries?

a.The programmer specifies the algorithmic approach, performance is all in the hands of how clever the programmer writes their algorithms.

b.The language applies some AI to our query and precludes obviously false information.

c.Row by agonizing row. There is nothing particularly clever about the solve, it just brute forces its way through the data looking for resolutions.

In: Computer Science

In C++ Write an IterativeMergeSort function given these parameters and following the prompt IterativeMergeSort(vector<int> v, int...

In C++

Write an IterativeMergeSort function given these parameters and following the prompt

IterativeMergeSort(vector<int> v, int low, int high)

IterativeMergeSort

In-place sorting refers to sorting that does not require extra memory arrays. For

example, QuickSort performs partitioning operations by repeating a swapping operation on two

data items in a given array. This does not require an extra array.

We can improve the performance of MergeSort by utilizing a non-recursive method and

using only one additional array (instead of one array on each recursive call). In this improved

version of MergeSort,

IterativeMergeSort

, one would merge data from the original array into

the additional array and

alternatively

copy back and forth between the original and the

additional temporary array.

Please re-read the last sentence as it is critical to the grading of

the lab.

For the IterativeMergeSort we still need to allow data items to be copied between the

original and this additional array as many times as O(

log

n). However, given the iterative nature

we are not building up state on the stack.

In: Computer Science

1. How did IBM become the dominant IT industry leader? 2. What changed that knocked IBM...

1. How did IBM become the dominant IT industry leader?

2. What changed that knocked IBM off its industry leader position?

3. What did the new outside CEO Lou Gerstner do that saved IBM?

In: Computer Science

Rental Shop A. Create an abstract class named SummerSportRental that is to be used with for...

Rental Shop
A. Create an abstract class named SummerSportRental that is to be used with for a summer sports rental
shop. The SummerSportRental class must have the properties of newModel which takes on the type
boolean, and rentalCost which takes on the type double, and rentalNumber which is an identification
number as an long integer.These member variables must all be private!
It also must include the following member functions:
1. equals() which returns true if two SummerSportRental objects have the same rentalNumber.
2. all of the appropriate get/set methods for each of the above member variables. Make sure to have
data validation done on the set methods to prevent invalid/illegal values from being passed into the
member variables. (Example: rentalCost should not be allowed to be negative).
3. include an abstract method named lateCharge, that will only be implemented in child classes that
inherit the SummerSportRental class.
B. Create three children classes that inherit the SummerSportRental class, named WaterSkiRental,
PaddleboardRental, and BeachCruiserBikeRental.
The WaterSkiRental class should have one private member variable named size as an integer that will be
used to store the size of the water ski in centimeters. Implement the get/set method for this member
variable. The abstract method in the SummerSportRental class, named lateCharge must be implemented to
charge a late charge of 10% of the rental cost. Be sure to include a method named toString to output the
data stored in the member variables for this class. No main method in the class allowed!
The PaddleboardRental class should have two private member variable named size as an integer that will
be used to store the size of the paddle board in centimeters, and another member variable named style as
an enumerated type with the values (SINGLE, DOUBLE to denote if the paddle board is a single person
board or a two person board). Implement the get/set methods for these member variables. The abstract
method in the SummerSportRental class, named lateCharge must be implemented to charge a late charge
of 20% of the rental cost. Be sure to include a method named toString to output the data stored in the
member variables for this class. No main method in the class allowed!
The BeachCruiserBikeRental class should have two private member variable named wheel_szie as an
integer that will be used for storing the wheel size in centimeters of the beach cruiser bike, and another
member variable named capacity as an enumerated type with the values (SINGLE, DOUBLE, TRIPLE
[which has a very stylin' side cart to it]) that stores the seating capacity of the beach cruiser bike. Implement
the get/set methods for these member variables. The abstract method in the SnowSportRental class, named
lateCharge must be implemented to charge a late charge of (20+capacity*5)% (late charge for single=25%,
double=30%, triple=35%) of the rental cost. Be sure to include a method named toString to output the data
stored in the member variables for this class. No main method in the class allowed!
C. Create separate test class source files with their respective main methods to test each implemented
method in the WaterSkiRental, PaddleboardRental, and BeachCruiserBikeRental classes. The list below is
the minimums for the test cases for each of the child classes:
WaterSkiRental:
1. equals() method
2. newModel ( test get and set )
3. rentalCost ( test get and set )
4. rentalNumber ( test get and set )
5. size ( test get and set )
6. lateCharge - make sure it adheres to the specifications above.
7. toString ( test toString method )
A total of 11 tests for WaterSkiRental class ( tests 1-4 are actually for the SummerSportRental class, and will
not need to be repeated for PaddleboardRental and BeachCruiserBikeRental class test )
PaddleboardRental:
1. size ( test get and set )
2. style ( test get and set )
3. lateCharge - make sure it adheres to the specifications above.
4. toString ( test toString method )
A total of four tests for PaddleboardRental class
BeachCruiserBikeRental:
1. wheel_size ( test get and set )
2. capacity ( test get and set )
3. lateCharge - make sure it adheres to the specifications above.
4. toString ( test toString method )
A total of four tests for BeachCruiserBikeRental class
You are to submit:
Zipfile of your Final Project with the following name format: LastName_FirstName_Final.zip
Programmer Documentation File
Note: make sure to thoroughly read through all of the requirements for this project. Specifications will be
very strictly enforced.

How do I do this in JAVA?

In: Computer Science

Discuss, in your own words using 500 words or more, how virtualization may create it's own...


Discuss, in your own words using 500 words or more, how virtualization may create it's own security vulnerabilities.

In: Computer Science

Q2) Answer with details : a - What are the four requirements engineering activities? b- What...

Q2) Answer with details :

a - What are the four requirements engineering activities?

b- What are the incremental delivery advantages?

In: Computer Science

Using SQL 1. Create a table (Passenger) based on the specifications below: Field Name Type/Length PassID...

Using SQL

1. Create a table (Passenger) based on the specifications below: Field Name Type/Length

PassID text 5 fixed (Primary Key)

PassLName text 25 variable

PassFName text 20 variable

PassAge numeric Maint_DT date

2. Add the 5 records below using the INSERT command. For the Maint_DT attribute use the following Access function “Date()”.

PassID PassLName PassFName PassAge

00001 Morris Lucy 50

00002 Smith Trudy 61

00003 Collins Harry 32

00004 Dean Mark 27

00005 Hunter Alan 12

3. Select all passengers sorted from oldest to youngest.

4. Select PassID, PassLName, and Maint_DT for all records.

In: Computer Science

Create an application named ShirtDemo that declares several Shirt objects and includes a display method to...

Create an application named ShirtDemo that declares several Shirt objects and includes a display method to which you can pass different numbers of Shirt objects in successive method calls.

The Shirt class contains auto-implemented properties for a Material, Color, and Size (all of type string).

Here is my code:

//Program.cs

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ShirtApplication

{

    class Program

    {

        static void Main(string[] args)

        {


            //Create an instance of Shirt

            Shirt shirt = new Shirt("cotton", "white", "L");

            //print heading

            Console.WriteLine("{0,-12}{1,10}{2,10}", "Material", "Color","Size");

            //call display method

            display(shirt);

            //Create an instance of Shirt

            shirt = new Shirt("cotton", "blue", "XL");

            //call display method

            display(shirt);

            //Create an instance of Shirt

            shirt = new Shirt("polyester", "pink", "M");

            //call display method

            display(shirt);

            Console.WriteLine();

            Console.WriteLine("{0,-12}{1,10}{2,10}", "Material", "Color", "Size");

            //Create an instance of Shirt

            shirt = new Shirt("cotton", "white", "L");

            //call display method

            display(shirt);

            //Create an instance of Shirt

            shirt = new Shirt("cotton", "blue", "XL");

            //call display method

            display(shirt);

            //Create an instance of Shirt

            shirt = new Shirt("polyester", "pink", "M");

            //call display method

            display(shirt);

            //Create an instance of Shirt

            shirt = new Shirt("silk", "yellow", "S");

            //call display method

            display(shirt);

            Console.WriteLine();

            Console.WriteLine("{0,-12}{1,10}{2,10}", "Material", "Color", "Size");

            //Create an instance of Shirt

            shirt = new Shirt("cotton", "white", "L");

            //call display method

            display(shirt);

            //Create an instance of Shirt

            shirt = new Shirt("cotton", "blue", "XL");

            //call display method

            display(shirt);

            shirt = new Shirt("polyester", "pink", "M");

            //call display method

            display(shirt);

            //Create an instance of Shirt

            shirt = new Shirt("silk", "yellow", "S");

            display(shirt);

            shirt = new Shirt("silk", "white", "XXL");

            //call display method

            display(shirt);

            Console.ReadKey();

        }


        //The metod display that takes Shirt object and prints the properties of shirt object

        //to console

        public static void display(Shirt shirt)

        {

            Console.WriteLine("{0,12}{1,10}{2,10}", shirt.Material, shirt.Color, shirt.Size);

        }

    }

}

here is the error message:

Unable to instantiate shirt objects with the correct properties.

Checks

Unit TestIncomplete

Shirt class is defined and can be instantiated

Build Status

Build Failed

Build Output

Compilation failed: 1 error(s), 0 warnings

ShirtDemo.cs(77,36): error CS0246: The type or namespace name `Shirt' could not be found. Are you missing an assembly reference?

Test Contents

[TestFixture]
public class ShirtClassTest
{
  [Test]
  public void Shirt()
  {
    Shirt shirt1 = new Shirt();
    shirt1.Material = "cotton";
    shirt1.Color = "Green";
    shirt1.Size = "Large";

    Shirt shirt2 = new Shirt();
    shirt2.Material = "polyester";
    shirt2.Color = "red";
    shirt2.Size = "small";

    Assert.AreEqual("cotton", shirt1.Material);
    Assert.AreEqual("Green", shirt1.Color);
    Assert.AreEqual("Large", shirt1.Size);
    Assert.AreEqual("polyester", shirt2.Material);
    Assert.AreEqual("red", shirt2.Color);
    Assert.AreEqual("small", shirt2.Size);
  }
}

Unit TestIncomplete

Get and set the Material property of the Shirt object, test 1

Build Status

Build Failed

Build Output

Compilation failed: 1 error(s), 0 warnings

ShirtDemo.cs(77,36): error CS0246: The type or namespace name `Shirt' could not be found. Are you missing an assembly reference?

Test Contents

[TestFixture]
public class ShirtClassTest
{
  [Test]
  public void Shirt()
  {
    Shirt shirt1 = new Shirt();
    shirt1.Material = "cotton";

    Shirt shirt2 = new Shirt();
    shirt2.Material = "polyester";

    Assert.AreEqual("cotton", shirt1.Material, "Unable to set or get the `Material` property of the class `Shirt`");
    Assert.AreEqual("polyester", shirt2.Material, "Unable to set or get the `Material` property of the class `Shirt`");

  }
}

Unit TestIncomplete

Get and set the Color property of the Shirt class, test 2

Build Status

Build Failed

Build Output

Compilation failed: 1 error(s), 0 warnings

ShirtDemo.cs(77,36): error CS0246: The type or namespace name `Shirt' could not be found. Are you missing an assembly reference?

Test Contents

[TestFixture]
public class ShirtClassTest
{
  [Test]
  public void Shirt()
  {
    Shirt shirt1 = new Shirt();
    shirt1.Color = "Green";

    Shirt shirt2 = new Shirt();
    shirt2.Color = "red";

    Assert.AreEqual("Green", shirt1.Color, "Unable to set or get the `Color` property of the class `Shirt`");
    Assert.AreEqual("red", shirt2.Color, "Unable to set or get the `Color` property of the class `Shirt`");

  }
}

Unit TestIncomplete

Get and set the Size property of the Shirt class, test 3

Build Status

Build Failed

Build Output

Compilation failed: 1 error(s), 0 warnings

ShirtDemo.cs(77,36): error CS0246: The type or namespace name `Shirt' could not be found. Are you missing an assembly reference?

Test Contents

[TestFixture]
public class ShirtClassTest
{
  [Test]
  public void Shirt()
  {
    Shirt shirt1 = new Shirt();
    shirt1.Size = "Large";

    Shirt shirt2 = new Shirt();
    shirt2.Size = "small";


    Assert.AreEqual("Large", shirt1.Size, "Unable to set or get the `Size` property of the class `Shirt`");
    Assert.AreEqual("small", shirt2.Size, "Unable to set or get the `Size` property of the class `Shirt`");
  }
}

0.00 out of 10.00

Display method defined

2

0 out of 2 checks passed. Review the results below for more details.

Checks

Unit TestIncomplete

Display method displays all shirt properties, test 1

Build Status

Build Failed

Build Output

Compilation failed: 2 error(s), 0 warnings

NtTest2202f400.cs(6,14): error CS0246: The type or namespace name `ShirtDemo' could not be found. Are you missing an assembly reference?
ShirtDemo.cs(77,36): error CS0246: The type or namespace name `Shirt' could not be found. Are you missing an assembly reference?

Test Contents

[TestFixture]
public class ShirtClassDisplayTest
{
  [Test]
  public void ShirtTest1()
  {
    using (StringWriter sw = new StringWriter())
    {
      Console.SetOut(sw);

      Shirt shirt1, shirt2, shirt3;
      shirt1 = new Shirt();
      shirt2 = new Shirt();
      shirt3 = new Shirt();

      shirt1.Material = "cotton";
      shirt1.Color = "white";
      shirt1.Size = "L";
      shirt2.Material = "cotton";
      shirt2.Color = "blue";
      shirt2.Size = "XL";
      shirt3.Material = "polyester";
      shirt3.Color = "pink";
      shirt3.Size = "M";

      Display(shirt1, shirt2, shirt3);

      StringAssert.Contains("cotton", sw.ToString());
      StringAssert.Contains("white", sw.ToString());
      StringAssert.Contains("L", sw.ToString());
      StringAssert.Contains("blue", sw.ToString());
      StringAssert.Contains("XL", sw.ToString());
      StringAssert.Contains("polyester", sw.ToString());
      StringAssert.Contains("pink", sw.ToString());
      StringAssert.Contains("M", sw.ToString());

      Assert.IsFalse(sw.ToString().Contains("silk"), "Output should not contain `silk`");
      Assert.IsFalse(sw.ToString().Contains("yellow"), "Output should not contain `yellow`");
    }
  }
}

Unit TestIncomplete

Display method displays all shirt properties, test 2

Build Status

Build Failed

Build Output

Compilation failed: 2 error(s), 0 warnings

NtTestfc79b0ec.cs(6,14): error CS0246: The type or namespace name `ShirtDemo' could not be found. Are you missing an assembly reference?
ShirtDemo.cs(77,36): error CS0246: The type or namespace name `Shirt' could not be found. Are you missing an assembly reference?

Test Contents

[TestFixture]
public class ShirtClassDisplayTest
{
  [Test]
  public void ShirtTest2()
  {
    using (StringWriter sw = new StringWriter())
    {
      Console.SetOut(sw);

      Shirt shirt1, shirt2, shirt3, shirt4;
      shirt1 = new Shirt();
      shirt2 = new Shirt();
      shirt3 = new Shirt();
      shirt4 = new Shirt();

      shirt1.Material = "cotton";
      shirt1.Color = "white";
      shirt1.Size = "L";
      shirt2.Material = "cotton";
      shirt2.Color = "blue";
      shirt2.Size = "XL";
      shirt3.Material = "polyester";
      shirt3.Color = "pink";
      shirt3.Size = "M";
      shirt4.Material = "silk";
      shirt4.Color = "yellow";
      shirt4.Size = "S";

      Display(shirt1, shirt2, shirt3, shirt4);

      StringAssert.Contains("cotton", sw.ToString());
      StringAssert.Contains("white", sw.ToString());
      StringAssert.Contains("L", sw.ToString());
      StringAssert.Contains("blue", sw.ToString());
      StringAssert.Contains("XL", sw.ToString());
      StringAssert.Contains("polyester", sw.ToString());
      StringAssert.Contains("pink", sw.ToString());
      StringAssert.Contains("M", sw.ToString());
      StringAssert.Contains("silk", sw.ToString());
      StringAssert.Contains("yellow", sw.ToString());
      StringAssert.Contains("S", sw.ToString());
    }
  }
}

In: Computer Science

Suppose you are the hiring manager looking to hire a new system forensics specialist. Specify at...

Suppose you are the hiring manager looking to hire a new system forensics specialist. Specify at least five credentials you would expect an ample candidate to possess. Determine which of these credentials you believe to be the most important and provide a reason for your decision.

In: Computer Science

Prove Turing-Decidability of the following languages. L = { < M > | TM M accepts...

Prove Turing-Decidability of the following languages.

L = { < M > | TM M accepts at least one string in no more than 9 step}

Hint: What is the maximum number of tape squares can a TM scan in no more than 9 steps?

In: Computer Science

This is a java assignment inspired by Caesar algorithm with some minor modifications. You are required...

This is a java assignment inspired by Caesar algorithm with some minor modifications. You are required to take in three inputs; a string, which is the message that you want to encrypt, an integer number that we call it salt, which is going to salt your plain message to help create a better encrypted message and an int to be used for displacement of the letters.

Your algorithm is going to encode the message letter by letter. If the position of the letter in your message is odd, then it should add the value of this letter to the displacement value plus salt. If the letter is in even position, then it should be added to the displacement subtracted from salt. For example, assume displacement = 3 and salt = 5, then letter ‘A’ will be replaced by ‘I’, if it is in odd position and by ‘C’ if it is in even position.

The message that you read can contain any character that is typeable (i.e. you can see the typable characters on your keyboard). Your program finally should output the encrypted message.

Sample input and corresponding output:

Input:

Let's meet somewhere cool. How about Tuesday at 9:30 in Chemistry 0400?

5

3

Output:

           Jmr/q(kmc|_{muc•fmpm_kmwj6_Pm•_i`ws|_\smql_?_ir(7B18_ql(Apcu
     g{rzw(.<.8=

JAVA JAVA

In: Computer Science

1. What is the function of risk assessment? How is it conducted for information systems?. 2....

1. What is the function of risk assessment? How is it conducted for information systems?.

2. Why are computer systems so vulnerable? Describe the most common threats against contemporary information systems.

In: Computer Science

There are two sorted arrays nums1 and nums2 both of size n. Find the median of...

There are two sorted arrays nums1 and nums2 both of size n. Find the median of the two sorted arrays. The overall run time complexity should be O(log(n)).

In: Computer Science

Illustrate step-by-step the stack algorithm to convert this to postfix. a + b * (d *...

Illustrate step-by-step the stack algorithm to convert this to postfix.
a + b * (d * e + f)

In: Computer Science

Build a class called “Animal” which has three attributes: “ArrayList<String> diet”, “int numOfLegs”, and “Boolean carnivore”....

Build a class called “Animal” which has three attributes: “ArrayList<String> diet”, “int numOfLegs”, and “Boolean carnivore”. Build a constructor with three parameters to set the three attributes. In the constructor, if the number of legs given in the parameter is below 0 set the number of legs equal to 0. Add seven methods:

  • “void addToDiet(String item)” which will add a single item to the animals diet
  • “void addToDiet(ArrayList<String> items)” which will add all items given to the animals diet
  • “void setDiet(ArrayList<String> newDiet)” which will set the animals diet to be the new diet
  • “ArrayList<String> getDiet()” returns the animals diet
  • “Boolean isCarnivore()” returns if the animal is a carnivore or not
  • “int getNumOfLegs()” returns the animal’s number of legs
  • “String makeSound()” returns the string “Any Sound”

Now that we have a base class, we’re going to make a subclass of our “Animal” class. Make a class called “Cat” that is a subclass of “Animal”. In “Cat” add a new attribute “String color”. Build a constructor with two parameters, an arrayList<String> diet and String color, in the new constructor call the superClass’s constructor and assume the number of legs of all cats is 4 and every cat is a carnivore. Add a method “String getColor()” that returns the cat’s color. Replace (override) the original “makeSound()” method with a new “makeSound()” function that returns the string “Meow”.

In: Computer Science