Step 4: Create a class called BabyNamesDatabase
This class maintains an ArrayList of BabyName objects.
Instance Variables
Constructor
Mutator Methods
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
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
public class BabyName implements Comparable{
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);
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
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
In: Nursing
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 ) ;
#endifIn: Computer Science
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 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 {
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
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.
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
Refer to the Baseball 2016 data, which reports information on the 2016 Major League Baseball season. Let attendance be the dependent variable and total team salary be the independent variable. Determine the regression equation and answer the following questions.
Draw a scatter diagram. From the diagram, does there seem to be a direct relationship between the two variables?
What is the expected attendance for a team with a salary of $100.0 million?
If the owners pay an additional $30 million, how many more people could they expect to attend?
At the .05 significance level, can we conclude that the slope of the regression line is positive? Conduct the appropriate test of hypothesis.
What percentage of the variation in attendance is accounted for by salary?
Determine the correlation between attendance and team batting average and between attendance and team ERA. Which is stronger? Conduct an appropriate test of hypothesis for each set of variables.
Show all work in Excel
| Team | League | Year Opened | Team Salary | Attendance | Wins | ERA | BA | HR | Year | Average salary | ||
| Arizona | National | 1998 | 65.80 | 2080145 | 79 | 4.04 | 0.264 | 154 | 2000 | 1988034 | ||
| Atlanta | National | 1996 | 89.60 | 2001392 | 67 | 4.41 | 0.251 | 100 | 2001 | 2264403 | ||
| Baltimore | American | 1992 | 118.90 | 2281202 | 81 | 4.05 | 0.250 | 217 | 2002 | 2383235 | ||
| Boston | American | 1912 | 168.70 | 2880694 | 78 | 4.31 | 0.265 | 161 | 2003 | 2555476 | ||
| Chicago Cubs | National | 1914 | 117.20 | 2959812 | 97 | 3.36 | 0.244 | 171 | 2004 | 2486609 | ||
| Chicago Sox | American | 1991 | 110.70 | 1755810 | 76 | 3.98 | 0.250 | 136 | 2005 | 2632655 | ||
| Cincinnati | National | 2003 | 117.70 | 2419506 | 64 | 4.33 | 0.248 | 167 | 2006 | 2866544 | ||
| Cleveland | American | 1994 | 87.70 | 1388905 | 81 | 3.67 | 0.256 | 141 | 2007 | 2944556 | ||
| Colorado | National | 1995 | 98.30 | 2506789 | 68 | 5.04 | 0.265 | 186 | 2008 | 3154845 | ||
| Detroit | American | 2000 | 172.80 | 2726048 | 74 | 4.64 | 0.270 | 151 | 2009 | 3240206 | ||
| Houston | American | 2000 | 69.10 | 2153585 | 86 | 3.57 | 0.250 | 230 | 2010 | 3297828 | ||
| Kansas City | American | 1973 | 112.90 | 2708549 | 95 | 3.73 | 0.269 | 139 | 2011 | 3305393 | ||
| LA Angels | American | 1966 | 146.40 | 3012765 | 85 | 3.94 | 0.246 | 176 | 2012 | 3440000 | ||
| LA Dodgers | National | 1962 | 230.40 | 3764815 | 92 | 3.44 | 0.250 | 187 | 2013 | 3650000 | ||
| Miami | National | 2012 | 84.60 | 1752235 | 71 | 4.02 | 0.260 | 120 | 2014 | 3950000 | ||
| Milwaukee | National | 2001 | 98.70 | 2542558 | 68 | 4.28 | 0.251 | 145 | 2015 | 4250000 | ||
| Minnesota | American | 2010 | 108.30 | 2220054 | 83 | 4.07 | 0.247 | 156 | ||||
| NY Mets | National | 2009 | 100.10 | 2569753 | 90 | 3.43 | 0.244 | 177 | ||||
| NY Yankees | American | 2009 | 213.50 | 3193795 | 87 | 4.05 | 0.251 | 212 | ||||
| Oakland | American | 1966 | 80.80 | 1768175 | 68 | 4.14 | 0.251 | 146 | ||||
| Philadelphia | National | 2004 | 133.00 | 1831080 | 63 | 4.69 | 0.249 | 130 | ||||
| Pittsburgh | National | 2001 | 85.90 | 2498596 | 98 | 3.21 | 0.260 | 140 | ||||
| San Diego | National | 2004 | 126.60 | 2459742 | 74 | 4.09 | 0.243 | 148 | ||||
| San Francisco | National | 2000 | 166.50 | 3375882 | 84 | 3.72 | 0.267 | 136 | ||||
| Seattle | American | 1999 | 123.20 | 2193581 | 76 | 4.16 | 0.249 | 198 | ||||
| St. Louis | National | 2006 | 120.30 | 3520889 | 100 | 2.94 | 0.253 | 137 | ||||
| Tampa Bay | American | 1990 | 74.80 | 1287054 | 80 | 3.74 | 0.252 | 167 | ||||
| Texas | American | 1994 | 144.80 | 2491875 | 88 | 4.24 | 0.257 | 172 | ||||
| Toronto | American | 1989 | 116.40 | 2794891 | 93 | 3.8 | 0.269 | 232 | ||||
| Washington | National | 2008 | 174.50 | 2619843 | 83 | 3.62 | 0.251 | 177 |
In: Math
Jamie and Cecilia Reyes are husband and wife and file a joint return. They live at 5677 Apple Cove Road, Boise ID 83722. Jaime’s social security number is 412-34-5670 (date of birth 6/15/1969) and Cecilia’s is 412-34-5671 (date of birth 4/12/1971). They provide more than half of the support of their daughter, Carmen (age 23). Social security number 412-34-5672. (date of birth 9/1/1995), who is a full-time veterinarian school student. Carmen received a $3,200 scholarship covering her room and board at college. She was not required to perform any services to receive the scholarship. Jaime and Cecilia furnish all of the support of Maria (Jamie’s grandmother), Social Security number 412-34-5673 (date of birth 11/6/1948), who is age 70 and lives in a nursing home. They also have a son, Gustavo (age 4), social security number 412-34-5674 (date of birth 3/14/2014). The Reyes and all of their dependents had qualifying health care coverage at all time during the tax year.
Jaime’s W-2 contained the following information:
Federal Wages (box 1) = $145,625.00
Federal W/H (box 2) = $ 16,112.25
Social Security wages (box 3) = $128,400.00
Social Security W/H (box 4) = $7,960.80
Medicare Wages (box 5) = $145,625.00
Medicare W/H (box 6) = $2,111.56
State Wages (box 16) = $145,625.00
State W/H (box 17) = $5.435.00
Other receipts for the couple were as follows:
Dividends (all qualified dividends) $2,500
Interest Income:
Union Bank $ 220
State of Idaho – Interest on tax refund $22
City of Boise School bonds $1,250
Interest from U.S savings bonds $410 (not used for educational purposes)
2017 federal income tax refund received in 2018 $2,007
2017 state income tax refund received in 2018 $218
Idaho lottery winnings $1,100
Casino slot machine winnings $2,250
Gambling losses at casino $6,500
Other information that the Reyeses provided for the 2018 tax year:
Mortgage interest on personal residence $11,081
Loan interest on fully equipped motor home $3,010
Doctor’s fee for a face lift for Mr. Reyes $8,800
Dentist’s fee for a new dental bridge for Mr. Reyes $3,500
Vitamins for the entire family $110
Real estate property taxes paid $5,025
DMV fees on motor home (tax portion) $1,044
DMV fees on family autos (tax portion) $436
Doctor’s bills for grandmother $2,960
Nursing Home for grandmother $10,200
Wheelchair for grandmother $1,030
Property Taxes on boat $134
Interest on personal credit card $550
Interest on loan to buy public school district bonds $270
Cash contributions to church (all contributions) $6,100
Were in cash and none more than $250 at any one time)
Cash contribution to man at bottom of freeway off-ramp $25
Contribution of furniture to Goodwill -cost basis $4,000
Contribution of same furniture to listed above Goodwill -Fair market Value $410
Tax Return preparation fee for 2017 taxes $625
Required
Prepare a Form 1040 and appropriates schedules, Schedule A and Schedule B for the completion of the Reyes’s tax return. They do not want to contribute to the Presidential election campaign and do not want anyone to be a third-party designee. For any missing information, make reasonable assumptions. They had qualifying health coverage at all times during the year.
In: Accounting