In: Computer Science
PYTHON - You are given a data.csv file in the /root/customers/ directory containing information about your customers. It has the following columns: ID,NAME,CITY,COUNTRY,CPERSON,EMPLCNT,CONTRCNT,CONTRCOST where ID: Unique id of the customer NAME: Official customer company name CITY: Location city name COUNTRY: Location country name CPERSON: Email of the customer company contact person EMPLCNT: Customer company employees number CONTRCNT: Number of contracts signed with the customer CONTRCOST: Total amount of money paid by customer (float in format dollars.cents) Read and analyze the data.csv file, and output the answers to these questions: How many total customers are in this data set? How many customers are in each city? How many customers are in each country? Which country has the largest number of customers' contracts signed in it? How many contracts does it have? How many unique cities have at least one customer in them? The answers should be formatted as: Total customers: Customers by city: : : ... Customers by country: : : ... Country with most customers' contracts: USA ( contracts) Unique cities with at least one customer: The answers for Customers by city and Customers by country must be sorted by CITY and COUNTRY respectively, in ascending order. If there are several cities that are tied for having the most customers' contracts, print the lexicographically bigger one.
In: Computer Science
Identify every possible primary key, candidate key, and foreign key for the following relations. Separate each key using a semicolon to avoid confusion.
Assumptions: MIScompany has branches located in several states within the United States. A customer can be an individual or organization. driverId is the driving license number, ssno is the social security number and upc is the universal product code. Any equipment is rented and returned at the same branch. A customer can be a manufacturer and vice versa. (Minus 1 point for each wrong answer)
MIScompany (name, address, phone, email, FedTaxId, StaTaxId)
Primary key:
Candidate key:
Foreign key: none
branch (branchId, name, address, phone, email, FedTaxId, StaTaxId)
Primary key:
Candidate key:
Foreign key:
employee (empId, driverId, ssno, name, branchId)
Primary key:
Candidate key:
Foreign key:
customer (custId, name, address, driverId, ssno, FedTaxId, StaTaxId)
Primary key:
Candidate key:
Foreign key:
equipment (equipId, type, upc, purchaseDate, year, manufacturId, cost, rentFee, branchId)
Primary key:
Candidate key:
Foreign key:
manufacturer (manufacturId, name, FedTaxId, StaTaxId, phone, email)
Primary key:
Candidate key:
Foreign key:
rental (rentalId, equipId, custId, rentDate&time, returnDate&time, empId, branchId)
Primary key:
Candidate key:
Foreign key: equipId;
In: Computer Science
We will extend project 2 by wrapping our input and output in a while loop. Repeatedly do the following:
Prompt the user for their name, get and store the user input.
Prompt the user for their age, get and store the user input. We will assume that the user will enter a positive integer and will do no error checking for valid input.
Determine and store a movie ticket price based on the user's age. If their age is 12 or under, the ticket price is $5. If their age is between 13 and 64, inclusive, the ticket price is $10. If their age is 65 or greater, the ticket price is $8.
When all the user input has been gathered, print out a meaningful label such as 'Name: ' followed by the entire user name on one line. On the next line, print out a meaningful label such as 'Age: ' followed by the user's age. On the next line, print out a meaningful label such as 'Ticket Price: ' followed by the ticket price your program calculated. Your output should look something like this:
Name: Mickey M Mouse
Age: 19
Ticket Price: $10
Now prompt the user asking if they would like to enter another ticket buyer's name. If they answer 'y' for yes, perform the loop again getting the input from the user, calculate the ticket price, and output the information. If the user answers anything other than 'y' the loop should exit.
in Python please
In: Computer Science
I am getting the following error: SalaryCalc.java:41: error: variable shift might not have been initialized if(shift==0) ^ 1 error
Please FIX
This is my Java code:
import java.util.Scanner;
public class SalaryCalc
{
double Rpay=0, Opay=0;
void calPay(double hours, double rate){
if(hours<=40){
Rpay = hours * rate;
Opay = 0;
}
else {
double Rhr,Ohr;
Rhr = 40;
Ohr = hours-Rhr;
Rpay = Rhr * rate;
Opay = Ohr * (1.5*rate);
}
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String name;
int shift;
Double rate, hours;
System.out.println("Pay Calculator");
System.out.println("Enter Your Name");
name=sc.next();
System.out.println("Enter Your Shift, Enter 0 for Day, Enter1 for
Night");
System.out.println("0=Day, 1= Night");
System.out.println("Enter Number of Hours Worked");
hours=sc.nextDouble();
System.out.println("Enter Hourly Pay");
rate=sc.nextDouble();
SalaryCalc c= new SalaryCalc();
c.calPay(hours,rate);
Double Tpay= c.Rpay+ c.Opay;
System.out.println();
System.out.println("Calculate Pay");
System.out.println("Employee Name: "+name);
System.out.println("Employee Regular Pay: "+c.Rpay);
System.out.println("Employee Overtime Pay: "+c.Opay);
System.out.println("Employee Total Pay: "+Tpay);
if(shift==0)
{
System.out.println("Employee PayPeriod is Friday");
}
else{
System.out.println("Employee PayPeriod is Saturday");
}
}
}
In: Computer Science
Updating the following Java program below, I need to continue to take input for every employee in a company, and display their information until a sentinel value is entered that exits the loop and ends the program
import java.util.Scanner;
public class SalaryCalc
{
double Rpay=0, Opay=0;
void calPay(double hours, double rate)
{
if(hours<=40)
{
Rpay = hours * rate;
Opay = 0;
}
else
{
double Rhr,Ohr;
Rhr = 40;
Ohr = hours-Rhr;
Rpay = Rhr * rate;
Opay = Ohr * (1.5*rate);
}
}
public static void main(String[] args)
{
Scanner sc = new Scanner(System.in);
String name;
int shift = 0;
Double rate, hours;
System.out.println("Pay Calculator");
System.out.println("Enter Your Name");
name=sc.next();
System.out.println("Enter Your Shift, Enter 0 for Day, Enter1 for
Night");
System.out.println("0=Day, 1= Night");
System.out.println("Enter Number of Hours Worked");
hours=sc.nextDouble();
System.out.println("Enter Hourly Pay");
rate=sc.nextDouble();
SalaryCalc c= new SalaryCalc();
c.calPay(hours,rate);
Double Tpay= c.Rpay+ c.Opay;
System.out.println();
System.out.println("Calculate Pay");
System.out.println("Employee Name: "+name);
System.out.println("Employee Regular Pay: "+c.Rpay);
System.out.println("Employee Overtime Pay: "+c.Opay);
System.out.println("Employee Total Pay: "+Tpay);
if(shift==0)
{
System.out.println("Employee PayPeriod is Friday");
}
else
{
System.out.println("Employee PayPeriod is Saturday");
}
}
}
In: Computer Science
In: Computer Science
#Below is a class representing a person. You'll see the
#Person class has three instance variables: name, age,
#and GTID. The constructor currently sets these values
#via a calls to the setters.
#
#Create a new function called same_person. same_person
#should take two instances of Person as arguments, and
#returns True if they are the same Person, False otherwise.
#Two instances of Person are considered to be the same if
#and only if they have the same GTID. It does not matter
#if their names or ages differ as long as they have the
#same GTID.
#
#You should not need to modify the Person class.
class Person:
def __init__(self, name, age, GTID):
self.set_name(name)
self.set_age(age)
self.set_GTID(GTID)
def set_name(self, name):
self.name = name
def set_age(self, age):
self.age = age
def set_GTID(self, GTID):
self.GTID = GTID
def get_name(self):
return self.name
def get_age(self):
return self.age
def get_GTID(self):
return self.GTID
#Add your code below!
#Below are some lines of code that will test your
function.
#You can change the value of the variable(s) to test your
#function with different inputs.
#
#If your function works correctly, this will originally
#print: True, then False.
person1 = Person("David Joyner", 30, 901234567)
person2 = Person("D. Joyner", 29, 901234567)
person3 = Person("David Joyner", 30, 903987654)
print(same_person(person1, person2))
print(same_person(person1, person3))
In: Computer Science
In: Biology
Which of the following circumstances illustrates the aggregate theory of partnership law?
Group of answer choices
A lawsuit being required to name the partners individually as defendants
The partnership going through a dissociation upon the death of a partner
The partnership filing for bankruptcy
The partnership being allowed to hold property in its own name
None of the above circumstances illustrates the aggregate theory.
In: Operations Management