Questions
Do you have a favorite statistical method? Is there a statistical method that you think you...

Do you have a favorite statistical method?

Is there a statistical method that you think you will/already use in your workplace? v

In: Math

In University of Texas Southwestern Medical Center v. Nassar case, the Supreme Court held that the...

In University of Texas Southwestern Medical Center v. Nassar case, the Supreme Court held that the "___________" standard would apply in retaliation cases.

In: Economics

In a nuclear reactor, a neutron moving at speed v in the positive x-direction strikes a...

In a nuclear reactor, a neutron moving at speed v in the positive x-direction strikes a deuteron, which is at rest. The neutron is deflected by 90.0

In: Physics

Discuss why the constituents of an aqueous solution can only be separated by evaporation and the...

Discuss why the constituents of an aqueous solution can only be separated by evaporation and the concentration of the solute in the solution calculated in % (m/v) and in molarity

In: Chemistry

Discuss the DSM-V and how this is used to diagnosis disorders. Do you agree or disagree...

Discuss the DSM-V and how this is used to diagnosis disorders. Do you agree or disagree that individuals with mental disorders should be labeled?

In: Psychology

Apply human rights, legal rights and moral rights to the Tennessee v. Garner case, discussing the...

Apply human rights, legal rights and moral rights to the Tennessee v. Garner case, discussing the ramifications of each. Please help

In: Psychology

1. What is the "nature-nurture question" (or nature v. nurture debate)? And, which way do sociologists...

1. What is the "nature-nurture question" (or nature v. nurture debate)? And, which way do sociologists (largely) lean on this question?

In: Psychology

Song struct to store the data for a single song (make it a private member), and you must have an array of Song structures as a member variable.

USE C++ 

Song struct to store the data for a single song (make it a private member), and you must have an array of Song structures as a member variable.

Player(string name, float size) a constructor for the class. ’name' is a name for it
'size' is a maximum capacity in Mb.

addSong(string band, string title, string length, float size) a function for adding a new song.

'band' is a name of the band
'title' is a name of the song
'length' is a time length of that song in a '1:23' format (“mm:ss") 'size' is a size of the song in Mb

Return true if the song was added and false if there was not enough space (memory) for it or there was a song with the same band and title already in that device or if the device already has 1000 songs in it.

removeSong(string band, string title) a function for removing a song 'band' is a name of the band
'title' is a name of the song

Return true if the song was successfully removed and false if it wasn't present on the device.

displaySongInfo(string band, string title) a function to display a song’s info in the following format:
Band:

Length:


Number of songs:
Total length:

Free space left:
The output must line up in two columns, but the labels may be right justified.

In: Computer Science

Please add comments to this code! JAVA Code: import java.text.NumberFormat; public class Item {    private...

Please add comments to this code!

JAVA Code:

import java.text.NumberFormat;
public class Item {

   private String name;
   private double price;
   private int bulkQuantity;
   private double bulkPrice;

   /***
   *
   * @param name
   * @param price
   * @param bulkQuantity
   * @param bulkPrice
   */
   public Item(String name, double price, int bulkQuantity, double bulkPrice) {
       this.name = name;
       this.price = price;
       this.bulkQuantity = bulkQuantity;
       this.bulkPrice = bulkPrice;

   }

   public Item(String name, double price) {
       if (price < 0) {
           throw new IllegalArgumentException();
       }

       this.name = name;
       this.price = price;

   }

   /***
   *
   * @param quantity
   * @return
   */
   public double priceFor(int quantity) {
       double actual = 0;
       if (quantity < 0) {
           throw new IllegalArgumentException();
       } else {
           if (bulkQuantity!=0) {
               actual = (quantity / bulkQuantity) * bulkPrice
                       + (quantity % bulkQuantity) * price;
           } else {
               actual = quantity * price;
           }
       }

       return actual;

   }

   public boolean equals(Item ietm) {
       return this.name.equals(ietm.name);
   }

   @Override
   public String toString() {
       NumberFormat format = (NumberFormat) NumberFormat.getCurrencyInstance();

       format.setMinimumFractionDigits(2);
       format.setMaximumFractionDigits(2);
       String str = "";
       str = name + ", " + format.format(price);
       if (bulkPrice != 0) {
           str += " ( " + bulkQuantity + " for " + format.format(bulkPrice)
                   + " )";
       }
       return str;
   }
}

Thanks!!

In: Computer Science

''' Problem 1: Formin' Functions Define and complete the functions described below. The functions are called...

'''
Problem 1: Formin' Functions

Define and complete the functions described below.

The functions are called in the code at the very bottom. So you should be
able simply to run the script to test that your functions work as expected.
'''

'''
* function name: say_hi
* parameters: none
* returns: N/A
* operation:
Uhh, well, just say "hi" when called. And by "say" I mean "print".
* expected output:

>>> say_hi()
hi

'''

'''
* function name: personal_hi
* parameters: name (string)
* returns: N/A
* operation:
Similar to say_hi, but you should include the name argument in the greeting.
* expected output:

>>> personal_hi("Samantha")
Hi, Samantha

'''

'''
* function name: introduce
* parameters: name1 (string)
name2 (string)
* returns: N/A
* operation:
Here you are simply including the two names in a basic introduction.
* expected output:

>>> introduce("Samantha","Jerome")
Samantha: Hi, my name is Samantha!
Jerome: Hey, Samantha. Nice to meet you. My name is Jerome.

'''


# FUNCTIONS ARE CALLED BELOW HERE...NO NEED TO TOUCH ANYTHING
# UNLESS YOU WANT TO COMMENT SOMETHING OUT TO TEST THINGS
# ALONG THE WAY...

say_hi()
personal_hi("Larry")
personal_hi("Naomi")
introduce("Larry","Naomi")

In: Computer Science