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 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 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 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 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. 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 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 * e + f)
In: Computer Science
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:
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
IP Mask Gateway
S1 192.168.1.1 255.255.255.192 192.168.1.62
PC2 192.168.2.1 255.255.255.192 192.168.2.62
PC1 192.168.3.1 255.255.255.192 192.168.3.62
In: Computer Science
Hi had a question I am trying to develop this iOS app in Xcode in Swift language and getting hung up on this Rock Paper Scissors game on the bottom is my code when it comes to paper and rock rock wins when it comes to rock and scissors scissors wins other than that it works ok . please help thanks !
import UIKit
class ViewController: UIViewController {
@IBOutlet weak var leftblankview: UIImageView!
@IBOutlet weak var rightblankview: UIImageView!
@IBOutlet weak var leftscorelabel: UILabel!
@IBOutlet weak var rightscorelabel: UILabel!
var leftScore = 0
var rightScore = 0
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
@IBAction func buttonclick(_ sender: Any) {
let leftNumber = Int.random(in: 1...3)
let rightNumber = Int.random(in: 1...3)
leftblankview.image = UIImage(named: "symbol\(leftNumber)")
rightblankview.image = UIImage(named: "symbol\(rightNumber)")
if leftNumber > rightNumber {
leftScore += 1
leftscorelabel.text = String(leftScore)
}
else if leftNumber < rightNumber{
rightScore += 1
rightscorelabel.text = String(rightScore)
}
else{
}
}
}
In: Computer Science
language is Java
Design a super class Person with the fields for holding a person's name, address, and phone number. Code at least two overloaded constructors and the appropriate mutator and accessor methods. Next, design a subclass Customer that inherits from the Person class. In addition to inherit all data and methods from its super class, the Customer class should have a field for a customer ID and a boolean field indicating whether or not the customer whishes to be on a mailing list. Code appropriate constructors, mutator and accessor methods for added fields in Customer class.
Then code a driver class InheritanceApp to test the classes by creating at least one object for Person class and at least one object for Customer class to display all field information using overridden toString(), respectively. You my do hard- coded data in test.
Must code Person and Customer classes as your operation classes with the inheritance relationship and then InheritanceApp as the driver. Run and test your code to meet the requirements.
Must understand the purpose of using inheritance in coding and how well you perform the code-reuseability.
Must create at least one object for each class (Person and Customer).
Must use required/meaningful names for fields, methods and doc each of your source codes.
In: Computer Science
In: Computer Science
List and explain five EIGRP commands that can be used at the command line to support EIGRP on a router. Include any relevant parameters of the command that can benefit the network engineer supporting the router
In: Computer Science
Create an Interface DiscountPolicy. It should have a single abstract method computeDiscount that will return the discount for the purchase of a given number of a single item. The method has two parameters, count (int type) and itemCost (double type). Create a class BulkDiscount that implements Interface DiscountPolicy. The BulkDiscount class has two proprieties: theMinimum (int type), and percent (double type). It should have a constructor that sets the parameters, minimum and percent to a given values. It should define the method computeDiscount so that if the quantity (count) purchased of an item is more than minimum, the discount is calculated as count*itemCost*percentOff/100.0, otherwise, discount will be equal=0.0; Write a test program that tests your method. Create at least three objects of BulkDiscount class and print out their discount values. (JAVA)
In: Computer Science