Questions
Assignment; For this component, you will write a report or critique on the paper you chose...

Assignment; For this component, you will write a report or critique on the paper you chose from Assignment 1. Your report should be limited to approx. 1500 words (not including references).

Use 1.5 spacing with a 12 point Times New Roman font. Though your paper will largely be based on the chosen article, you should use other sources to support your discussion or the chosen papers premises.

Citation of sources is mandatory and must be in the IEEE style.

TOPIC: Social Engineering and phishing attacks

Your report or critique must include: Introduction: Identification of the paper you are critiquing/ reviewing, a statement of the purpose for your report and a brief outline of how you will discuss the selected article (one or two paragraphs).

Body of Report: Describe the intention and content of the article. If it is a research report, discuss the research method (survey, case study, observation, experiment, or other method) and findings. Comment on problems or issues highlighted by the authors. Report on results discussed and discuss the conclusions of the article and how they are relevant to the topics of this Unit of Study.

3 Conclusion: A summary of the points you have made in the body of the paper. The conclusion should not introduce any ‘new’ material that was not discussed in the body of the paper. (One or two paragraphs) References: A list of sources used in your text. They should be listed alphabetically by (first) author’s family name. Follow the IEEE style.

In: Computer Science

I created a shoppingcart program but I'm getting a few compilation failed errors: 1) Tests that...

I created a shoppingcart program but I'm getting a few compilation failed errors:

1) Tests that ItemToPurchase("Bottled Water", "Deer Park, 12 oz.", 1, 10) correctly initializes item compilation failed

2) Tests default constructor and accessors for ShoppingCart Compilation failed

3)Tests ShoppingCart("John Doe", "February 1, 2016") correctly initializes cart Compilation failed

4) Tests that getNumItemsInCart() returns 6 (ShoppingCart) compilation failed

5) Test that getCostOfCart() returns 9 (ShoppingCart) compilation failed

Complete program:

itemtopurchase.java

public class ItemToPurchase {
// instance variables
private String itemName;
private String itemDescription;
private int itemPrice;
private int itemQuantity;
// default constructor
public ItemToPurchase() {
this.itemName = "none";
this.itemDescription = "none";
this.itemPrice = 0;
this.itemQuantity = 0;
}
public ItemToPurchase(String itemName, int itemPrice, int itemQuantity,String itemDescription) {
this.itemName = itemName;
this.itemDescription = itemDescription;
this.itemPrice = itemPrice;
this.itemQuantity = itemQuantity;
}
// method to set name of the item
public void setName(String name) {
itemName = name;
}
// method to set price of the item
public void setPrice(int price) {
itemPrice = price;
}
// method to set quantity of the item
public void setQuantity(int quantity) {
itemQuantity = quantity;
}
public void setDescription(String description) {
itemDescription = description;
}
// method to get name of the item
public String getName() {
return itemName;
}
// method to get price of the item
public int getPrice() {
return itemPrice;
}
// method to get quantity of the item
public int getQuantity() {
return itemQuantity;
}
public String getDescription() {
return itemDescription;
}
public void printItemPurchase() {
System.out.println(itemName + " " + itemQuantity + " @ $" + itemPrice + " = $" + (itemPrice * itemQuantity));
}
public void printItemDescription() {

System.out.println(itemName+": "+itemDescription);
}
}

shoppingcart.java

import java.util.ArrayList;

public class ShoppingCart {

//instance variables
private String customerName;
private String currentDate;
private ArrayList<ItemToPurchase> cartItems = new ArrayList<ItemToPurchase>();

//Default constructor
public ShoppingCart() {
customerName = "";
currentDate = "";
}

//parameterized constructor
public ShoppingCart(String customerName, String currentDate) {
this.customerName = customerName;
this.currentDate = currentDate;
}

//getter methods
public String getCustomerName() {
return customerName;
}

public String getCurrentDate() {
return currentDate;
}

//add items
public void addItem(ItemToPurchase item) {
cartItems.add(item);
}

//remove item
public void removeItem(String name) {
for (ItemToPurchase i : cartItems) {
if (i.getName().equalsIgnoreCase(name)) {
cartItems.remove(i);
return;
}
}

System.out.println("Item not found in cart");
}

//modify the item
public void modifyItem(ItemToPurchase item) {
for (int i = 0; i < cartItems.size(); i++) {
if (cartItems.get(i).getName().equalsIgnoreCase(item.getName())) {
if (!item.getDescription().equals("none") && !(item.getPrice() == 0) && !(item.getQuantity() == 0)) {
cartItems.add(i, item);
return;
}
}
}

System.out.println("Item not found in cart. Nothing modified");

}

//get total number of items in the cart
public int getNumItemsIncart() {
int sum = 0;
for (ItemToPurchase i : cartItems) {
sum += i.getQuantity();
}
return sum;
}

//get total cost of items in the cart
public int getCostOfcart() {
int sum = 0;
for (ItemToPurchase i : cartItems) {
sum += i.getPrice();
}
return sum;
}

//printing total of each items
public void printTotal() {
System.out.println(customerName + "'s Shopping Cart - " + currentDate);
if (cartItems.isEmpty()) {
System.out.println("Shopping Cart is Empty");
return;
}

System.out.println("Number of Items: " + cartItems.size());
System.out.println();
for (ItemToPurchase i : cartItems) {
i.printItemPurchase();
}
System.out.println();
System.out.println("Total: $" + getCostOfcart());
}

//printing description of all items
public void printDescription() {
System.out.println(customerName + "'s Shopping Cart - " + currentDate);
System.out.println();
if (cartItems.isEmpty()) {
System.out.println("Shopping Cart is Empty");
return;
}
System.out.println("Item Descriptions: ");
for (ItemToPurchase i : cartItems) {
i.printItemDescription();
}
}
}

shoppingcartmanager.java

import java.util.Scanner;

public class ShoppingCartManager {

// method to add an item in the cart
public static void addCartItem(Scanner scan, ShoppingCart cart) {
String itemName, itemDescription;
int itemPrice, itemQuantity;
System.out.println("ADD ITEM TO CART");
System.out.print("Enter the item name : ");
itemName = scan.nextLine();
System.out.print("Enter the item description : ");
itemDescription = scan.nextLine();
System.out.print("Enter the item price : ");
itemPrice = scan.nextInt();
System.out.print("Enter the item quantity : ");
itemQuantity = scan.nextInt();
scan.nextLine();

cart.addItem(new ItemToPurchase(itemName, itemPrice, itemQuantity, itemDescription));

}

// method to remove an item from the cart
public static void removeCartItem(Scanner scan, ShoppingCart cart) {
String itemName;
System.out.println("REMOVE ITEM FROM CART");
System.out.print("Enter the name of item to remove : ");
itemName = scan.nextLine();

cart.removeItem(itemName);
}

// method to change quantity of the cart
public static void changeItemQuantity(Scanner scan, ShoppingCart cart) {
String itemName;
int itemQuantity;
System.out.println("CHANGE ITEM QUANTITY");
System.out.print("Enter the item name : ");
itemName = scan.nextLine();
System.out.print("Enter the new quantity : ");
itemQuantity = scan.nextInt();
scan.nextLine();
cart.modifyItem(new ItemToPurchase(itemName, 0, itemQuantity, "none"));
}

// method to display menu choices and perform the operations on the cart until
// the user quits
public static void printMenu(ShoppingCart cart) {
String choice;
Scanner scan = new Scanner(System.in);
do {
System.out.println("\nMENU");
System.out.println("a - Add item to cart");
System.out.println("d - Remove item from cart");
System.out.println("c - Change item quantity");
System.out.println("i - Output items' description");
System.out.println("o - Output shopping cart");
System.out.println("q - Quit");
System.out.print("\nChoose an option : ");
choice = scan.nextLine();

if (choice.equalsIgnoreCase("a")) {
addCartItem(scan, cart);
} else if (choice.equalsIgnoreCase("d")) {
removeCartItem(scan, cart);
} else if (choice.equalsIgnoreCase("c")) {
changeItemQuantity(scan, cart);
} else if (choice.equalsIgnoreCase("o")) {
System.out.println("OUTPUT SHOPPING CART");
cart.printTotal();
} else if (choice.equalsIgnoreCase("i")) {
System.out.println("OUTPUT ITEMS' DESCRIPTION");
cart.printDescription();
} else if (!choice.equalsIgnoreCase("q"))
System.out.println("Invalid choice");

} while (!choice.equalsIgnoreCase("q"));

}

public static void main(String args[]) {
Scanner sc = new Scanner(System.in);

// taking user input
System.out.println("Enter Customer's Name:");
String name = sc.nextLine();
System.out.println("Enter Today's Date:");
String date = sc.nextLine();

// printing user input
System.out.println();
System.out.println("Customer Name: " + name);
System.out.println("Today's Date: " + date);

ShoppingCart cart = new ShoppingCart(name, date);// created shopping cart object
printMenu(cart);
}
}

In: Computer Science

Can you please rewrite this Java code so it can be better understood. import java.util.HashMap; import...

Can you please rewrite this Java code so it can be better understood.

import java.util.HashMap;
import java.util.Scanner;
import java.util.Map.Entry;

public class Shopping_cart {
  
   static Scanner s= new Scanner (System.in);
  
//   declare hashmap in which key is dates as per mentioned and Values class as value which consists all the record of cases
   static HashMap<String,Item> map= new HashMap<>();

   public static void main(String[] args) {
       // TODO Auto-generated method stub
       getupdates();
   }
  
   static void getupdates() {
      
       System.out.println("Welcome to Shopping Cart. Enter:");
       System.out.println("1 : Add an Item ");
       System.out.println("2 : Add multiples Quantities of Given Item ");
       System.out.println("3 : Remove an unspecified Item ");
       System.out.println("4 : CheckOut");
       System.out.println("5 : Checkbudget");
       System.out.print("Choice: ");
       int selection= s.nextInt();
      
      
       switch(selection) {
       case 1:
          add_new_item();
          getupdates();
            
          case 2:
              Add_multiples_items();
              getupdates();
                
          case 3:
              remove_unspecified_data();
              getupdates();
                
          case 4:
                  checkout();
                  getupdates();
                 
          case 5:
                
              checkbudget();
              getupdates();
                    
          case 6:
              System.out.println("Stay Safe");
              break;
                
              default:
                  System.out.println("Invalid choice");
                   System.out.println("Please enter the valid choice");
                   getupdates();
                    
       }
   }

   public static int total_price() {
      
       int total_price=0;
       for (Entry<String, Item> entry : map.entrySet()) {
                  
                   Item it=map.get(entry.getKey());
                  
                   total_price+=it.getPrice()*it.get_quantity();
                  
               }
         
       return total_price;
      
   }
  
  
     
  
   private static void checkbudget() {
      
       System.out.print("Enter your Total Budget : ");
       int budget=s.nextInt();
      
       int totalprice=0;
  


System.out.println("Total Amount = "+total_price());

while(budget<total_price()) {
   totalprice = remove_unspecified_data();
     
     
     
   if(budget>=totalprice) {
       break;
   }
}


System.out.println();

System.out.println("Now updates cart : ");

checkout();

System.out.println();
      
   }

   private static void checkout() {
       System.out.println(" Here list of Items in Your Cart");
      
       int i=1;
       int total_price=0;
       System.out.println(" S.no Name of item Quantity price ");
       System.out.println(" ");
       for (Entry<String, Item> entry : map.entrySet()) {
          
           Item it=map.get(entry.getKey());
          
           System.out.println(" "+i+" "+entry.getKey()+" "+it.get_quantity()+" $"+it.getPrice()*it.get_quantity());
           total_price+=it.getPrice()*it.get_quantity();
           i++;
       }
      
       System.out.println();
      
       System.out.println("Total Amount = "+total_price);
      
       System.out.println();
       System.out.println();
   }

   private static int remove_unspecified_data() {
      
       System.out.print("Enter the item you want to remove from your cart : ");
       String name=s.next();
      
       Item it1=map.get(name);
      
       int quant=it1.get_quantity();
      
       if(quant>1) {
          
       quant--;
       it1.set_quantity(-1);
      
       map.put(name, it1);
       }
         
       else {
           map.remove(name, it1);
       }
      
       int total_price=total_price();
         
       total_price-=it1.getPrice();
         
       System.out.println();
       System.out.println();
      
       return total_price;
      
   }

   private static void Add_multiples_items() {
       System.out.print("Enter the item you want to add in your cart : ");
       String name=s.next();
      
System.out.println("Enter price of Item : ");
      
       int price=s.nextInt();
      
       System.out.print("Enter the quantity of that item you want to add : ");
       int quan=s.nextInt();
      
       if(map.containsKey(name)) {
           Item it1=map.get(name);
           it1.set_quantity(quan);
           map.put(name, it1);
       }
       else {
           Item it= new Item(name,price,quan);
           map.put(name, it);
       }
      
       System.out.println();
       System.out.println();
      
   }

   private static void add_new_item() {
       System.out.print("Enter the item you want to add in your cart : ");
      
       String name=s.next();
      
       System.out.println("Enter price of Item : ");
      
       int price=s.nextInt();
      
      
      
       if(map.containsKey(name)) {
           Item it1=map.get(name);
           it1.set_quantity(1);
           map.put(name, it1);
       }
       else {
           Item it= new Item(name,price,1);
           map.put(name, it);
       }
      
       System.out.println();
       System.out.println();
      
   }
  
  

}

class Item
{   
private String name;
private int price;
private int quantity; //in cents
  
//Constructor
public Item(String n, int p,int quantity)
{
name = n;
price = p;
this. quantity=quantity;
}
  
public boolean equals(Item other)
{
return this.name.equals(other.name) && this.price == other.price;
}
  
//displays name of item and price in properly formatted manner
public String toString()
{
return name + ", price: $" + price/100 + "." + price%100;
}
  
//Getter methods
public int getPrice()
{
return price;
}
  
public int get_quantity()
{
return quantity;
}
  
public void set_quantity(int qa)
{
   quantity+=qa;
}
  
public String getName()
{
return name;
}
}

In: Computer Science

Can you please take this code and just rewrite it so it can be easily be...

Can you please take this code and just rewrite it so it can be easily be able to put into a complier. in java

Implementation of above program in java:

import java.util.HashMap;
import java.util.Scanner;
import java.util.Map.Entry;

public class Shopping_cart {
  
   static Scanner s= new Scanner (System.in);
  
//   declare hashmap in which key is dates as per mentioned and Values class as value which consists all the record of cases
   static HashMap<String,Item> map= new HashMap<>();

   public static void main(String[] args) {
       // TODO Auto-generated method stub
       getupdates();
   }
  
   static void getupdates() {
      
       System.out.println("Welcome to Shopping Cart. Enter:");
       System.out.println("1 : Add an Item ");
       System.out.println("2 : Add multiples Quantities of Given Item ");
       System.out.println("3 : Remove an unspecified Item ");
       System.out.println("4 : CheckOut");
       System.out.println("5 : Checkbudget");
       System.out.print("Choice: ");
       int selection= s.nextInt();
      
      
       switch(selection) {
       case 1:
          add_new_item();
          getupdates();
            
          case 2:
              Add_multiples_items();
              getupdates();
                
          case 3:
              remove_unspecified_data();
              getupdates();
                
          case 4:
                  checkout();
                  getupdates();
                 
          case 5:
                
              checkbudget();
              getupdates();
                    
          case 6:
              System.out.println("Stay Safe");
              break;
                
              default:
                  System.out.println("Invalid choice");
                   System.out.println("Please enter the valid choice");
                   getupdates();
                    
       }
   }

   public static int total_price() {
      
       int total_price=0;
       for (Entry<String, Item> entry : map.entrySet()) {
                  
                   Item it=map.get(entry.getKey());
                  
                   total_price+=it.getPrice()*it.get_quantity();
                  
               }
         
       return total_price;
      
   }
  
  
     
  
   private static void checkbudget() {
      
       System.out.print("Enter your Total Budget : ");
       int budget=s.nextInt();
      
       int totalprice=0;
  


System.out.println("Total Amount = "+total_price());

while(budget<total_price()) {
   totalprice = remove_unspecified_data();
     
     
     
   if(budget>=totalprice) {
       break;
   }
}


System.out.println();

System.out.println("Now updates cart : ");

checkout();

System.out.println();
      
   }

   private static void checkout() {
       System.out.println(" Here list of Items in Your Cart");
      
       int i=1;
       int total_price=0;
       System.out.println(" S.no Name of item Quantity price ");
       System.out.println(" ");
       for (Entry<String, Item> entry : map.entrySet()) {
          
           Item it=map.get(entry.getKey());
          
           System.out.println(" "+i+" "+entry.getKey()+" "+it.get_quantity()+" $"+it.getPrice()*it.get_quantity());
           total_price+=it.getPrice()*it.get_quantity();
           i++;
       }
      
       System.out.println();
      
       System.out.println("Total Amount = "+total_price);
      
       System.out.println();
       System.out.println();
   }

   private static int remove_unspecified_data() {
      
       System.out.print("Enter the item you want to remove from your cart : ");
       String name=s.next();
      
       Item it1=map.get(name);
      
       int quant=it1.get_quantity();
      
       if(quant>1) {
          
       quant--;
       it1.set_quantity(-1);
      
       map.put(name, it1);
       }
         
       else {
           map.remove(name, it1);
       }
      
       int total_price=total_price();
         
       total_price-=it1.getPrice();
         
       System.out.println();
       System.out.println();
      
       return total_price;
      
   }

   private static void Add_multiples_items() {
       System.out.print("Enter the item you want to add in your cart : ");
       String name=s.next();
      
System.out.println("Enter price of Item : ");
      
       int price=s.nextInt();
      
       System.out.print("Enter the quantity of that item you want to add : ");
       int quan=s.nextInt();
      
       if(map.containsKey(name)) {
           Item it1=map.get(name);
           it1.set_quantity(quan);
           map.put(name, it1);
       }
       else {
           Item it= new Item(name,price,quan);
           map.put(name, it);
       }
      
       System.out.println();
       System.out.println();
      
   }

   private static void add_new_item() {
       System.out.print("Enter the item you want to add in your cart : ");
      
       String name=s.next();
      
       System.out.println("Enter price of Item : ");
      
       int price=s.nextInt();
      
      
      
       if(map.containsKey(name)) {
           Item it1=map.get(name);
           it1.set_quantity(1);
           map.put(name, it1);
       }
       else {
           Item it= new Item(name,price,1);
           map.put(name, it);
       }
      
       System.out.println();
       System.out.println();
      
   }
  
  

}

class Item
{   
private String name;
private int price;
private int quantity; //in cents
  
//Constructor
public Item(String n, int p,int quantity)
{
name = n;
price = p;
this. quantity=quantity;
}
  
public boolean equals(Item other)
{
return this.name.equals(other.name) && this.price == other.price;
}
  
//displays name of item and price in properly formatted manner
public String toString()
{
return name + ", price: $" + price/100 + "." + price%100;
}
  
//Getter methods
public int getPrice()
{
return price;
}
  
public int get_quantity()
{
return quantity;
}
  
public void set_quantity(int qa)
{
   quantity+=qa;
}
  
public String getName()
{
return name;
}
}

In: Computer Science

Castle Furnishings Company's perpetual inventory records indicate that $675,400 of merchandise should be on hand on...

Castle Furnishings Company's perpetual inventory records indicate that $675,400 of merchandise should be on hand on November 30, 2016. The physical inventory indicates that $663,800 of merchandise is actually on hand.
Journalize the adjusting entry for the inventory shrinkage for Castle Furnishings Company for the year ended November 30, 2016. Assume that the inventory shrinkage is a normal amount. Refer to the Chart of Accounts for exact wording of account titles.

In: Accounting

The Henry Keizer Family Foundation (2016) provides an excellent resource for individuals to assess their knowledge...

The Henry Keizer Family Foundation (2016) provides an excellent resource for individuals to assess their knowledge about health insurance.

Do you think that these types of resources are a part of improving quality?

Reference

Henry Keizer Family Foundation. (2016). Health Insurance Quiz. Retrieved from http://kff.org/quiz/health-insurance-quiz/?utm_source=kff&utm_medium=tile&utm_content=home&utm_campaign=consumer

In: Operations Management

7) You purchased a commercial building and land for $305,000 on May 3rd, 2014. The land...

7) You purchased a commercial building and land for $305,000 on May 3rd, 2014. The land itself was valued at $82,000 when purchased. You sold the land and building for $480,000 on February 15th of 2016. (a) What is the allowable tax depreciation amount for the year 2014? (b) What is the allowable tax depreciation amount for the year 2015? (c) What is the allowable tax depreciation amount for the year 2016?

In: Finance

You purchased a commercial building and land for $305,000 on February 1st, 2016. The land itself...

You purchased a commercial building and land for $305,000 on February 1st, 2016. The land itself was valued at $82,000 when purchased. You sold the land and building for $480,000 on March 27th of 2018. (a) What is the allowable tax depreciation amount for the year 2016? (b) What is the allowable tax depreciation amount for the year 2017? (c) What is the allowable tax depreciation amount for the year 2018?

In: Economics

You purchased a commercial building and land for $305,000 on February 1st, 2016. The land itself...

You purchased a commercial building and land for $305,000 on February 1st, 2016. The land itself was valued at $82,000 when purchased. You sold the land and building for $480,000 on March 27th of 2018. (a) What is the allowable tax depreciation amount for the year 2016? (b) What is the allowable tax depreciation amount for the year 2017? (c) What is the allowable tax depreciation amount for the year 2018?

In: Economics

On January 1, 2016, your sister's pet supplies business obtained a 30-year amortized mortgage loan for...

On January 1, 2016, your sister's pet supplies business obtained a 30-year amortized mortgage loan for $500,000 at a nominal annual rate of 7.0%, with 360 end-of-month payments. The firm can deduct the interest paid for tax purposes. What will the interest tax deduction be for 2016?

Select the correct answer.

a. $34,835.70
b. $34,834.00
c. $34,837.40
d. $34,839.10
e. $34,840.80

In: Finance