9. A ___________ life table would be most appropriate for a population of sessile barnacles, whereas a _________________ life table would be most appropriate for a population of baitfish such as herring. *
2 points
a. static; composition
b. cohort; stable
c. static; cohort
d. cohort; static
In: Biology
Problem statement:
You are tasked with writing a simple program that will keep track of items sold by a retail store. We need to keep track of the stock (or number of specific products available for sale).
Requirements:
The program will now be broken up into methods and store all the inventory in an ArrayList object.
The program will be able to run a report for all inventory details as well as a report for items that are low in stock. Low stock means that there are less than 5 items available for sale.
Grading details:
Correct usage of OOP concepts (80%)
Correct class design and usage of class instances (30%)
Correct implementation and usage of polymorphism (30%)
Other supporting code/logic (20%)
Program runs/correct results (10%)
Formatting/Indentation (10%)
Starter code:
|
import java.util.ArrayList; |
Product:
public class Product {
private String name;
private String description;
private double wholeSalePrice;
private double retailPrice;
public Product() {//default constructor
}
public Product(String name, double wholeSalePrice) {//constructor with name and price
this.name = name;//set the instance variables as per the value passed
this.wholeSalePrice= wholeSalePrice;
}
public Product(String name, double wholeSalePrice, double retailPrice) {//constructor with name and price
this.name = name;//set the instance variables as per the value passed
this.wholeSalePrice= wholeSalePrice;
this.retailPrice=retailPrice;
}
public Product(String name, double wholeSalePrice, double retailPrice, String description) {//constructor with name and price
this.name = name;//set the instance variables as per the value passed
this.wholeSalePrice= wholeSalePrice;
this.retailPrice=retailPrice;
this.description=description;
}
private double getRetailPrice() {//this method will return the retailPrice as per the sample outpu
retailPrice= wholeSalePrice+(wholeSalePrice*.10);//output shows that retailPrice is 10% addition to wholesaleprice
return retailPrice;
}
public String toString() {//print object details
if(description==null) {//if description is null, then print a message for description
return "\nname: "+name+" , description: No description entererd., wholesalePrice: $"+wholeSalePrice+", retailPrice $"+getRetailPrice();
}
else {//otherwise print description value
return "\nname: "+name+" , description: "+description+", wholesalePrice: $"+wholeSalePrice+", retailPrice $"+getRetailPrice();
}//end else
}//end toString
}//end class
Book:
public class Book extends Product {
private String author;
public Book(String name, double wholeSalePrice) {// constructor gets name , price
super(name, wholeSalePrice);//pass the name and price to the super class product
author="Author_Placeholder";
}
public String toString() {
return super.toString()+", Author: "+author;//super will return the product details and author is added here
}//end toString
}//end class
Food:
public class Food extends Product {
private String date;
public Food(String name, double wholeSalePrice, String date) { // constructor gets name , price and date
super(name, wholeSalePrice);//pass name and wholesale price to super class
this.date = date;//set date for local class instance variable date
}
public String toString() {//return the food details
return super.toString() + ", expiration: " + date;
}
}
Sample output:
Viewing Store Products:
name: Computer, description: No description entered., wholesalePrice: $1400.00, retailPrice: $1540.00, stock: 3
name: iPhone XR, description: No description entered., wholesalePrice: $400.00, retailPrice: $440.00, stock: 6
name: Samsung Galaxy S10, description: Phone with 128GB memory., wholesalePrice: $700.00, retailPrice: $770.00, stock: 8
name: Starting out with C++, description: No description entered., wholesalePrice: $150.00, retailPrice: $165.00, stock: 3, author: Author_Placeholder
name: Fuji Apples, description: No description entered., wholesalePrice: $3.50, retailPrice: $3.85, stock: 150, expiration: Dec. 1, 2019
Viewing items that need to be re-stocked:
name: Computer, description: No description entered., wholesalePrice: $1400.00, retailPrice: $1540.00, stock: 3
name: Starting out with C++, description: No description entered., wholesalePrice: $150.00, retailPrice: $165.00, stock: 3, author: Author_Placeholder
In: Computer Science
The probability that a bridge won't pass a wellness check is 0.09. What is the probability that in a sample of 12 bridges, 2 or more will not pass?
*The bridges are independent,
In: Statistics and Probability
For Van Der Waals equation
(P + a/V2)(V - b) = nRT
How can you find the values of "a" and "b" using an experiment? Please explain the method of the experiment too
In: Chemistry
Draw UML diagram
Define a class named Document that contains a member variable of
type string named text that stores any textual content for the
document. Create a function named getText that returns the text
field and a way to set this value.
Next, define a class for Email that is derived from Document and
that includes member variables for the sender , recipient , and
title of an e-mail message. Implement appropriate accessor and
mutator functions. The body of the e-mail message should be stored
in the inherited variable text .
Similarly, define a class for File that is derived from Document
and that includes a member variable for the pathname. Implement
appropriate accessor and mutator functions for the pathname.
Each class should have a display function to display the complete
contents.
Create a class Author with name and id. Author is responsible to
create the document. It means every document should have an
author.
Create a class Administrator with name and id. Administrator can
delete the document if he finds these words (“corrupt, liar,
dishonest”) in the document text.
Finally, create several sample objects of type Email and File in
your main function. Test your objects by creating a test program.
Also create relationships with author and administrator with
document.
In: Computer Science
In: Accounting
The Canmark Research Center Airport Customer Satisfaction Survey
uses an online questionnaire to provide airlines and airports with
customer satisfaction ratings for all aspects of the customers'
flight experience. After completing a flight, customers receive an
email asking them to go to the website and rate a variety of
factors, including the reservation process, the check-in process,
luggage policy, cleanliness of gate area, service by flight
attendants, food/beverage selection, on-time arrival, and so on. A
five-point scale, with Excellent (E), Very Good (V), Good (G), Fair
(F), and Poor (P), is used to record the customer ratings for each
survey question. Assume that passengers on a Delta Airlines flight
from Myrtle Beach, South Carolina, to Atlanta, Georgia, provided
the following ratings for the question, "Please rate the airline
based on your overall experience with this flight." The sample
ratings are shown below.
E E G V V E V V V E
E G V E E V E E E V
V V V F V E V E G E
G E V E V E V V V V
E E V V E P E V P V
(a) Name the elements in this study
(b) Name the sample in this study
(c) Name the population of interest so that selection bias doesn't exist
(d) Name the variable in this study
(e) Based on the result, make an inference about "E"
In: Statistics and Probability
How do network bridges scale up a local area network by reducing the collision domain? Why can’t bridges make a local area network collision free?
In: Computer Science
Scientific Name: Vitis aestivalis × V. riparia = V. ×slavinii Common Name: Slavin’s grape
can anyone give a description of this plant, along with leaf shape, flowers, etc.
In: Biology
Hypothesis Test: Proportion
The university lecturer also wants to ensure that not too many people fail their course (obtain a mark less than 45). They decide to test if the proportion failing their course in the new cohort is the same as in the previous cohort. In the previous cohort 6 out of 100 students failed. In the new cohort 0.269 proportion of 130 students failed.
Test your hypothesis at the 95% level, what is your p-value?
Without conducting further calculations, would a 95% confidence interval give the same conclusion? State your reasoning
In: Statistics and Probability