Inheritance - What is inheritance - Answer your own description in Readme.txt
Based on Hamburger project, you will create a package about Pizza.
In your Readme.txt, write how you make your Pizza package differently from the Hamburger package and also explain how inheritance work with your Pizza package.
package Hamburger;
/**
* Inheritance challenge – Hamburger place (Main, Hamburger, two
other Burger type class)
* Hamburger class should have name, bread roll type, meat, and up
to 4 additional
* additions(e.g. lettuce, tomato, carrot, etc)
* to select to be added to the burger. Each item will be charged an
additional
*/
public class Hamburger {
private String name;
//meat, price, breadRollType
private String meat;
private double price;
private String breadRollType;
private String additionName1;
private double additionPrice1;
private String additionName2;
private double additionPrice2;
private String additionName3;
private double additionPrice3;
private String additionName4;
private double additionPrice4;
public Hamburger(String name, String meat, double price, String
breadRollType) {
this.name = name;
this.meat = meat;
this.price = price;
this.breadRollType = breadRollType;
}
public void addHamburgerAddition1(String name, double
price){
this.additionName1 = name;
this.additionPrice1 = price;
}
public void addHamburgerAddition2(String name, double
price){
this.additionName2 = name;
this.additionPrice2 = price;
}
public void addHamburgerAddition3(String name, double
price){
this.additionName3 = name;
this.additionPrice3 = price;
}
public void addHamburgerAddition4(String name, double
price){
this.additionName4 = name;
this.additionPrice4 = price;
}
public double hamberPriceTotal(){
double hamburgerPrice = this.price;
System.out.println(this.name + " hambuger on a " + this.breadRollType + " roll with " + this.meat + "'s price is " + this.price);
if(this.additionName1 != null){
hamburgerPrice += this.additionPrice1;
System.out.println("Added " + this.additionName1 + " for an extra "
+ this.additionPrice1);
}
if(this.additionName2 != null){
hamburgerPrice += this.additionPrice2;
System.out.println("Added " + this.additionName2 + " for an extra "
+ this.additionPrice2);
}
if(this.additionName3 != null){
hamburgerPrice += this.additionPrice1;
System.out.println("Added " + this.additionName3 + " for an extra "
+ this.additionPrice3);
}
if(this.additionName4 != null){
hamburgerPrice += this.additionPrice4;
System.out.println("Added " + this.additionName4 + " for an extra "
+ this.additionPrice4);
}
return hamburgerPrice;
}
}
In: Computer Science
[The following information applies to the questions
displayed below.]
In 2021, the Westgate Construction Company entered into a contract
to construct a road for Santa Clara County for $10,000,000. The
road was completed in 2023. Information related to the contract is
as follows:
| 2021 | 2022 | 2023 | |||||||
| Cost incurred during the year | $ | 2,100,000 | $ | 2,450,000 | $ | 2,695,000 | |||
| Estimated costs to complete as of year-end | 4,900,000 | 2,450,000 | 0 | ||||||
| Billings during the year | 2,200,000 | 2,350,000 | 5,450,000 | ||||||
| Cash collections during the year | 1,900,000 | 2,300,000 | 5,800,000 | ||||||
Westgate recognizes revenue over time according to percentage of
completion.
2-a. In the journal below, complete the
necessary journal entries for the year 2021 (credit "Various
accounts" for construction costs incurred).
2-b. In the journal below, complete the necessary
journal entries for the year 2022 (credit "Various accounts" for
construction costs incurred).
2-c. In the journal below, complete the necessary
journal entries for the year 2023 (credit "Various accounts" for
construction costs incurred).
Record construction costs.
Record progress billings.
Record cash collections.
Record gross profit (loss).
|
In: Accounting
Bark beetles are tiny insects with hard, cylindrical bodies that reproduce under the bark of trees. While bark beetles are native to U.S. forests and play important ecological roles, they can cause extensive tree mortality and negative economic and social impacts. Researchers at Los Alamos National Laboratory are interested in the behavior of Bark Beetles living in the Santa Fe National Forest. In particular, they are interested in the average size of these beetles (body length measured in mm). They assume that the distribution of body length for these beetles can be modeled with a Normal distribution with mean μ and standard deviation σ. After spending several weeks in the field, they have measured and recorded the body length of 263 of these beetles. The average body length of these 263 beetles is 6.14mm with a calculated standard deviation of 1.89mm.
1. What is the population of interest?
2. What is the sample size?
3. What is the sample?
4. What parameters are mentioned in this problem? Explain what the parameters mean in terms of the problem.
5. What is the sample data?
6. What are the estimators mentioned in this problem? For each estimator, explain which parameter it is supposed to estimate.
7. What are the estimates for the parameters in this problem?
In: Statistics and Probability
The requirements for this program are as follows:
Private members
a std::string for the employee’s first name
a std::string for the employee’s last name
an unsigned int for the employee’s identification number
a std::string for the city in which the employee works
Public members
A constructor that takes no arguments
A constructor that takes two arguments, representing:
A constructor that takes three arguments, representing:
A constructor that takes four arguments, representing:
A method named displayDetails() that takes no parameters, returns void, and is marked as const.
The displayDetails() method should display to the screen all of the information contained in the employee’s private data members.
All constructors should use constructor initializers to set the employee’s string data members. If a particular string is unknown (i.e., it’s not being passed into that constructor), set it to “unknown”.
For the two constructors that do not accept an argument for the identification number, use constructor initializers to set the identification number to 0.
Finally, write a simple driver file with a main() function. (An example is provided below; you may use this code but I'd recommend creating your own, for the sake of practice.) Inside main(), create at least six Employee objects by invoking the four different constructors. These objects should invoke the four different constructors and test the validity-checking of the identification number (so there will be two objects that invoke the three-argument constructor -- one of them should pass an invalid identification number, and the other should pass a valid number... followed by the same procedure for the four-argument constructor). For each object, invoke the displayDetails() method to test your program.
Example driver and output from that driver:
//inside Source.cpp
#include <iostream>
#include "Employee.h"
using namespace std;
int main()
{
Employee a;
Employee b{ "Robert", "Childan" };
Employee c{ "Nobusuke", "Tagomi", 83179391 };
Employee d{ "Ed", "McCarthy", 1 };
Employee e{ "Frank", "Frink", 73641933, "San
Francisco" };
Employee f{ "Juliana", "Frink", 2, "Canon City" };
a.displayDetails();
b.displayDetails();
c.displayDetails();
d.displayDetails();
e.displayDetails();
f.displayDetails();
}
//output from above driver
Employee Details:
First name: unknown
Last name: unknown
ID: 0
Office location: unknown
Employee Details:
First name: Robert
Last name: Childan
ID: 0
Office location: unknown
Employee Details:
First name: Nobusuke
Last name: Tagomi
ID: 0
Office location: unknown
Employee Details:
First name: Ed
Last name: McCarthy
ID: 1
Office location: unknown
Employee Details:
First name: Frank
Last name: Frink
ID: 0
Office location: San Francisco
Employee Details:
First name: Juliana
Last name: Frink
ID: 2
Office location: Canon City
///////////////////////////
Language: C++
Please ask questions if inftructions are unclear
In: Computer Science
Why would CuSO4 have a blue color after the iron reagent is added? Yes, the answer is because it is absorbing the other colors (the spectrophotometer), but WHAT is absorbing the other colors?
(Done in an experiment about spectrophotometry)
In: Chemistry
The number of bacteria after ? hours in a controlled laboratory experiment is ? = ?(?).
a. Describe the meaning of ?′(4) and include right units.
b. If the supply of nutrients is limited, which value do you think is larger ?′(4) or ?′(15)?
In: Math
In: Statistics and Probability
The following data was collected in an experiment. The initial amount of hydrogen peroxide is 0.0035 mol. Find the rate constant
Moles of O2 Time ( in minutes)
0.0000482 0.008
0.0003544 1.798
0.0006828 4.027
0.0010133 7.758
In: Chemistry
Question 4.
Describe an experiment to demonstrate whether the RNA folds into a functional tertiary structure of a ribozyme when the tetraloop region is deleted. You suspect that the tetraloop is critical for folding of a ribozyme into its active form.
In: Biology
A scientist wants to make a solution of tribasic sodium phosphate, Na3PO4, for a laboratory experiment. How many grams of Na3PO4 will be needed to produce 375 mL of a solution that has a concentration of Na+ ions of 1.50 M ?
In: Chemistry