Questions
At very high temperature can following reaction occur. 2 CrSO4(s) ↔ Cr2O3(s) + SO2(g) + SO3(g)...

At very high temperature can following reaction occur.

2 CrSO4(s) ↔ Cr2O3(s) + SO2(g) + SO3(g)

Rate constant (Kp) is 0,36 with some temperature. In some experiment a CrSO4 is put in some container were partial pressure of SO3 is 1,00 atm. What is partial pressure of SO2 at equilibrium?

In: Chemistry

You want to study how a spinach sucrose transporter is regulated during plant development. Propose one...

You want to study how a spinach sucrose transporter is regulated during plant development. Propose one experiments that seek to understand one regulatory mechanism that might be involved. Made sure to include the following: what your experiment seeks to specifically understand? What are your controls and why each is needed? And, what are your expected results?

In: Biology

A Java question. You are given a Student class. A Student has a name and an...

A Java question. You are given a Student class. A Student has a name and an ArrayList of grades (Doubles) as instance variables.

Write a class named Classroom which manages Student objects.

You will provide the following:

1. public Classroom() a no-argument constructor.
2. public void add(Student s) adds the student to this Classroom (to an ArrayList
3. public String hasAverageGreaterThan(double target) gets the name of the first student in the Classroom who has an average greater than the target or the empty string. Do not use break. Do not return from the middle of the loop. Use a boolean flag if you need to terminate early.
4. public ArrayList<String> getStudents() gets an ArrayList<String> containing the names of all the Students in this Classroom.
5. public Student bestStudent() gets the Student with the highest average in this classroom or null there are no students
6. public String toString() gets a string represent ion using ArrayList's toString method

Provide Javadoc

-------------------------------------------------------------------------------------------------

ClassroomTester.java

import java.util.ArrayList;

public class ClassroomTester
{
public static void main(String[] args)
    {
       ArrayList<Double> grades1 = new ArrayList<>();
       grades1.add(82.0);
       grades1.add(91.5);
       grades1.add(85.0);
       Student student1 = new Student("Srivani", grades1);
      
       ArrayList<Double> grades2 = new ArrayList<>();
       grades2.add(95.0);
       grades2.add(87.0);
       grades2.add(99.0);
       grades2.add(100.0);
       Student student2 = new Student("Carlos", grades2);
       
       ArrayList<Double> grades3 = new ArrayList<>();
       grades3.add(100.0);
       grades3.add(98.0);
       grades3.add(100.0);
       grades3.add(97.0);
       Student student3 = new Student("Maria", grades3);
       
       ArrayList<Double> grades4 = new ArrayList<>();
       grades4.add(80.0);
       grades4.add(70.0);
       grades4.add(82.0);
       grades4.add(75.0);
       Student student4 = new Student("Fred", grades4);
       
       Classroom myClass = new Classroom();
       myClass.add(student1);
       myClass.add(student2);
       myClass.add(student3);
       myClass.add(student4);
       
       System.out.println(myClass);
       System.out.println("Expected: [[Student:name=Srivani,grades=[82.0, 91.5, 85.0]], [Student:name=Carlos,grades=[95.0, 87.0, 99.0, 100.0]], [Student:name=Maria,grades=[100.0, 98.0, 100.0, 97.0]], [Student:name=Fred,grades=[80.0, 70.0, 82.0, 75.0]]]");
       
       System.out.println(">90 GPA: " + myClass.hasAverageGreaterThan(90.0));
       System.out.println("Expected: Carlos");
       
       System.out.println(">99 GPA: " + myClass.hasAverageGreaterThan(99));
       System.out.println("Expected: ");
       
       Student best = myClass.bestStudent();
       if (best != null)
       {
          System.out.println(best.getName());
          System.out.println("Expected: Maria");
       }
       
       System.out.println(myClass.getStudents());
       System.out.println("Expected: [Srivani, Carlos, Maria, Fred]");
       
       //test with an empty classroom
       myClass = new Classroom();
       System.out.println(myClass);
       System.out.println("Expected: []");
       
       System.out.println(">90 GPA: " + myClass.hasAverageGreaterThan(90.0));
       System.out.println("Expected: ");
       
      
       best = myClass.bestStudent();
       if (best != null)
       {
          System.out.println(best.getName());
          
       }
       
       System.out.println(myClass.getStudents());
       System.out.println("Expected: []");
        
    }
}

Student.java

import java.util.ArrayList;
/**
 * Models a student with a name and collection
 * pf grades
 */
public class Student
{
    private String name;
    private ArrayList<Double> grades;

    /**
     * Constructor for Student with name 
     * and list of grades
     * @param name the name of the student
     * @param list the list of grades
     */
    public Student(String name, ArrayList<Double> list)
    {
        this.name = name;
        this.grades = list;
    }
    
    /**
     * Gets the name of the student
     * @return the student's name
     */
    public String getName()
    {
        return name;
    }
    
    /**
     * Gets the average of this student's grades
     * @return the average or 0 if there are no grades
     */
    public double getAverage()
    {
        double sum = 0;
        for ( double g : grades)
        {
            sum = sum + g;
        }
        
        double average = 0;
        if (grades.size() > 0)
        {
            average = sum / grades.size();
        }
        
        return average;
    }
    
    /**
     * @overrides
     */
    public String toString()
    {
        String s = "[Student:name=" + name 
           + ",grades=" + grades.toString() +"]";

        return s;
    }

}

In: Computer Science

In Java. Modify the attached GameDriver2 to read characters in from a text file rather than...

In Java. Modify the attached GameDriver2 to read characters in from a text file rather than the user. You should use appropriate exception handling when reading from the file. The text file that you will read is provided.

-------------------- Modify GaveDriver2.java --------------------

-----GameDriver2.java -----

import java.io.File;
import java.util.ArrayList;
import java.util.Scanner;

/**
* Class: GameDriver
*
* This class provides the main method for Homework 2 which reads in a
* series of Wizards, Soldier and Civilian information from the user
* and creates the objects
*
*/
public class GameDriver2
{

/**
* Main method- Starting point of program
*
* @param args
*/
public static void main(String[] args)
{

// create needed variables
ArrayList characters = new ArrayList();

// YOU CHANGE THIS LINE to opening file Characters.txt - use appropriate exception handling
// don't
// just throw the exception
Scanner in = new Scanner(System.in);

// End first change

// HERE IS CODE THAT READS A LINE AND CREATES APPROPRIATE CHARACTER

while (in.hasNextLine())
{
// read in a line and parse into various attributes
String line = in.nextLine();

// parse based on comma
String[] data = line.split(", ");
String type = data[0];
String name = data[1];
int strength = Integer.parseInt(data[2]);
String weapon = data[3];
int magic = Integer.parseInt(data[4]);
  
// use this data to build appropriate GameCharacter based on type and add to ArrayList
// YOU ADD THIS CODE

}
// print array before hits or healing
for (GameCharacter g : characters)
{
System.out.println(g);
}

System.out.println();
System.out.println("After soldier takes a hit and civilian is healed");

// print contents of arrayList
for (int i = 0; i < characters.size(); i++)
{
GameCharacter g = characters.get(i);
// if a civilian - heal them
if (g instanceof Civilian)
{
g.heal(5);
}
// else if a soldier - takes a hit
else if (g instanceof Soldier)
{
g.takeHit(5);
}

System.out.println(g);
}

}

}

----- GameCharacter.java -----

  


/**
* Class: GameCharacter
*
* This class provides a parent class for characters to be created for
* our game.
*
*/
public class GameCharacter {
   // attributes for all GameCharacters
   private String name;
   private int strength;

   /**
   * Name Setter
   *
   * @param name the name to set
   */
   public void setName(String name) {
       this.name = name;
   }

   /**
   * Strength setter method
   *
   * Makes sure strength is a legit value. Ignores otherwise
   *
   * @param strength the strength to set
   */
   public void setStrength(int strength) {
       if (strength > 0 && strength <= 18) {
           this.strength = strength;
       } else {
           this.strength = 12; // default number I made up
       }
   }

   /**
   * All arg constructor
   *
   * @param name
   * @param strength
   */
   public GameCharacter(String name, int strength) {
       super();
       this.name = name;
       setStrength(strength);
   }

   /**
   * No-arg (default) constructor
   */
   public GameCharacter() {
       this.strength = 15;
       this.name = "TBD";
   }

   /**
   * Getter method for name
   *
   * @return the name
   */
   public String getName() {
       return name;
   }

   /**
   * Getter method for strength
   *
   * @return the strength
   */
   public int getStrength() {
       return strength;
   }

   /**
   * method: takeHit() Method called when character is attacked and has lost
   * strength
   *
   * @param int amount
   */
   public void takeHit(int amount) {
       strength = strength - amount;
       if (strength < 0) {
           strength = 0;
       }
   }

   /**
   * Method: heal()
   *
   * Method called as character heals from a hit
   *
   * @param int amount
   *
   */
   public void heal(int amount) {
       strength = strength + amount;
       if (strength > 18) {
           strength = 18;
       }
   }

}

----- Characters.txt -----

Soldier, Sol, 14, Sword, 50
Wizard, Wiz, 5, Staff, 444
Civilian, Civ, 18, Words, 3
Soldier, Joe, 3, Gun, 0
Wizard, Gandalf, 10, Wand, 500
Civilian, Frodo, 16, Money, 40

I can provide the 3 child classes (Soldier, Wizard, Civilian) if needed as the code exceed the text limits.

In: Computer Science

Larry had $55,000 of earned income in 2016. Determine the amount of Larry’s CPP contribution using...

Larry had $55,000 of earned income in 2016. Determine the amount of Larry’s CPP contribution using the appropriate CPP contribution rateand YMPE. Please explain step by step

In: Finance

1. Is Ford Motor company has more debt than equity (latest year) and will investor will...

1. Is Ford Motor company has more debt than equity (latest year) and will investor will get their dividend back (latest year), if possible between 2016-2019?

In: Finance

Write an eight to 10 page financial statements analysis 2016 of Imparial Oil. (Company overview, horizontal...

Write an eight to 10 page financial statements analysis 2016 of Imparial Oil. (Company overview, horizontal analysis of income statement and balance sheet, ratio analysis, recommendation)

In: Accounting

Analyze the GDP growth of India in the past one year (2016-2017) & Discuss how variation...

Analyze the GDP growth of India in the past one year (2016-2017) &

Discuss how variation in growth has impacted Cement company’s profitability with reasons

and details in india

In: Economics

2015 W&WR needed to replace 2 miles of track. costs $80,000. using MACRS depric, what would...

2015 W&WR needed to replace 2 miles of track. costs $80,000. using MACRS depric, what would be the depreciation for
2014
2016
2018
2020
2022

In: Finance

Select a policy that meets the following criteria (if need be, two out of the three...

Select a policy that meets the following criteria (if need be, two out of the three will work as well).

  • a policy that could diminish racial or gender inequality on some dimension (wages, housing, etc).
  • a policy that could target the wealthy - but NOT an income tax on millionaires
  • a policy that could target extreme poverty.

Next, select another policy from a different jurisdiction to analyze the differences and answer the following:

1. Briefly describe the main components of each policy.

2. Why would this policy lead to changes in inequality, that is: What economic changes and results do you expect? By what mechanism would change happen? What measures of inequality, wealth, or poverty do you think would change as a result of the policy? What distributional effects would there be or what overall effects on the economy in the jurisdiction?

4. Design a research experiment plan to survey and test the proposed recommendations. What would be the research design? What are some important research methods concerns people should be aware of? What would be some limitations to an experiment?

In: Economics