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
Remember that kid who would always ask you for your food, even though he packed his own lunch.
Verizon [17]

Answer:

ye ye

Explanation:

7 0
3 years ago
Read 2 more answers
After adding an image to her flyer, Danica played around to see which layout would look the best. At one point, her text was on
Norma-Jean [14]

Answer:

Position Feature

Wrap text feature

Picture tools

Explanation:

3 0
3 years ago
Read 2 more answers
Mention five importance of taskbar​
sveticcg [70]

Answer:

The taskbar is an element of an operating system located at the bottom of the screen. It allows you to locate and launch programs through Start and the Start menu, or view any program that's currently open.

6 0
3 years ago
The two objects representing values FALSE & TRUE are called _________Integers​
scoundrel [369]

Answer:

true because I just had a test like this today and it put true and got it correct

5 0
3 years ago
PARTNERING AS IT RELATES TO BPR.​
balandron [24]

Answer:

The answer to this question can be defined as follows:

Explanation:

The term BPR stands for "business processes reengineering", It is the recreating of the core business process to improve product performance or reliability or lower costs.

  • It generally includes analyzing business processes, which identifying sub-par or ineffective processes but identifying ways to dispose of or change it.
  • IT important for improving changes, especially to shift in aspects of the work, its incorporation in business operations, or competitive strength change.
  • It might contribute to making reconfiguration improvements, and is known as a BPR enabler.
6 0
3 years ago
Other questions:
  • Which best describe a resource each student could use to find information
    6·2 answers
  • Alright, don't judge me, this is a question that involves my Childhood game PvZ GW 2. So I noticed mods and stuff that get uploa
    12·2 answers
  • Your program Assignment Write a program that reads a sentence as input and converts each word to "Pig Latin". In one version of
    15·1 answer
  • For each 8-bit data frame the layer uses a generator polynomial G(x) = x4+x2+ x+1 to add redundant bits. What is the sequence of
    11·1 answer
  • ASAP!!!!****** Need help!!!!
    15·1 answer
  • Consider the system of simultaneous equations:
    15·1 answer
  • Tribology is a branch of physics concerned with friction in mechanical motion. Knowledge of tribology would be useful working wi
    14·1 answer
  • 1.
    13·1 answer
  • Write a program that prompts the user to enter three words. The program will then sort the words in alphabetical order, and disp
    14·1 answer
  • QUESTION 4 of 10: True or False: According to the reading, investors care about your love for your business.
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!