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
In order for the image tag in an HTML file to function properly, the file named square.png must be located where?
andrey2020 [161]
A is wrong because a folder can have any name.
B is wrong because not all folders of a web server are exposed to the outside, only all folders below the document root.
C sounds good
D is wrong because an image can reside somewhere else as long as you specify the absolute or relative path to it
7 0
3 years ago
Read 2 more answers
This technology was developed in the 1980s and was a successful attempt to provide services for voice, video, and video traffic
sveticcg [70]

Answer:

SONET was the only one on the list created near the 1980s (1985)

Good luck!

<em>~Awwsome</em>

8 0
3 years ago
What is the penalty for violating section 1201 of title 17 chapter 21 of the us code
svlad2 [7]

Prison or juvenile detention of course, its a violation

4 0
3 years ago
How do I answer a question that was answered incorrectly on Brainly
Mashcka [7]

Answer:

Explanation:

Go and ask a teacher or search

6 0
3 years ago
Read 2 more answers
What is the name of the technology that is typically implemented on switches to avoid Ethernet connectivity problems when the wr
Andrew [12]

Answer:  Medium Dependent Interface Crossover (MDIX)

Explanation:

The technology that is typically implemented on switches to avoid Ethernet connectivity problems is Medium Dependent Interface Crossover(MDIX) For switches with Auto (MDIX) the connection is configured automatically and a crossover or straight-through cable can be used to connect two switches. When this MDIX interface is connected it corrects the connectivity speed and the cabling for proper device functionality.

4 0
3 years ago
Other questions:
  • To configure a router / modem, what type of IP interface configuration should you apply to the computer you are using?
    8·1 answer
  • Match the number in the picture to the correct Excel interface part. Each number is only used one time.
    11·1 answer
  • The term Electronic Privacy Information Center (EPIC) refers to a form of the digital subscriber line technology, which enables
    6·1 answer
  • You are part of the team to implement new software at XYZ Inc. The employees at XYZ Inc. trust the results of the old software p
    15·1 answer
  • In cell n2, enter a formula using the if function and a structured reference to determine if allison simoneau is eligible for tu
    11·1 answer
  • A(n) __________ prevents outsiders from accessing corporate information the user does not want others to see.
    9·1 answer
  • Which of these lines of code will increment a variable?
    11·1 answer
  • A folder is a collection of related of data is true or false​
    10·2 answers
  • Many programmers think object-oriented programming is a superior approach to procedural programming. Others think it adds a leve
    7·1 answer
  • Bluetooth is the popular name for the 802. 15 wireless networking standard, which is useful for creating small __________.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!