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
vodomira [7]
3 years ago
6

In this exercise, you will write a class that represents how you spend your time during the week The class should have four doub

le instance variables . . sleep fun School sports These variables will track the number of hours you spend doing each of these activites in a single day, respectively The class should also have the following methods • A constructor that has no parameters public void setsleept double hours Sleep) public vold setFun(double hourstun public void set School(double hours School) public void set Sports (double hours Sports) mbate vota print Total) The constructor should initialize all of the instanco variables to 0 The methods that begin with "set" set the values of the corresponding instance variables to the value of the parameter The last method should print the total number of hours per week you spend doing each of these activities Note you will have to calculate the weekly hours by using the daily hours stored in the instance variables. It should also print the . . . . public void set School Buble hours School) Dublic void set Sports (double hours Sports) Dublic vota print Total The constructor should initialize all of the instance valables to o The methods that begin with "set" set the values of the corresponding instance variables to the value of the parameter The last method should point the total number of hours per week you spend doing each of these activities Note you will have to calculate the weekly hours by using the daily hours stored in the instance variables it should also print the total number of hours in the week accounted for and how many hours are left over Here is an example of the output of print Totate 3, chool - 8 = 2 and sports = 3 Weekly Totais STED School Dort Funt Ora Tot turto 0
Computers and Technology
1 answer:
Nuetrik [128]3 years ago
4 0

Answer:

Answered below

Explanation:

# Program is written in Java

class WeekHours{

double school;

double fun;

double sleep;

double sports;

WeekHours( ){

school = 0.0;

fun = 0.0;

sleep = 0.0;

sports = 0.0;

}

public void setSchool ( double x){

school = x;

}

public void setFun( double y){

fun = y;

}

public void setSleep( double w){

sleep = w;

}

public void setSports( double z){

sports = z;

}

public void totalHours(){

double tHours = school + fun + sleep + sports;

System.out.print(tHours);

}

}

You might be interested in
12. Your project specifications call for a business rule that the database design can't
fomenos

A lot of business rules needs to be triggered so as to run.

In making of business rule, one can select triggers to run some specific events or run using some particular specified frequency.

The trigger options differs  based on the type of rule you are interested in.  One can also use multiple triggers when using a single rule.

Learn more about rules from.

brainly.com/question/5707732

8 0
2 years ago
What is the purpose of the Zoom dialog box? to put the selected range in ascending order in a query to put the selected range in
AlekseyPX

The zoom dialog box helps to enter text and expressions in tight places, such as a property sheet or Query Design view. You can resize the zoom box and change the font. And the zoom box remembers the size and font each time you use it.

Use the

5 0
3 years ago
Read 2 more answers
Element primer a partir del qual es generarà l'energia central solar fotovoltaica
Juliette [100K]
No speak a Spanish ............
7 0
2 years ago
Wap in java to complete the following (16*1) +(14*2) +(12*3) +(10*4) +(8*5) +(6*6) +(4*7)​
vladimir1956 [14]

Answer:

It goes like:

public class Program

{

public static void main(String[] args)

{

int j=18;

int sum=0;

for (int i =1; i<7; i++)

{

sum=sum+(i*(j-2));

j=j-2;

}

System.out.println(sum);

}

}

Explanation:

<u>Variables used: </u>

j : controls the first number in product and decreases by 2 each time the loop runs.

sum: saves the values of addition as the loop runs.

3 0
2 years ago
Felicity wants to capture the attention of the regular subway commuters in her area though her print advertisements​
mel-nik [20]

Answer: billboard

Explanation:

Plato answer

8 0
2 years ago
Other questions:
  • In this code, identify the repeated pattern and replace it with a function called month_days, that receives the name of the mont
    14·1 answer
  • What do you like to play
    13·2 answers
  • How can you add and remove categories from a previously created chart? A. Click the Format tab. B. Click the Chart Styles button
    13·2 answers
  • Why would it be beneficial to preview a page before printing?
    8·1 answer
  • A ____ typically rests on the desk or other flat surface close to the user’s computer, and it is moved across the surface with
    13·1 answer
  • The camera still is bad even with the new iPhone xr and especially in low light it is even worst because you can see the pixels
    15·1 answer
  • Public class Student {
    14·1 answer
  • Write a program that inputs a five-digit integer, spearates the integer into its digits and prints them seperated by three space
    6·1 answer
  • Help Me<br><br> What are the four types of graphic models?
    10·1 answer
  • Which phrase is the best definition of sparklines in Excel 2016?
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!