Circle Class (This is in JAVA)
/**
* Defines a basic shape with just area
*
* @author Jo Belle
* @version 0.2 (10/05/2020)
*/
public class Shape{
private double area;
public Shape(){ area = 0.0; }
public Shape( double a ){ this.area = a; }
public void setArea( double a ){ area = a; }
public double getArea(){ return area; }
public String toString(){
return "Shape:\n\tarea: " + area;
}
}
/**
* Create a simple Circle object
*
* @author Jo Belle
* @version 0.2 (10/12/2020)
*/
public class ShapeDriver{
public static void main( String[] args ){
Circle cir = new Circle( );
cir.setRadius( 5.0 );
System.out.println( cir.toString() );
}
}
Given the code above, write a Circle class (and save it in a file named Circle.java) that inherits from the Shape class. Include in your Circle class, a single private field double radius. Also include a method void setRadius(double r) (which also sets area) and a method double getRadius() (which also returns the current radius). Change the accessibility modifier for area in the Shape class to be more appropriate for a base class. Make sure that ShapeDriver's main() method executes and produces the following output:
Shape:
area: 78.53981633974483
radius: 5.0
Submit both your Circle.java and your Shape.java files.
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,016,000 | 2,808,000 | 2,613,600 |
| Estimated costs to complete as of year end | 5,184,000 | 2,376,000 | 0 |
| Billings during the year | 2,180,000 | 2,644,000 | 5,176,000 |
| Cash collections during the year | 1,890,000 | 2,500,000 | 5,610,000 |
Westgate recognizes revenue over time according to percentage of completion.
Required:
1. Calculate the amount of revenue and gross
profit (loss) to be recognized in each of the three years.
(Do not round intermediate calculations. Loss amounts
should be indicated with a minus sign.)
| 2021 | 2022 | 2023 | |
| Revenue | 2,800,000 | 3,900,000 | 3,300,000 |
| Gross Profit (Loss) | 784,000 | 1,092,000 | ? |
Steps please..
In: Accounting
4. A video game console requires 6 V to operate correctly. A transformer allows the device to be powered from a 120-V outlet. If the primary has 500 turns, how many turns for the secondary?
In: Physics
Why Newtonian mechanics doesn't work at velocities close to that of the speed of light? I know that mass tends to become infinite at v=c but why does it fail if v is close to c but not exactly c?
In: Physics
What is a slew rate ? List causes of the slew
rate
Find the maximum frequency for a sine wave output voltage of 10 V
peak with an op amp whose slew rate is 1 V/ us .
In: Electrical Engineering
. Describe the V(D)J recombination process in terms of the sequence of events that occurs and the enzymes involved at each step (4 points). Describe why V(D)J recombination is crucial for adaptive immunity
In: Biology
Exercise 2.5.1 Suppose T : R n ? R n is a linear transformation. Prove that T is an isometry if and only if T(v) · T(w) = v · w. Recall that an isometry is a bijection that preserves distance.
In: Math
Vessel V-307 is to be replaced in a plant with a vessel that is designed to withstand a higher pressure and which has a larger volume. Should this vessel be numbered V-307 to correspond with the vessel it is replacing? Explain your answer.
In: Chemistry
4 – The following 32-bit binary word written in hexadecimal format represents a single RISC-V assembly instruction. What is the RISC-V instruction format and specific assembly language instruction?
0x00156A33
In: Computer Science
Let (G,+) be an abelian group and U a subgroup of G. Prove that G is the direct product of U and V (where V a subgroup of G) if only if there is a homomorphism f : G → U with f|U = IdU
In: Advanced Math