Questions
A 0.41 μF and a 0.65 μF capacitor are connected in series to a 15 V...

A 0.41 μF and a 0.65 μF capacitor are connected in series to a 15 V battery.

Part A] Calculate the potential difference across each capacitor.

Part B] Calculate the charge on each capacitor.

Part C] Repeat part A assuming the two capacitors are in parallel.

Part D] Repeat part B assuming the two capacitors are in parallel.

In: Physics

In the case of Kimbrell’s of Sanford, Inc. v. KPS, Inc.: a. Kimbrell’s was required to...

In the case of Kimbrell’s of Sanford, Inc. v. KPS, Inc.:

a. Kimbrell’s was required to file a financing statement to perfect it security interest.

b. Burns signed a security agreement granting Kimbrell’s a purchase money security interest in the VCR.

c. Kimbrell’s was not entitled to recover possession of the VCR when it filed its cause of action.

d. Kimbrell’s filed a financial statement to perfect its purchase money security interest in the VCR.

In: Accounting

A 14.7 μF capacitor is charged to a potential of 55.0 V and then discharged through...

A 14.7 μF capacitor is charged to a potential of 55.0 V and then discharged through a 75.0 Ω resistor.

(a) How long after discharge begins does it take for the capacitor to lose 90.0% of the following?

(i) its initial charge: _______s

(ii) its initial energy: _______s


(b) What is the current through the resistor at both times in part (a)?

(i) at tcharge: ________A

(ii) at tenergy: ________A

In: Physics

Class Employee (All IN JAVA) public class Employee {public String strName, strSalary; public Employee(){strName = "...

Class Employee (All IN JAVA)

public class Employee

{public String strName, strSalary;

public Employee(){strName = " ";strSalary = "$0";}

public Employee(String Name, String Salary){strName = Name;strSalary = Salary;}

public void setName(String Name){strName = Name;}

public void setSalary(String Salary){strSalary = Salary;}public String getName(){return strName;}

public String getSalary(){return strSalary;}

public String toString(){return(strName + " has a salary of " + strSalary);

Create another method to return the name and salary nicely formatted as a string (hint – research the toString method).

You will create a new class called Manager that inherits from the class Employee. Add a field named department of type String. Supply a method toString that prints the manager's name, department, and salary. Remember, you may not change anything in the Employee class.

You will then create a test class that uses the Manager class.   The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of 3 employee records, the program should output the information you entered.

Your program should be able to handle a maximum of 3 entries.

You may write the program as a console application or using dialog boxes.

Create another method to return the name and salary nicely formatted as a string (hint – research the toString method).You will create a new class called Manager that inherits from the class Employee. Add a field named department of type String. Supply a method toString that prints the manager's name, department, and salary. Remember, you may not change anything in the Employee class.You will then create a test class that uses the Manager class. The test class should prompt the user to enter name, department and salary. This information should be stored in an array. Upon entry of 3 employee records, the program should output the information you entered.Your program should be able to handle a maximum of 3 entries.You may write the program as a console application or using dialog boxes.

In: Computer Science

In JAVA : There are two text files with the following information stored in them: The...

In JAVA :

There are two text files with the following information stored in them:

The instructor.txt file where each line stores the id, name and affiliated department of an instructor separated by a comma The department.txt file where each line stores the name, location and budget of the department separated by a comma

You need to write a Java program that reads these text files and provides user with the following menu:

1. Enter the instructor ID and I will provide you with the name of the instructor, affiliated department and the location of that department.

2. Enter the department name and I will provide you with the location, budget and names of all instructors that work for the department.

3. Insert a record about a new instructor.

4. Exit

The above menu should continue to be displayed in a loop until the user selects option 4.

When the user selects option 1 above, the following should be displayed:

Enter the instructor ID:

If the user enters an instructor id that is not present in the text file, display "The ID doesnot appear in the database.", otherwise, display the name of the instructor, affiliated department and the location of that department.

When the user selects option 2 above, the following should be displayed:

Enter the department name:

If the user enters a name that is not present in the text file, display "The department name doesnot appear in the database.", otherwise, display the location, budget and names of all instructors that work for the department.

If the user selects option 3 above, display the following:

Enter the instructor id:

Enter the instructor name:

Enter the affiliated department name:

Once the user enters the above information, store the information in the instructor file only if the following two conditions are met: 1. The department already exists in the department file. If not, display "The department doesnot exist and hence the instructor record cannot be added to the database". 2. The instructor id should not already be present in the file. If so, display "Instructor id already exists in the file"

The program should work for any number of rows in the two text files.

The code should use good programming practices with sensible variable names, proper indentation and comments where needed.

In: Computer Science

DO NOT ANSWER THIS[1. Write a program named filemaker.py that will be used to store the...

DO NOT ANSWER THIS[1. Write a program named filemaker.py that will be used to store the first name and age of some friends in a text file named friends.txt. The program must use a while loop that prompts the user to enter the first name and age of each friend. Each of these entries should be written to its own line in the text file (2 lines of data per friend). The while loop should repeat until the user presses Enter (Return on a Mac) for the name. Then, the file should be closed and a message should be displayed. See Sample Output. SAMPLE OUTPUT Enter first name of friend or Enter to quit Denny Enter age (integer) of this friend 24 Enter first name of friend or Enter to quit Penny Enter age (integer) of this friend 28 Enter first name of friend or Enter to quit Lenny Enter age (integer) of this friend 20 Enter first name of friend or Enter to quit Jenny Enter age (integer) of this friend 24 Enter first name of friend or Enter to quit File was created] DO NOT ANSWER THIS

Code for the above program

fp = open("friends.txt", "w")

firstname = input("Enter first name of friend or Enter to quit ")

while firstname!="":

age = int(input("Enter age (integer) of this friend "))

print(firstname, file=fp)

print(age, file=fp)

firstname = input("Enter first name of friend or Enter to quit ")

fp.close()

print("File was Created")

the QUESTION IN PYTHON

Now write a program named filereader.py that reads and displays the data in friends.txt. This program should also determine and print the average age of the friends on file. That will require an accumulator and a counter. Use a while loop to process the file, print the data, and modify the accumulator and counter. Then close the file and display the average age accurate to one decimal place. See the Sample Output..
SAMPLE OUTPUT

My friend Denny is 24
My friend Penny is 28
My friend Lenny is 20
My friend Jenny is 24
Average age of friends is 24.0

In: Computer Science

B) DML and SQL Query For this DB Schema, answer the below questions: Employee (Fname, Minit,...

B) DML and SQL Query
For this DB Schema, answer the below questions:
Employee (Fname, Minit, Lname, Ssn, Bdate, Address, Sex, Salary, Super_ssn, Dno)
Department (Dname, Dnumber, Mgr_ssn, Mgr_start_date)

5. Delete from Employee table, those who have First name: James.
6. Delete from Employee table, those who have Salary more than 4000.
7. What happens if you try to delete one department?
8. Retrieve the data of all employee.
9. Retrieve the data of all male employee.
10. Retrieve the Fname, Lname of all male employee.
11. Retrieve the Fname, Lname and Salary of all employee
12. Retrieve the Fname, Lname and Salary of all employee with Salary more than 4000
13. Retrieve the Fname, Lname and Salary of all female employee with Salary more than 4000
14. Retrieve the Fname, Lname and Address of all female employee with Salary more than 4000 and Birthdate after 1-1-1990.
15. Retrieve the Address and Salary of all employee with Fname = John or James.
16. Retrieve the Address and Salary of all employee with Fname = John or Birthdate after 1-1-1990
17. Retrieve the Name and Number of all Departments
18. Retrieve the Name and Number of all Departments with Manager SSN=123456
19. Retrieve the Employee Fname, Lnameand Department number for all employees.
20. Retrieve the Employee Fname, Lnameand Department number and Department Name for all employees.
21. Retrieve the Employee Fname, Lnameand who works in Department name = Research
22. Retrieve the Employee Fname, Lnameand who works in Department name = Research and IT
23. Retrieve the Employee Fname, Lnameand who works in Department name = Research OR IT
24. Retrieve the Department Name ,Number , Manager SSN
25. Retrieve the Department Name ,Number , Manager SSN, Manager FName
26. Retrieve the Department Name, Manager SSN, Manager FName for departments with Manager Start Date > 1-1-2010
please write it in computer word not pin and thank you

In: Computer Science

Question: you will be making a game called “Snap, Crackle, Pop”, a game typically played with...

Question: you will be making a game called “Snap, Crackle, Pop”, a game typically played with a group of 3 persons. Each person chooses one number and it is assigned to either 'snap', 'crackle', or 'pop'. Then the number of rounds is decided (e.g. 12). The players play the game for the predetermined number of rounds (here 12). In each round:

● if the number of the round is a multiple of the snap number, the person who chose the number will say 'snap' instead of the number of the round.

● if it is a multiple of the crackle number, they will say 'crackle' instead.

● if it is a multiple of the pop number, they will say 'pop' instead.

● if it is any combination of the three, they will say 'snapcrackle', 'snappop', 'cracklepop', or 'snapcracklepop' instead of the number of the round, depending on which of the snap, crackle, and pop numbers the current number of the round is a multiple of.

● if the number is not a multiple of snap, crackle, or pop, then the number of the round is said instead.

code to edit:

//TODOa complete this javadoc comment
/**
* [The class description]
* @author [Your Name]
* @version 1.0
*/

//TODO1: declare the SnapCracklePop class

//TODOb Complete Comments
/**
* [Instance Variable Descriptions]
*/

//TODO2 Declare private instance variables
//to store Snap, Crackle, and Pop values


//TODOc complete comments
/**
* [Constructor Description]
* @param [param name] [what the param represents]
* @param [param name] [what the param represents]
* @param [param name] [what the param represents]
*/
  
/* The constructor takes in three ints,
* which must be assigned to their instance variables and initialized.
*/

//TODO3 Write the constructor


//TODOe complete comments
/**
* [Method Description]
* @param [param name] [What the parameter represents]
* @return [What the method returns]
*/

/* playRound() is a helper method for playGame().
* It takes an int parameter representing the
* current round of play, and returns the
* String result for that specific round only.
*/

//TODO4 implement the playRound method


//TODOd complete comments
/**
* [Method Description]
* @param [param name] [What the parameter represents]
* @return [What the method returns]
*/

/* playGame() takes a single parameter representing the rounds and returns
* a String representing the result of the entire game. The helper method
* playRound() may be useful here, so you may want to complete it first.
*/

//TODO5 implement the playGame method
  
//Loop through the rounds of the game
//call playRound to handle the specific round
//return the total aggregated game results

//TODOf complete comments
/**
* [Method Description]
* @return [What this method returns]
*/

//TODO6 implement the getSnap method

//TODOg complete comments
/**
* [Method Description]
* @return [What this method returns]
*/

//TODO7 implement the getCrackle method

//TODOh complete comments
/**
* [Method Description]
* @return [What this method returns]
*/

//TODO8 implement the getPop method

//end class

code not to edit:

import java.util.*;

public class SnapCracklePopMain{

public static void main(String[] args){
  
// The scanner we will be using to accept user input
Scanner scan = new Scanner(System.in);
/* Initializing snap, crackle, pop, and round to invalid values to cause them
* to enter their respective User Input loops.
*/
int snap = -1;
int crackle = -1;
int pop = -1;
int rounds = -1;
  
// Our SnapCracklePop object
SnapCracklePop scp;
  
// Capture user input for snap, while also ensuring correctness
System.out.println("Enter an integer for your snap number.");
while(snap < 0){
System.out.println("Please enter a number greater than zero:");
try{
snap = Integer.parseInt(scan.nextLine());
} catch (Exception e) {
System.out.println("That is not a valid number. Please enter an integer greater than zero.");
}
}
  
// Capture user input for crackle, while also ensuring correctness
System.out.println("Enter an integer for your crackle number.");
while(crackle < 0){
System.out.println("Please enter a number greater than zero:");
try{
crackle = Integer.parseInt(scan.nextLine());
} catch(Exception e) {
System.out.println("That is not a valid number. Please enter an integer greater than zero.");
}
}
  
// Capture user input for pop, while also ensuring correctness
System.out.println("Enter an integer for your pop number.");
while(pop < 0){
System.out.println("Please enter a number greater than zero:");
try{
pop = Integer.parseInt(scan.nextLine());
} catch(Exception e) {
System.out.println("That is not a valid number. Please enter an integer greater than zero.");
}
}
  
// Initializing our SnapCracklePop object with the values we just obtained from the user
scp = new SnapCracklePop(snap, crackle, pop);
  
// Capture user input for rounds, while also ensuring correctness
System.out.println("How many rounds would you like to play?");
while(rounds < 0){
System.out.println("Please enter a number greater than zero:");
try{
rounds = Integer.parseInt(scan.nextLine());
} catch(Exception e) {
System.out.println("That is not a valid number. Please enter an integer greater than zero.");
}
}
  
// Printing results
System.out.println("Results:");
System.out.println(scp.playGame(rounds));

}

}

In: Computer Science

Make Animal an abstract class. Create a Kennel Class Create 2-3 Dog objects Create 2-3 Cat...

Make Animal an abstract class.

  • Create a Kennel Class
    • Create 2-3 Dog objects
    • Create 2-3 Cat objects
  • Put your Dog and Cat objects in an Array of Animals
  • Loop over your Animals and print the animal with Species, Age, and the status of the appropriate vaccines.

Using the code below:

public class Animal {
    //Declaring instance variables
    private int age;
    private boolean RabiesVaccinationStatus;
    private String name;
    private String ownerName;

    //Zero argumented constructor
    public Animal() {

    }
    //Parameterized constructor
    public Animal(int age, boolean rabiesVaccinationStatus, String name,
                  String ownerName) {
        this.age = age;
        RabiesVaccinationStatus = rabiesVaccinationStatus;
        this.name = name;
        this.ownerName = ownerName;
    }

    // getters and setters
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public boolean isRabiesVaccinationStatus() {
        return RabiesVaccinationStatus;
    }

    public void setRabiesVaccinationStatus(boolean rabiesVaccinationStatus) {
        RabiesVaccinationStatus = rabiesVaccinationStatus;
    }

    public String getName() {
        return name;
    }

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

    public String getOwnerName() {
        return ownerName;
    }

    public void setOwnerName(String ownerName) {
        this.ownerName = ownerName;
    }

    //toString method is used to display the contents of an object inside it
    public String toString() {
        return "Age :" + age + ", Rabies Vaccination Status :"
                + RabiesVaccinationStatus + ", Name :" + name
                + ", Owner Name :" + ownerName;
    }

}


// Dog.java

class Dog extends Animal {
    //Declaring instance variables
    private boolean distemperVaccinationStatus;

    //Parameterized constructor
    public Dog(boolean distemperVaccinationStatus) {
        this.distemperVaccinationStatus = distemperVaccinationStatus;
    }

    //Parameterized constructor
    public Dog(int age, boolean rabiesVaccinationStatus, String name,
               String ownerName, boolean distemperVaccinationStatus) {
        super(age, rabiesVaccinationStatus, name, ownerName);
        this.distemperVaccinationStatus = distemperVaccinationStatus;
    }

    // getters and setters
    public boolean isDistemperVaccinationStatus() {
        return distemperVaccinationStatus;
    }

    public void setDistemperVaccinationStatus(boolean distemperVaccinationStatus) {
        this.distemperVaccinationStatus = distemperVaccinationStatus;
    }

    //toString method is used to display the contents of an object inside it
    public String toString() {
        return "Dog :"+super.toString() + " Distemper Vaccination Status :"
                + distemperVaccinationStatus;
    }

    public void speak()
    {
        System.out.println("bark");
    }

}

// Cat,.java

class Cat extends Animal {
    //Declaring instance variables
    private boolean felineLeukemiaVaccinationStatus;
    private boolean declawedStatus;

    //Parameterized constructor
    public Cat(boolean felineLeukemiaVaccinationStatus, boolean declawedStatus) {
        this.felineLeukemiaVaccinationStatus = felineLeukemiaVaccinationStatus;
        this.declawedStatus = declawedStatus;
    }
    //Parameterized constructor
    public Cat(int age, boolean rabiesVaccinationStatus, String name,
               String ownerName, boolean felineLeukemiaVaccinationStatus,
               boolean declawedStatus) {
        super(age, rabiesVaccinationStatus, name, ownerName);
        this.felineLeukemiaVaccinationStatus = felineLeukemiaVaccinationStatus;
        this.declawedStatus = declawedStatus;
    }

    // getters and setters
    public boolean isFelineLeukemiaVaccinationStatus() {
        return felineLeukemiaVaccinationStatus;
    }

    public void setFelineLeukemiaVaccinationStatus(
            boolean felineLeukemiaVaccinationStatus) {
        this.felineLeukemiaVaccinationStatus = felineLeukemiaVaccinationStatus;
    }

    public boolean isDeclawedStatus() {
        return declawedStatus;
    }

    public void setDeclawedStatus(boolean declawedStatus) {
        this.declawedStatus = declawedStatus;
    }

    //toString method is used to display the contents of an object inside it
    public String toString() {
        return "Cat :"+super.toString() + " Feline Leukemia Vaccination Status :"
                + felineLeukemiaVaccinationStatus + ", Declawed Status :"
                + declawedStatus;
    }

    public void speak()
    {
        System.out.println("Meow");
    }

}

In: Computer Science

Binary files are convenient to computers because they’re easily machine readable. Text files are human readable,...

Binary files are convenient to computers because they’re easily machine readable. Text files are human readable, but require parsing and conversion to process in the computer. Consider a class Person that has the following structure:

public class Student {
    private String name;
    private int age;
    private double gpa;

    public Student() {
    }

    public Student(String name, int age, double gpa) {
        this.name = name;
        this.age = age;
        this.gpa = gpa;
    }

    public String getName() {
        return this.name;
    }

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

    public int getAge() {
        return this.age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getGpa() {
        return this.gpa;
    }

    public void setGpa(double gpa) {
        this.gpa = gpa;
    }

    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("Student{");
        builder.append(String.format("%s=%s", "name", name));
        builder.append(String.format(",%s=%d", "age", age));
        builder.append(String.format(",%s=%.2f", "gpa", gpa));
        builder.append("}");
        return builder.toString();
    }
    
    @Override
    public boolean equals(Object obj) {
        if (obj != null && obj instanceof Student) {
            return equals((Student)obj);
        }
        return false;
    }
    
    public boolean equals(Student other) {
        if (other == null) {
            return false;
        }
        return name.equals(other.name) &&
            age == other.age &&
            Math.abs(gpa - other.gpa) < 0.0001;
    }
}

A number of student records were written out to a file using the toString() method given above. Roughly, they look like the following:

Student{name=Joe O'Sullivan,age=22,gpa=3.14}
Student(name=Jane Robinson,age=19,gpa=3.81}
....
Student{name=Jill Gall,age=21,gpa=2.98}

Your task is to implement a method that will return an array of Students based on a parameter file name that is passed into the method. You will open the text file, read lines, split lines into fields, and then call the setters based on the key/value pairs in the string. Fields will always be in the same order: name, age, gpa. The array should be exactly the same size as the number of lines in the file you are reading. At most, there will be 20 lines in the file. You should not throw any exceptions from the function. if the file doesn't exist, return a zero-length array.

Some hints:

  • You can use the File class to connect the name to the file on disk.
  • You can create a Scanner object by passing in the File to read lines.
  • You can use the split() method of String to take a line from the file and break it up based on delimiters You may need to do this multiple times (e.g. once on a comma, and then on an equals sign).
  • To convert from string data to integer data, use Integer.parseInt(). You can do the same with doubles and Double.parseDouble()

In: Computer Science