Questions
Task: Read the case study below and answer the following questions. Case Study: The Reveton Ransomware...

Task: Read the case study below and answer the following questions.
Case Study: The Reveton Ransomware Attacks
In August 2012, the Internet Crime Complaint Center (IC3), a partnership between the FBI and the National White Collar Crime Center, was inundated with reports of a new type of cybercrime. Victims across the United States reported that while searching the Internet, their computers locked up, and they received the following message, purportedly from the FBI: “This operating system is locked due to the violation of the federal laws of the United States of America! (Article 1, Section 8, Clause 8; Article 202; Article 210 of the Criminal Code of U.S.A. provides for a deprivation of liberty for four to twelve years.)” The message then accused the victim either of visiting pornography Web sites or of distributing copyrighted content. Victims were told they could unlock their computers and avoid prosecution by paying a fine of $200 within 72 hours of receiving the message. The message came replete with the official FBI logo.
The incident pointed to a steep rise in ransomware attacks. Ransomware is malware that disables a computer or smartphone until the victim pays a fee, or ransom. Unlike other viruses, the Reveton version of ransomware is not activated by opening a file or an attachment. Rather it is an example of “drive-by malware,” viruses that download automatically when a user visits an infected Web site.
The FBI immediately issued an alert, but within a month, cybersecurity experts had identified 16 variants of the ransomware. These viruses had infected 68,000 unique IP addresses. It is estimated that on an average day, about 170 victims paid the $200 fee and received valid unlock codes. The compromised computers could not be fixed through the installation or updating of antivirus software because the computer was locked. Because so many home PC owners fail to back up their systems regularly, many victims faced losing a significant amount of data. The $200 fee itself was low enough to encourage payment. A visit to a professional IT service to repair the damage could potentially cost the same amount and take more time to resolve. A quick payment through a prepaid money card system, such as MoneyPak, could save the victim a lot of trouble.
The United States was not the first country to be hit by these attacks. In early 2012, criminal gangs targeted France, Germany, and the United Kingdom. Ransomware attacks first broke out in Russia in 2009. Since that time, they have spread to almost every country on the globe, hitting the United States and Japan especially hard. Symantec, an IT security company, estimates that gangs are extorting over $5 million per year from online victims. The rise of ransomware attacks is, no doubt, due in part to their success. In France, for example, almost 4 percent of victims coughed up the ransom money during a non-Reveton scam.
The Reveton ransomware is delivered by the popular Russian-language Citadel malware toolkit. The latest version of Citadel can also grab passwords from Web browsers and change Web sites to trick users into handing over their login information.
In December 2012, the United Kingdom arrested three people they believed were involved in the Reveton ransomware attacks. Finding the perpetrators, however, is unusual and is not the most effective way to combat this crime. Law enforcement agencies and IT security companies have urged the public to take measures to prevent themselves from falling victim to such attacks—by keeping software such as Java, Acrobat Reader, Adobe Flash, Windows, and their browser software updated. An early Reveton ransomware attack made use of a vulnerability in a version of Java that had just been patched a month prior. Computer users can also avoid infections by using security software that identifies suspicious Web sites, and by not clicking online ads from dubious companies. Perhaps, however, the best way to avoid the spread of these attacks is to encourage victims to report the crime and to refuse to comply with the ransom demands.

Questions for the Homework
1-Why are ransomware attacks on the rise?
2-What can you do to prevent ransomware attacks on your own computer?
3-How do you think victims should respond to ransomware attacks?
4-Do the victims have an ethical obligation to future victims? If yes, why? If no, why?

In: Computer Science

FAMILY NURSING CARE PLAN Family Background Client N and her family is a cohabiting family. Client...

FAMILY NURSING CARE PLAN
Family Background
Client N and her family is a cohabiting family. Client N is a 25-year old female, and her partner, client JR is a 31-year old male. They have been living together for three years. She has two children, her first-born is a 6-year old boy from her previous relationship and is currently being taken care of by her parents in Manila. She gave birth to her 6-week old baby boy last August 31, 2020 whom she is taking care of now. The head of the family is client N. She is in charge of making decisions about the family.
Socio-Economic Background
Client N. is a high school graduate and is working as a massage therapist in Pasay City, and her partner is an elementary graduate and works as a street vendor near train Station. The client is currently on maternity leave from her job as a therapist. During her maternity leave, it is her partner who provides for their daily needs. She said that their income is enough to provide their family’s basic needs but she did not disclose their monthly income. They are Roman Catholic and states that they have a firm belief or faith in God, as the client verbalized "for me, God has the biggest role in our lives." They do not participate or join community activities like the city's feast or program.
PHYSICAL ENVIRONMENT
The client’s house is made of light scrap materials like plywood, big carton boxes which they decorated with wallpapers. The houses in the compound are clustered closely together with little to no space. It is a small house with no windows. It is a small space with a curtain that serves as a door near their house since the house gets too hot during the day. They do not have their own toilet and bath area; they use a common toilet and bathroom area in the compound, wherein they pay a fee of 20 pesos and 10 pesos each one bucket of water. The toilet bowl in the common bathroom does not have a flush. The sources of water in the area are deep well with a water pump and (NAWASA). They use the water from the deep well to wash their dishes and their laundry. However, the student nurse noticed that the water in the well has garbage floating in it. She also noticed several big plastic bottles without cover that scattered around the house that had rain water inside. They also leave their used dishes soaked in a basin. Their source of electricity is from the jumper cables connected to the electric posts of Meralco. The family usually buys their food from the eatery found in the area, but if they have the chance to cook, they use a small LPG single burner gas stove. The passageway to the house is filled with broken tiles which are purposely placed there because the soil beneath it is soft and muddy that the feet sink when it is stepped on. Presence of mosquitos, rats, and cockroaches were observed.
As mandated by a city ordinance about disposing garbage properly to their right place, Family N do not practice this segregation by placing their garbage into their specified categories to avoid additional health problems in the family. But among those that are found planted in cans there are lagundi, oregano, ampalaya, pito-pito and tsaang gubat located beside their house.
Family N Medical and Health History
Client N. has been complaining of having difficulty falling asleep and staying asleep that started after giving birth to her second child. Client N. and her partner has been experiencing coughs and cold for a week, and their 6-week old baby started to have colds in the morning during home visit the health provider teach them to used the available herbal plants outside their house and it is planted in a can .Proper instruction given to Client N.
Client N.'s partner has been taking Solmux 1 cap 2x a day since he started coughing and having colds per doctor's order.
Client N.'s OB score is G=2, P=2, T=2, P=0, A=0, L=2.
VITAL SIGNS are the following BP 100/80 mm/Hg Temperature 36.5c , Pulse Rate 100 beat/minutes ,
Respiration Rate 18 breaths per minutes ,
  
The client has stopped feeding her 6-week old son through breastfeeding because of her inverted nipples. She stated that her son could not suck on her breasts and has bad attachment. “I don't have time to visit the Health center for some Health counselling for my inverted nipple.”
Family Assessment Based on Functional Health Pattern
1) Health Perception - Health Management Patterns
In general, the members of the family have no chronic illnesses and they rarely get sick and if they do get sick, it is usually coughs or colds. Mostly prefer herbal remedies than medications. It is when the herbal plants do not give relief from the symptom, they seek help from the Barangay Health Station and seek medical advice from the doctor.

2) Nutritional-Metabolic Pattern
The family eats three times a day. They prefer foods cooked in the vendors and canned goods. Her parents also helped the family as verbalized by Client N once in a while, Client N has no allergies to sea foods such as shellfish, crabs, and shrimps and all the family members can enjoy eating foods that they have during meal time.
The newborn baby is not satisfied during breastfeeding because of the inverted nipple of her mother . Need more attention from Client N to give the proper breast feeding to her baby. as verbalized by the mother.
3) Elimination Pattern
Client N has no difficulties during urination and defecation. They are able to defecate once or twice a day and able to urinate 3x a day or more .
4) Activity-Exercise Pattern
CLIENT N is a working mother and a busy person so her mother helped her to watch her other child . She focuses on taking care of her child at home . Feels weak and with difficulty of sleeping after her second delivery of her child.

FAMILY HEALTH HISTORY
Family’s health history, the client N's father who is aged 52 years old has been experiencing high blood pressure that started last 2018. Apart from that, the client’s immediate family members do not have any non-communicable diseases. Client N. does not know her grandparents from her paternal side and her grandfather from her maternal side’s cause of death because they passed away before she was born.

QUESTIONS:
Make a Family Nursing Care Plan
1. Supporting cues; Objective & Subjective cues
2. Health condition or problem (State the most prioritized to least prioritized then choose the RANK 1)
3. Family nursing problems
4. Goal of care
5. Objectives of Nursing Care
6. Nursing interventions
7. Method of family contact
8. Evaluation

In: Nursing

Step 4: Create a class called BabyNamesDatabase This class maintains an ArrayList of BabyName objects. Instance...

Step 4: Create a class called BabyNamesDatabase

This class maintains an ArrayList of BabyName objects.

Instance Variables

  • Declare an ArrayList of BabyName objects.

Constructor

  • public BabyNamesDatabase () - instantiate the ArrayList of BabyName objects. You will not insert the items yet. This method will be one line of code.

Mutator Methods

  • public void readBabyNameData(String filename) - open the provided filename given as input parameter, use a loop to read all the data in the file, create a BabyName object for each record and add it to the ArrayList. We are providing most of the code for this method. Look for the TO DO comments to complete the logic.

Background Information: Reading from a Text File

The data file contains baby name records from the U.S. Social Security Administration since 1880. The readBabyNameData() method reads four items that are separated by commas, passes them to the BabyName class constructor and adds the BabyName object to the ArrayList.

Sample record: Mary,F,7065,1880

public void readBabyNameData(String filename){

  

     // Read the full set of data from a text file

     try{

          // open the text file and use a Scanner to read the text

          FileInputStream fileByteStream = new FileInputStream(filename);

          Scanner scnr = new Scanner(fileByteStream);

          scnr.useDelimiter("[,\r\n]+");

          

          // keep reading as long as there is more data

          while(scnr.hasNext()) {

              

               // reads each element of the record

               String name = scnr.next();

               String gender = scnr.next();

               // TO DO: read the count and year

               int count = ;

               int year = ;

               // TO DO: assign true/false to boolean isFemale based on

               // the gender String

               boolean isFemale;

               // instantiates an object of the BabyName class

               BabyName babyName = new BabyName(name, isFemale, count, year);

               // TO DO: add to the ArrayList the babyName created above

              

          }

          fileByteStream.close();

     }

     catch(IOException e) {

          System.out.println("Failed to read the data file: " + filename);

     }

}

Accessor Methods

  • public int countAllNames () - return the number of baby names using one line of code.  
  • public int countAllGirls() – Use a for-each loop to search the full list and count the total number of girls born since 1880. This number will be much higher than just the number of girl names since each name represents hundreds, if not thousands, of newborn babies.
  • public int countAllBoys() – Use a for-each loop to search the full list and count the total number of boys since 1880. This number will be much higher than just the number of boy names since each name represents hundreds, if not thousands, of newborn babies.
  • public ArrayList <BabyName> searchForYear(int year) – Use a for-each loop to search the full list and return a new list of baby names that match the requested year (in the parameter). If there is no match for the year, the returned list will exist but have zero elements.
  • public BabyName mostPopularGirl(int year) – use a for-each loop to navigate the list of baby names and return the most popular girl name for that specific year. Return null if there are no baby names for the year entered as input parameter.
  • public BabyName mostPopularBoy(int year) – use a for-each loop to navigate the list of baby names and return the most popular boy name for that specific year. Return null if there are no baby names for the year entered as input parameter.
  • public ArrayList <BabyName> searchForName(String name) – Use a for-each loop to search the full list and return a new list of baby names that match the requested name (in the parameter). Spelling should match exactly but it is not case sensitive. For example, ‘Angie’, ‘angie’ and ‘ANGIE’ all match. Hint, check out the String method called equalsIgnoreCase(String str). If there are no matches for the name, the returned list will exist but have zero elements.

Step 5: Generate a Top Ten List

To generate a top ten list for a particular year your solution must be able to sort names in descending order by number of births. This requires changes to the BabyName and BabyNamesDatabase classes.

Changes to BabyName class

  • Add two words to the end of the class header (shown below). You will need to import a new java package for this to compile. This allows BabyName objects to be compared using compareTo() and therefore sorted.

public class BabyName implements Comparable{

  • Also, add the following method. This method allows two BabyName objects to be compared with respect to the number of births.

IMPORTANT NOTE: For the compareTo method below, we are assuming that the name of the instance variable for the number of births is count.

               public int compareTo(Object other){

     BabyName b = (BabyName) other;

     return (b.count – count);

   }

Changes to BabyNamesDatabase class

NOTE: Sorting an ArrayList, called tempList, can be performed with one line of code:

   Collections.sort(tempList);

  • Change the searchForYear method. Use the instruction shown above to sort the ArrayList of BabyName objects that this method returns before returning it.
  • public ArrayList <BabyName> topTenNames(int year) – search the full list and return a new list of the ten most popular baby names in a given year entered as input parameter. The returned list will exist but have zero elements if there are no records for the specified year. Otherwise, it will have ten names. Avoid duplicating code by calling the searchForYear method to first select all names in the year.  

Once you have the list of all names in the year sorted in descending order by the count of births, you can do any of these three options to figure out the top ten baby names for that year

  • you can remove all items from the temporary list except the first ten before returning the result. Use a for loop that goes backwards if you want to use this option.
  • you may create another temporary list and add to this new list only the first 10 records from the list of all names in the year.
  • you may use the subList and removeAll methods of the ArrayList class. See Java API for documentation on how to use these two methods.

BABY NAME JAVA CODE

package pranam; // imported some imaginary package

import java.text.DecimalFormat; // imported Decimal Format

public class Babyname { // create class Babyname
   private static final String girls = null; // create string of girls (constant
   private static final String named = null;
   private static final String in = null;
   String name;
   boolean gender;
   int number_of_babies_given_that_name;
   int birth_year;
  
   public Babyname(String name, boolean gender,   
           int number_of_babies_given_that_name, int birth_year) { //defined a constructor
       super();
       this.name = name;
       this.gender = gender;
       this.number_of_babies_given_that_name = number_of_babies_given_that_name;
       this.birth_year = birth_year;
      
   }

   public String getName() { // Getters and setters for the functions
       return name;
   }

   public void setName(String name) {
       this.name = name;
   }

   public boolean isGender() {
       return gender;
   }

   public void setGender(boolean gender) {
       this.gender = gender;
   }

   public int getNumber_of_babies_given_that_name() {
       return number_of_babies_given_that_name;
   }

   public void setNumber_of_babies_given_that_name(
           int number_of_babies_given_that_name) {
       this.number_of_babies_given_that_name = number_of_babies_given_that_name;
   }

   public int getBirth_year() {
       return birth_year;
   }

   public void setBirth_year(int birth_year) {
       this.birth_year = birth_year;
   }
  
   public boolean isFemale(){ // generate the isFemale function
       if(gender=true)
           return true;
       else
           return false;
   }

   @Override
   public String toString() { // Generate the toString function
       DecimalFormat fmt = new DecimalFormat ("###,###,###");
      
      
       return " ["
               + number_of_babies_given_that_name + " " + "girls" +" "
               + "named" +" "+ name +" "+ "in" + ","+ birth_year + "]";
   }

}

In: Computer Science

FAMILY QUEEN (FNCP) Family Background Client Q and her family is a cohabiting family. Client Q....

FAMILY QUEEN (FNCP)
Family Background
Client Q and her family is a cohabiting family. Client Q. is a 25-year old female, and her partner, client R.S.J., is a 31-year old male. They have been living together for three years. She has two children, her first-born is a 6-year old boy from her previous relationship and is currently being taken care of by her parents in Las Piñas. She gave birth to her 6-week old baby boy last August 31, 2020 whom she is taking care of now. The head of the family is client Q. She is in charge of making decisions about the family.
Socio-Economic Background
Client Q. is a high school graduate and is working as a massage therapist in Makati City, and her partner is an elementary graduate and works as a street vendor near LRT Libertad Station. The client is currently on maternity leave from her job as a therapist. During her maternity leave, it is her partner who provides for their daily needs. She said that their income is enough to provide their family’s basic needs but she did not disclose their monthly income. They are Roman Catholic and states that they have a firm belief or faith in God, as the client verbalized “para sa akin malaki ang papel ng Diyos sa buhay namin”. They do not participate or join community activities like the barangay’s fiesta or program.
PHYSICAL ENVIRONMENT
The client’s house is made of light scrap materials like plywood, big carton boxes which they decorated with wallpapers. The houses in the compound are clustered closely together with little to no space. It is a small house with no windows. It is a small space with a curtain that serves as a door near their house since the house gets too hot during the day. They do not have their own toilet and bath area; they use a common toilet and bathroom area in the compound, wherein they pay a fee of 20 pesos and 10 pesos each one bucket of water. The toilet bowl in the common bathroom does not have a flush. The sources of water in the area are deep well with a water pump and (NAWASA). They use the water from the deep well to wash their dishes and their laundry. However, the student nurse noticed that the water in the well has garbage floating in it. She also noticed several big plastic bottles without cover that scattered around the house that had rain water inside. They also leave their used dishes soaked in a basin. Their source of electricity is from the jumper cables connected to the electric posts of Meralco. The family usually buys their food from the eatery found in the area, but if they have the chance to cook, they use a small LPG single burner gas stove. The passageway to the house is filled with broken tiles which are purposely placed there because the soil beneath it is soft and muddy that the feet sink when it is stepped on. Presence of mosquitos, rats, and cockroaches were observed.
As mandated by a city ordinance about disposing garbage properly to their right place, Family Q do not practice this segregation by placing their garbage into their specified categories to avoid additional health problems in the family. But among those that are found planted in cans there are lagundi, oregano, ampalaya, pito-pito and tsaang gubat located beside their house.
Family QUOGUE Medical and Health History
Client Q. has been complaining of having difficulty falling asleep and staying asleep that started after giving birth to her second child. Client Q. and her partner has been experiencing coughs and cold for a week, and their 6-week old baby started to have colds in the morning during home visit the health provider teach them to used the available herbal plants outside their house and it is planted in a can .Proper instruction given to Client Q .
Client Q’s partner has been taking Solmux 1 cap 2x a day since he started coughing and having colds per doctor's order.
Client Q.’s OB score is G=2, P=2, T=2, P=0, A=0, L=2.
VITAL SIGNS are the following BP 100/80 mm/Hg Temperature 36.5c , Pulse Rate 100 beat/minutes ,
Respiration Rate 18 breaths per minutes ,
  
The client has stopped feeding her 6-week old son through breastfeeding because of her inverted nipples. She stated that her son could not suck on her breasts and has bad attachment. “I don't have time to visit the Health center for some Health counselling for my inverted nipple.”
Family Assessment Based on Functional Health Pattern
1) Health Perception - Health Management Patterns
In general, the members of the Quiogue family have no chronic illnesses and they rarely get sick and if they do get sick, it is usually coughs or colds. Mostly prefer herbal remedies than medications. It is when the herbal plants do not give relief from the symptom, they seek help from the Barangay Health Station and seek medical advice from the doctor.
2) Nutritional-Metabolic Pattern
The family eats three times a day. They prefer foods cooked in the CARINDERIA and canned goods. Her parents also helped the family as verbalized by Client Q once in a while, Client Q has no allergies to sea foods such as shellfish, crabs, and shrimps and all the family members can enjoy eating foods that they have during meal time.
The newborn baby is not satisfied during breastfeeding because of the inverted nipple of her mother . Need more attention from Client Q to give the proper breast feeding to her baby. as verbalized by the mother.
3) Elimination Pattern
Client Q has no difficulties during urination and defecation. They are able to defecate once or twice a day and able to urinate 3x a day or more .
4) Activity-Exercise Pattern
CLIENT Q is a working mother and a busy person so her mother helped her to watch her other child . She focuses on taking care of her child at home . Feels weak and with difficulty of sleeping after her second delivery of her child. FAMILY HEALTH HISTORY
Family’s health history, the client Q’s father who is aged 52 years old has been experiencing high blood pressure that started last 2018. Apart from that, the client’s immediate family members do not have any non-communicable diseases. Client Q. does not know her grandparents from her paternal side and her grandfather from her maternal side’s cause of death because they passed away before she was born.

Questions:
Family Nursing Care Plan
1. Supporting data/cues (Subjective & Objective)
2. Health Condition or Problem (State the Rank 1 prioritized problem)
3. Family Nursing Problems
4. Goal of Care
5. Objectives of Nursing Care
6. Interventions
7. Method of Family Contact
8. Evaluation



Name of the Family: FAMILY QUEEN

In: Nursing

Complete the project functions for this week. These functions are main_menu(), column_full() and get_move(). To complete...

Complete the project functions for this week. These functions are main_menu(), column_full() and get_move(). To complete these functions, first remove the library function call from the function in the template (main_menu_lib, etc), then replace that with your own code to complete the function. You can test your functions separate from the project by creating a small main() function that calls them (with appropriate inputs), or you can compile the entire project and see if it works.main_menu(): This function displays the main menu to the user, which should say "Welcome to the Connect 4 Game", and then prompt the user to ask if they would like to start a new game (press 'n'), load a game (press 'l') or quit (press 'q'). If the user selects new game, the main_menu function should return 1. If they select load game, it should return 2, and if they choose quit it should return -1. If any other input is entered, the user should be prompted to re-enter their choice until a valid input is chosen.column_full(): This function takes the entire board (a COLS x ROWS array of ints) as input as well as a single integer representing the column number to be checked. Note that this input is between 1 and COLS, not0 and COLS-1 so does not correspond exactly to the array dimension.Your function should then check if the specified column is full or not, and return 1 if full, 0 otherwise. The column is full if every element in the column is non-zero.get_move(): This function takes the entire board (a COLS x ROWS array of ints) as input, and then reads a column number from the user, checks that the supplied column is valid (between 1 and COLS), not full (using the column_full() function you've already written) and then returns the valid column number. If the input is invalid or the column is full, an appropriate error message should be displayed and the user asked to enter another column.

TEMPLATE FILE:

#include 
#include 
#include 
#include 
#include 
#include "connect4.h"

int main ( void ){

    int option ;
        Game g ;

        // intitialise random seed
        srand(time(NULL));

    while (( option = main_menu()) != -1 ){
        if ( option == 1 ){
            // setup a new game
            setup_game ( &g ) ;
            // now play this game
            play_game ( &g ) ;
        } else if ( option == 2 ){
            // attempt to load the game from the save file
            if ( load_game ( &g, "game.txt" ) == 0 ){
                // if the load went well, resume this game
                play_game ( &g ) ;
            } else {
                printf ( "Loading game failed.\n") ;
            }
        } else if ( option == -1 ){
            printf ( "Exiting game, goodbye!\n") ;
        }
    }
}

// WEEK 1 TASKS
// main_menu()
// column_full()
// get_move()

// displays the welcome screen and main menu of the game, and prompts the user to enter an option until
// a valid option is entered.
// Returns 1 for new game, 2 for load game, -1 for quit
int main_menu ( void ){

    // Dipslay Welcome message

    // Continue asking for an option until a valid option (n/l/q) is entered
    // if 'n', return 1
    // if 'l', return 2
    // if 'q', return -1
    // if anything else, give error message and ask again..

    return main_menu_lib () ;
}


// Returns TRUE if the specified column in the board is completely full
// FALSE otherwise
// col should be between 1 and COLS
int column_full ( int board[COLS][ROWS], int col ){

    // check the TOP spot in the specified column (remember column is between 1 and COLS, NOT 0 and COLS-1 so you'll need to modify slightly
    // if top spot isn't empty (0 is empty) then the column is full, return 1
    // otherwise, return 0
    return column_full_lib ( board, col ) ;
}


// prompts the user to enter a move, and checks that it is valid
// for the supplied board and board size
// Returns the column that the user has entered, once it is valid (1-COLS)
// note that this value is betweeen 1 and COLS (7), NOT between 0 and 6!!
// If the user enters 'S' or 's' the value -1 should be returned, indicating that the game should be saved
// If the user enters 'Q' or 'q' the value -2 should be returned, indicating that the game should be abandoned
int get_move ( int board[COLS][ROWS] ){

    // repeat until valid input is detected:

    // read a line of text from the user
    // check if the user has entered either 's' (return -1) or 'q' (return -2)
    // if not, read a single number from the inputted line of text using sscanf
    // if the column is valid and not full, return that column number
    // otherwise, give appropriate error message and loop again

    return get_move_lib ( board ) ;
}


// END OF WEEK 1 TASKS
#ifndef CONNECT4_H
#define CONNECT4_H 1

#define ROWS 6      // height of the board
#define COLS 7      // width of the board (values of 9 are going to display poorly!!)

// These lines detect what sort of compiler you are using. This is used to handle the time delay
// function wait() in various operating systems. Most OS will use sleep(), however for windows it is
// Sleep() instead.
#ifdef _WIN32
    #include <windows.h>
#else
    #include <unistd.h>
#endif

typedef struct {

    int player1, player2 ;      // variables for each player - 1 for human, 0 for computer player
    int board[COLS][ROWS] ;     // the game board. 0 for empty space, 1 for player 1, 2 for player 2
                                // Note that row 0 is the TOP row of the board, not the bottom!
                                // column 0 is on the left of the board
    int turn ;                  // whose turn it is, 1 or 2
    int winner ;                // who has won - 0 for nobody, 1 for player 1, 2 for player 2
} Game ;

// displays the welcome screen and main menu of the game, and prompts the user to enter an option until
// a valid option is entered.
// Returns 1 for new game, 2 for load game, -1 for quit
int main_menu ( void ) ;

// displays the board to the screen
int display_board ( int[COLS][ROWS] ) ;


// sets up the game to a new state
// prompts the user if each player should be a human or computer, and initialises the relevant fields
// of the game structure accordingly
int setup_game ( Game *g ) ;


// Returns TRUE if the specified column in the board is completely full
// FALSE otherwise
// col should be between 1 and COLS
int column_full ( int[COLS][ROWS], int col ) ;


// plays a game until it is over
int play_game ( Game *g ) ;


// prompts the user to enter a move, and checks that it is valid
// for the supplied board and board size
// Returns the column that the user has entered, once it is valid (1-COLS)
// note that this value is betweeen 1 and COLS (7), NOT between 0 and 6!!
// If the user enters 'S' or 's' the value -1 should be returned, indicating that the game should be saved
// If the user enters 'Q' or 'q' the value -2 should be returned, indicating that the game should be abandoned
int get_move ( int[COLS][ROWS] ) ;

// calcualtes a column for the computer to move to, using artificial "intelligence"
// The 'level' argument describes how good the computer is, with higher numbers indicating better play
// 0 indicates very stupid (random) play, 1 is a bit smarter, 2 smarter still, etc..
int computer_move ( int[COLS][ROWS], int colour, int level ) ;

// adds a token of the given value (1 or 2) to the board at the
// given column (col between 1 and COLS inclusive)
// Returns 0 if successful, -1 otherwise
int add_move ( int b[COLS][ROWS], int col, int colour ) ;

// determines who (if anybody) has won.  Returns the player id of the
// winner, otherwise 0
int winner ( int[COLS][ROWS] ) ;

// determines if the board is completely full or not
int board_full ( int[COLS][ROWS] ) ;


// saves the game to the specified file. The file is text, with the following format
// player1 player2 turn winner
// board matrix, each row on a separate line
// Example:
//
//1 0 1 0        player 1 human, player 2 computer, player 1's turn, nobody has won
//0 0 0 0 0 0 0  board state - 1 for player 1's moves, 2 for player 2's moves, 0 for empty squares
//0 0 0 0 0 0 0
//0 0 0 2 0 0 0
//0 0 0 2 0 0 0
//0 2 1 1 1 0 0
//0 2 2 1 1 2 1
int save_game ( Game g, char filename[] ) ;


// loads a saved game into the supplied Game structure. Returns 0 if successfully loaded, -1 otherwise.
int load_game ( Game *g, char filename[] ) ;


// waits for s seconds - platform specific! THIS FUNCTION IS INCLUDED IN THE LIBRARY, NO NEED TO WRITE IT!
void wait_seconds ( int s ) ;


// library versions of functions. Exactly the same behaviour done by course staff. Please just call these if you have not completed your version as yet.
int display_board_lib ( int[COLS][ROWS] ) ;
int setup_game_lib ( Game *g ) ;
int column_full_lib ( int[COLS][ROWS], int col ) ;
int play_game_lib ( Game *g ) ;
int get_move_lib ( int[COLS][ROWS] ) ;
int add_move_lib ( int b[COLS][ROWS], int col, int colour ) ;
int winner_lib ( int[COLS][ROWS] ) ;
int board_full_lib ( int[COLS][ROWS] ) ;
int computer_move_lib ( int[COLS][ROWS], int colour, int level ) ;
int save_game_lib ( Game g, char filename[] ) ;
int load_game_lib ( Game *g, char filename[] ) ;
int main_menu_lib ( void ) ;


#endif

In: Computer Science

Aki Ambrose has developed a new device that is so exciting that she plans to quit...

Aki Ambrose has developed a new device that is so exciting that she plans to quit her job in order to produce and market it on a large scale. Aki will rent a garage for $ 300 per month for production purposes. Aki has already taken an industrial design course at the local community college to help prepare for this endeavor. The course cost $ 300. Aki will rent production equipment at a monthly cost of $ 800. She estimates that the cost of the material will be $ 5 per unit and the cost of labor will be $ 3 per unit. She will hire workers and spend her time promoting the product. To do this, she will quit her job, which pays $ 4,000 a month. Advertising and promotion will cost $ 900 per month.

1.a Following the cost analysis for Aki, which of the following statements is true:

a. Advertising and promotion are variable costs that cannot be incorporated

b. Advertising and promotion are incorporable costs

c. Garage and equipment rents are fixed fixed costs

d. Garage and equipment rents are fixed costs that cannot be incorporated.

1.b Following the cost analysis for Aki, which of the following statements is true:

a.The raw material and direct labor constitute variable costs which cannot be incorporated

b. Raw material and direct labor constitute variable costs that can be incorporated

c. Raw material and direct labor constitute fixed costs that can be incorporated

d. Raw material and direct labor are fixed costs that cannot be incorporated

1.c Following the cost analysis for Aki, which of the following statements is true:

a. The salary of $ 4000 per month is an opportunity cost and the cost of the course is a sunk cost

b. The salary of $ 4,000 per month is a sunk cost and the course cost is an opportunity cost.

c. The salary of $ 4,000 per month and the cost of the course are opportunity costs. d. The salary of $ 4,000 per month and the cost of the course are sunk costs

1.d If Aki produces and sells 1,000 devices in its first month and each device sells for $ 16, then Aki's profit for the month would be:

a. $ 6,000

b. $ 8,000

c. $ 4,200

d. $ 6,900

1.e Aki is considering selling online. If it does, it must pay the delivery charges which will be $ 1.10 per device. Joining the online marketplace costs $ 1,500 per month. She expects her sales to double if she sells online. Should Aki sell online?

a. Yes, because the profit will increase by $ 4,300

b. No, because the profit will decrease by $ 4,300

c. No, because the profit will decrease by $ 10,300

d. Yes, because the profit will increase by $ 10,300


1.f After having been in business for 3 months, the owner who rents the garage to him for his production sent him an invoice for the public services. Aki was surprised because she had not planned a budget for public services, but when examining her lease, she accepts that she must pay them. The utility bills include fixed and variable costs depending on its use.

Using the extreme point method, the variable and fixed cost elements of Aki's utility bill each month, in the form of equation Y = a + b.X, would be:

Months

Kilowatt hours used

Public Services

November

2004

$378

December

1995

$380

January

2339

$435

a. The unit variable cost per kilowatt hour used is $ 0.18 and the total fixed cost is $ 344

b. The unit variable cost per kilowatt hour used is $ 0.18 and the total fixed cost is $ 55

c. The unit variable cost per kilowatt hour used is $ 0.18 and the total fixed cost is $ 610

d. The unit variable cost per kilowatt hour used is $ 0.16 and the total fixed cost is $ 61

In: Accounting

1.A prevalence survey conducted from January 1 through December 31, 2014 identified 3000 cases of leukemia...

1.A prevalence survey conducted from January 1 through December 31, 2014 identified 3000 cases of leukemia in a city of 2 million persons. The incidence rate of leukemia in this population is 6/10,000 persons each year. 1. What percent of the 3000 cases were newly diagnosed in 2014?

2. What would be the effect on age-specific incidence rates of leukemia if women with children were excluded from the denominator of the calculations, assuming that there are some women in each age group that have children? (Would they increase, decrease, stay the same, increase in older groups, increase in younger groups, or something else?)

The population of the city of Toronto on June 30, 2015 = 248,000

Number of new active cases of measles in Toronto occurring in 2015 = 16

Number of active measles cases according to the city register on December 31, 2015 = 355

The incidence rate of active cases of measles in Toronto for the year 2015 was:

The prevalence rate of active cases of measles as of December 31, 2015 was:

In a European country with a population of 10 million people, 40,000 deaths occurred during the year ending December 31, 2012. These included 20,000 deaths from cholera in 100,000 people who were sick with cholera.

What was the cause-specific mortality rate from cholera in 2012? What does this number mean (i.e. how can it be interpreted)?

What was the case-fatality from cholera in 2012? What does this number mean (i.e. how can it be interpreted)?

The mortality rate from disease X in city A is 60/100,000 in persons 50+ years old. The mortality rate from the same disease in city B is 120/100,000 in persons 50+ years old.

Is the inference correct that disease X is two times more prevalent in persons 50+ years old in city B than it is in persons 50+ years old in city A? Why or why not?

In 2000, there were 65,000 deaths due to lung disease in cigarette smokers aged 20-64 years. The expected number of deaths among cigarette smokers based on age-specific death rates from lung diseases in all females aged 20-64 years was 15,000 during 1995.

What was the standardized mortality ratio (SMR) for lung diseases in cigarette smokers?

Questions 9 and 10 are based on the information given below:

Numbers of People and Deaths from Automobile Accidents in Communities X and Y

Community X

Community Y

Age group

No. of people

No. of deaths from automobile accidents

No. of people

No. of deaths from automobile accidents

Young

10,000

69

7,000

48

Old

13,000

115

5,000

60

Calculate the age-adjusted death rate for automobile accidents in communities X and Y by the direct method, using the total of both communities as the standard population.

What is the age-adjusted death rate from automobile accidents for community X?

What is the proportionate mortality from automobile accidents for community Y?

In your own words, explain the relationship between validity and reliability.

What is the relationship between positive predictive value and disease prevalence?

A physical examination was used to screen for prostate cancer in 5,000 men with biopsy-proven cancer of the prostate and in 10,000 age- and race- matched control men. The results of the physical examination were positive (i.e. a mass in the prostate was palpated) in 3,600 cases and in 1,600 control men, all of whom showed no evidence of cancer at biopsy.

The sensitivity of the physical examination was ____________.

The specificity of the physical examination was ____________.

The positive predictive value of the physical examination was __________.

In: Nursing

Draw a UML diagram for the classes. Code for UML: // Date.java public class Date {...

Draw a UML diagram for the classes.

Code for UML:

// Date.java

public class Date {
  
   public int month;
   public int day;
   public int year;

   public Date(int month, int day, int year) {
   this.month = month;
   this.day = day;
   this.year = year;
   }
  
   public Date() {
   this.month = 0;
   this.day = 0;
   this.year = 0;
   }
}

//end of Date.java

// Name.java

public class Name {
  
   public String fname;
   public String lname;

   public Name(String fname, String lname) {
   this.fname = fname;
   this.lname = lname;
   }
  
   public Name() {
   this.fname = "";
   this.lname = "";
   }
}

//end of Name.java

// Address.java

public class Address {
  
   public String street ;
   public String state ;
   public String city;
   public int zipcode;

   public Address(String street, String state, String city, int zipcode) {
   this.street = street;
   this.state = state;
   this.city = city;
   this.zipcode = zipcode;
   }
  
   public Address() {
   this.street = "";
   this.state = "";
   this.city = "";
   this.zipcode = 0;
   }
}

//end of Address.java

// Employee.java

public class Employee {
  
   public int number;
   public Date mydate;
   public Address myadress;
   public Name myname;

   public Employee(int number, Name myname, Date mydate, Address myadress) {
   this.number = number;
   this.mydate = mydate;
   this.myadress = myadress;
   this.myname = myname;
   }
  
   public Employee() {
   this.number = 0;
   this.mydate = new Date();
   this.myadress = new Address();
   this.myname = new Name();
   }
  
   // method to display the details of the Employee
   public void display()
   {
       System.out.println("Number: "+number);
       System.out.println("Name: "+myname.fname+" "+myname.lname);
       System.out.println("Data: "+mydate.month+"/"+mydate.day+"/"+mydate.year);
       System.out.println("Address: "+myadress.street+" "+myadress.city+", "+myadress.state+", "+myadress.zipcode);
   }
}
// end of Employee.java

// SalariedEmployee.java

public class SalariedEmployee extends Employee
{
   public double salary;
  
   // parameterized constructor
   public SalariedEmployee(int number, Name myname, Date mydate, Address myadress, double salary)
   {
       super(number, myname, mydate, myadress); // call Employee's constructor
       this.salary = salary;
   }
  
   // default constructor
   public SalariedEmployee()
   {
       super();
       this.salary = 0;
   }
  
   // override Employee's display method to display the additional details
   public void display()
   {
       super.display();
       System.out.printf("Salary: $%,.2f\n",salary);
   }
}
//end of SalariedEmployee.java

// HourlyEmployee.java

public class HourlyEmployee extends Employee
{
   public double pay_rate;
   public int hours_worked;
   public double earnings;
  
   // parameterized constructor
   public HourlyEmployee(int number, Name myname, Date mydate, Address myadress, double pay_rate, int hours_worked)
   {
       super(number, myname, mydate, myadress);
       this.pay_rate = pay_rate;
       this.hours_worked = hours_worked;
       // calculate earnings
       if(hours_worked <= 40) // no overtime
           earnings = this.pay_rate*this.hours_worked;
       else // overtime
           earnings = this.pay_rate*40 + (this.hours_worked-40)*1.5*this.pay_rate;
   }
  
   // default constructor
   public HourlyEmployee()
   {
       super();
       pay_rate = 0;
       hours_worked = 0;
       earnings = 0;
   }
  
   // override display method
   public void display()
   {
       super.display();
       System.out.printf("Pay rate: $%,.2f\n",pay_rate);
       System.out.println("Hours Worked: "+hours_worked);
       System.out.printf("Earnings: $%,.2f\n",earnings);
   }
}
//end of HourlyEmployee.java

// Employeeinfo.java

public class Employeeinfo {
  
   public static void main(String[] args)
   {
       // create SalariedEmployee
       SalariedEmployee s = new SalariedEmployee(12, new Name("Shaun","Marsh"), new Date(11, 7, 1995), new Address("Street1","State1","City1",70081), 75000);

       // create HourlyEmployee without any overtime
       HourlyEmployee h1 = new HourlyEmployee(15, new Name("Harry","Doe"), new Date(7, 16, 2000), new Address("Street2","State2","City2",60181), 45.75, 35);

       // create HourlyEmployee with overtime
       HourlyEmployee h2 = new HourlyEmployee(25, new Name("Jerry","Hope"), new Date(10, 16, 2007), new Address("Street3","State3","City3",80111), 45.75, 45);
      
       // display the details
       s.display();
       System.out.println();
       h1.display();
       System.out.println();
       h2.display();
   }

}


//end of Employeeinfo.java

In: Computer Science

List the owner's name of all male customers in the bank who have a ’Checking’ account....

  1. List the owner's name of all male customers in the bank who have a ’Checking’ account.
  2. Find all accounts associated with ’Alexander Felix’.
  3. For each account of the previous question, compute the Balance, and return a table that shows the account number, type, and balance for each account (hint: use UNION).
  4. The list of customer names that have transactions greater than or equal to one thousand dollars.

A) Answer this question using only nested queries (i.e., each select is over only one table).

B) Answer this query using joins.

DROP DATABASE IF EXISTS Bank;
CREATE DATABASE Bank;
USE Bank;

DROP TABLE IF EXISTS transaction;
DROP TABLE IF EXISTS customer;
DROP TABLE IF EXISTS account;


CREATE TABLE customer (
name VARCHAR(20),
sex CHAR(1),
ssn CHAR(9) NOT NULL,
phone CHAR(15),
dob DATE,
address VARCHAR(50),
PRIMARY KEY(ssn)

);
  
CREATE TABLE account (
number CHAR(16) UNIQUE NOT NULL,
open_date DATE,
type CHAR(20),
owner_ssn CHAR(9) NOT NULL,
PRIMARY KEY(number)
);
  
CREATE TABLE transaction (
id INT(20) UNIQUE NOT NULL,
amount DECIMAL(9,2),
tdate DATE,
type CHAR(10),
account_num CHAR(16),
PRIMARY KEY(id)
);


INSERT INTO customer VALUE ('John Adam', 'M', '512432341', '(438) 321-2553', '1987-11-15',NULL);
INSERT INTO customer VALUE ('Alexander Felix', 'M', '724432341', '(541) 321-8553', '1991-05-22', NULL);
INSERT INTO customer VALUE ('Andrew William', 'M', '861894272', '(308) 692-1110', '1995-01-04', NULL);
INSERT INTO customer VALUE ('Ana Bert', 'F', '844192241', '(203) 932-7000', '1982-12-07', '23 Boston Post Rd, West Haven, CT 06516');

INSERT INTO account VALUE ('1111222233331441', '2018-12-03', 'Checking', '861894272');
INSERT INTO account VALUE ('2111222233332442', '2019-01-06', 'Saving', '512432341');
INSERT INTO account VALUE ('3111222233333443', '2017-09-22', 'Checking', '844192241');
INSERT INTO account VALUE ('4111222233335444', '2016-04-11', 'Checking', '724432341');
INSERT INTO account VALUE ('5111222233339445', '2018-11-05', 'Saving', '724432341');
INSERT INTO transaction VALUE (1001, 202.50, '2019-08-15', 'Deposit', '5111222233339445');
INSERT INTO transaction VALUE (1002, 100.00, '2019-09-21', 'Deposit','2111222233332442');
INSERT INTO transaction VALUE (1003, 200.00, '2019-09-29', 'Deposit', '2111222233332442');
INSERT INTO transaction VALUE (1004, 50.00, '2019-09-29', 'Deposit', '2111222233332442');
INSERT INTO transaction VALUE (1005, 1000.00, '2019-09-29', 'Deposit','3111222233333443');
INSERT INTO transaction VALUE (1006, -202.50, '2019-08-29', 'Withdraw', '5111222233339445');
INSERT INTO transaction VALUE (1007, 50.00, '2019-09-29', 'Deposit', '2111222233332442');
INSERT INTO transaction VALUE (1008, 50.00, '2019-09-29', 'Deposit', '2111222233332442');
INSERT INTO transaction VALUE (1009, -10.00, '2019-09-26', 'Withdraw', '2111222233332442');
INSERT INTO transaction VALUE (1010, 50.00, '2019-09-29', 'Deposit', '4111222233335444');
INSERT INTO transaction VALUE (1011, 320.00, '2019-09-29', 'Deposit', '5111222233339445');
INSERT INTO transaction VALUE (1012, 50.00, '2019-09-18', 'Deposit', '4111222233335444');
INSERT INTO transaction VALUE (1013, 5000.00, '2019-06-21', 'Deposit', '1111222233331441');
INSERT INTO transaction VALUE (1014, -100.00, '2019-09-02', 'Withdraw', '1111222233331441');
INSERT INTO transaction VALUE (1015, -200.00, '2019-09-08', 'Withdraw', '1111222233331441');

In: Computer Science

Questions Q1. Briefly discuss the factors of production and their roles in economic systems. (5 Marks)  ...

Questions

Q1. Briefly discuss the factors of production and their roles in economic systems.   

Q2. Based on your knowledge of the staffing and Leading process, discuss in 500 words some amendments could be applied to improve the performance within Coast Coffee.

Costa Coffee

Costa Coffee was founded in London in 1971 by two Brothers Bruno and Sergio Costa as a wholesale operation supplying roasted coffee to caterers and specialist Italian coffee shops. Acquired by Whitbread in 1995, it was sold in 2019 to The Coca-Cola Company in a deal worth £3.9bn and has grown to 3,401 stores across 31 countries and 18,412 employees. The business has 2,121 UK restaurants, over 6,000 Costa Express vending facilities and a further 1,280 outlets overseas (460 in China). The Coca-Cola Company announced its intention of acquiring Costa Limited from parent company Whitbread PLC for $5.1 billion. The deal, which closed on 3 January 2019, gives the cola giant a strong coffee platform across parts of Europe, Asia Pacific, the Middle East, and Africa. It is the second largest coffeehouse chain in the world, and the largest in the UK.

Costa Coffee operates 2,467 outlets in the United Kingdom as of October 2019. Overseas, it operates 1,413 stores in 32 countries. The first Costa store outside the UK opened in the UAE in 1999 and, in September 2017, was the first coffee shop worldwide to start delivering coffee via drones to customers sunbathing on Dubai's beaches. Following Whitbread's £59.5m acquisition of Coffee Nation, a chain of coffee machines, the machines were re-branded as Costa Express. The company plans to expand to target hospitals, universities and transport interchanges. In Denmark, Costa Express machines are located in Shell stations. In the UK, grocery store chain SPAR has become a major operator of petrol station stores, most of which have Costa Express machines installed

On 19 August 2019 Costa Coffee attracted media attention due to claims of unfair deductions from the pay of its employees. Reports stated that current and former employees had £200 deducted from their pay for training as well as additional deductions for till discrepancies and running costs. Claims of unfair deductions were triggered by a Twitter post suggesting that staff at a Costa store were forced to reimburse money lost to scammers who came into the store. Trying to distance themselves from the controversy, Costa said contracts for franchise stores are managed by partners and that some staff contracts did have "clauses relating to deductions".

On 23 August additional claims appeared in the media that Costa Coffee franchise workers are "not treated like humans". The report included managers' alleged refusal to pay for sickness or annual leave, working outside of contracted hours and the retention of tips. It cited an anonymous former employee at a store under Goldex Essex Investments Ltd who claimed they had almost £1,000 of their holiday pay deducted from their salary, despite being contracted to work 48 hours a week. The report went on to say that baristas and employees at managerial level have complained about the numerous deductions outlined in Costa Coffee contracts written by franchise partners. A former manager is quoted as saying she had £150 deducted from her wages because she was five minutes late opening the store. Other fines outlined in the contracts were for used uniform that was damaged when returned to the employer, excessive waste and till discrepancies. In response to this article a Costa Coffee spokesperson said an independent audit has been launched.

In: Economics