1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ExtremeBDS [4]
3 years ago
6

Design and implement a class called Sphere that contains instance data that represent the sphere’s diameter. Define the Sphere c

onstructor to accept and initialize the diameter, and include getter and setter methods for the diameter. Include methods that calculate and return the volume and surface area of the sphere (see Programming Project 3.5 for the formulas). Include a toString method that returns a one-line description of the sphere. Create a driver class called MultiSphere, whose main method instantiates and updates several Sphere objects.
Computers and Technology
1 answer:
Zolol [24]3 years ago
3 0

Answer:

Import java.awt.*;

import java.util.*;

public class Sprhere

{// Instance Data private double surfaceA, volume, r, diameter; //Constructors public Sphere ()

{r = 0;diameter = 0; surfaceA = 0;volume = 0;}

public Sphere (double radius, double d, double SA, double v)

{this. r = radius; this. diameter = d; this. surfaceA = SA;this.volume = v;}

//--------------------------------------------------------------------// Accesors.//--------------------------------------------------------------------public double get Radius()

{return r;}

public double get Diameter()

{return diameter;}

public double get SurfaceA()

{return surfaceA;}

public double get Volume()

{return volume;}

//--------------------------------------------------------------------// Mutators.//--------------------------------------------------------------------

You might be interested in
When a Select Case statement executes, the value of the test expression is compared with the values that follow each of the ____
goldenfox [79]

Answer:

Case

Explanation:

In Computer programming, a variable can be defined as a placeholder or container for holding a piece of information that can be modified or edited.

Basically, variable stores information which is passed from the location of the method call directly to the method that is called by the program.

For example, they can serve as a model for a function; when used as an input, such as for passing a value to a function and when used as an output, such as for retrieving a value from the same function. Therefore, when you create variables in a function, you can can set the values for their parameters.

A Select Case statement can be defined as a conditional statement that avails software developers or programmers the ability to test a variable by comparing it with a list of values.

In a Select Case statement, each variable is referred to as a Case.

Generally, when a Select Case statement executes, the value of the test expression is compared with the values that follow each of the Case keywords.

7 0
3 years ago
What is an aptitude assessment that matches students with study programs at specific colleges and universities?
melisa1 [442]
I think the correct answer would be FOCUS2. It is a system that guides members in choosing college or a major. It provides a starting point for students who are not yet certain of what they want to take academically. Hope this helps.
5 0
2 years ago
Read 2 more answers
This is not a factor that you should use to determine the content of your presentation. Your audience your goals your purpose yo
aksik [14]

Your technology I believe

4 0
3 years ago
Read 2 more answers
Ask the user for a total food bill and then find the new total after 6% tax and a tip of the users choice (15, 18, 20%) in pytho
chubhunter [2.5K]

Answer:

#here is code in python.

# read the food bill

tot_bill=float(input("Please enter the food bill:"))

# tax on food

tax=0.06

#choice for tip by user

choice=int(input("enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)"))

// calculate the total food bill

if choice==1:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.15)

elif choice==2:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.18)

elif choice==3:

   tot_food_bill=tot_bill+tot_bill*tax+tot_bill*(.2)

else:

   print("invalid choice:")

#print the total food bill

print("total food bill is ",tot_food_bill)    

Explanation:

Read the food bill from user and assign it to variable "tot_bill".Initialize the tax=0.06 (i.e. 6%) on the bill.Then ask user to give his choice for tip. if the choice is 1 then tip will be 15%, if 2 then 18% and if choice is 3 Then tip will be 20% of the bill.Calculate the total food bill and assign it to variable "tot_food_bill".

Output:

Please enter the food bill:100                                                                                                                                

enter your choice for tip:(1 for 15%, 2 for 18% and 3 for 20% :)2                                                                                            

total food bill is  124.0

3 0
2 years ago
Which types of customizing can you do with the Cell Style galleries? Check all that apply.
guapka [62]

Change the font size

Change the font color

Change the background color

Adjust percentage of background shade

Add a hyperlink

Explanation:

All of these have todo with style

8 0
3 years ago
Read 2 more answers
Other questions:
  • A patent facilitates a government-approved technological monopoly by
    5·1 answer
  • Binary is best interpreted by a computer because?
    8·2 answers
  • Create the following matrix M: 1 7 13 19 25 ?-3 9 15 21 27 5 11 17 2329By writing one command and using the colon to address ran
    8·1 answer
  • This assignment requires you to write a program to analyze a web page HTML file. Your program will read one character at a time
    13·1 answer
  • How to write email abut new home your friend ​
    14·1 answer
  • Convert octal number 2470 to decimal number
    14·2 answers
  • A company is deploying NAFDs in its office to improve employee productivity when dealing with paperwork. Which of the following
    11·1 answer
  • Two time series techniques that are appropriate when the data display a strong upward or downward trend are ___________ and ____
    14·1 answer
  • Why is an increase in tax rate not necessarily increase government revenue​
    10·1 answer
  • Read the attached paper titled A Survey of Coarse-Grained Reconfigurable Architecture and comment on it. Make sure to specifical
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!