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
If the system has a mechanical advantage of 5 and the load of 350N.What effort is needed to lift the weight? Provide your answer
FromTheMoon [43]

Answer:

Effort = 70 N

Explanation:

A machine is a device that can be used to overcome a load by the application of a minimal effort. For a practical machine, mechanical advantage (MA) is the ratio of the load (L) overcome to the effort (E) applied.

i.e MA = \frac{Load}{Effort}

In the given question, MA = 5 and the load = 350 N. So that;

5 = \frac{350}{E}

E = \frac{350}{5}

  = 70

The effort applied to the machine is 70 N.

3 0
3 years ago
Computer crimes are a big concern since the creation of innovative technological advances; which is/are examples of computer cri
Natali [406]

Answer:

The answer is E: All of the above

Explanation:

All of the above scenarios are examples of serious computer crimes. They are crimes that exist in the offline world but take place online. Sexual predators, for instance, mostly take advantage of the anonymity provided by the internet. They often target dating sites and find suitable victims. Cyber bullying and Cyber stalking are just as harmful as any other computer crime. Industrial Espionage may also somehow fall into this category. Less frequently, criminals may steal documents and computer files or more often, illegally gain access to company’s trade secrets on computers and servers.

3 0
3 years ago
Read 2 more answers
How should you decide what to wear to an interview? What kind of things should be considered?
Anon25 [30]
You should wear something professional. A tie, suit, classy dress, heels. You are more likely to be hired if you make it look like you take pride in your appearance. Also, depending on what kind of job you are applying for, the outfits can vary as well.
5 0
3 years ago
Please answer........
Vitek1552 [10]

Using the try-except statement, the fix is as follows:

while True:

   try:

       boxes = int(input("How many boxes do you have?"))

       sweaters = int(input("How many sweaters do you have?"))

       break

   except:

       print("Input invalid")

sweatersPerBox = sweaters/boxes

print("You need to put",sweatersPerBox,"sweaters in each box")

<h3>How to prevent the program from crashing?</h3>

The program is given as:

boxes = int(input("How many boxes do you have?"))

sweaters = int(input("How many sweaters do you have?"))

sweatersPerBox = sweaters/boxes

print("You need to put",sweatersPerBox,"sweaters in each box")

The above program would crash when the user enters string inputs.

Examples of string inputs are "7h", "bh"...

One way to fix the error is the use of the try-except statement.

Using the try-except statement, the fix is as follows:

while True:

   try:

       boxes = int(input("How many boxes do you have?"))

       sweaters = int(input("How many sweaters do you have?"))

       break

   except:

       print("Input invalid")

sweatersPerBox = sweaters/boxes

print("You need to put",sweatersPerBox,"sweaters in each box")

The above program would continue running until the user enters a valid input

Another way is to end the program when the user enters string inputs

Read more about python programs at:

brainly.com/question/26497128

#SPJ1

7 0
2 years ago
The receptionist’s directly connected laser printer is printing blank sheets. The technician assigned to the trouble ticket has
Studentka2010 [4]

Answer:

Correct option is B: Print a test print from the printer's console

Explanation:

At first thought, a laser print that is printing blank pages would mean that the toner is exhausted and needs to be replaced. However, if after replacing the toner, and the problem of printing blank page continues, the first troubleshoot  step to take is to be sure that the fault is not from the side of the receptionist by printing a test print from the console of the printer.

4 0
4 years ago
Other questions:
  • What will be the biased exponent of 1,100.1? <br> A:130<br> B:127<br> C:-127<br> D:2^3
    12·2 answers
  • Transforming a message into an understandable sign and symbol system is _________.
    15·1 answer
  • PLEASE FILL IN THE BLANK FOR THESE POINTS!!!!!
    15·2 answers
  • Answer the following questions which are based on the study "Patients' Engagement with Sweet Talk." Submit your answers to the e
    9·1 answer
  • Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hou
    13·1 answer
  • What is HTML ? <br>Give a small description about html
    12·2 answers
  • Why won’t my Nintendo Switch connect to the internet?
    7·1 answer
  • The Electronic Communications Privacy Act requires an investigator to have a wiretap order to acquire ___________ information fr
    8·1 answer
  • PowerPoint is a visual aid for many speakers. Discuss some points to remember when adding text to a PowerPoint presentation. How
    8·1 answer
  • computer is an electronic machine that is used for data processing to produce meaningful information explain in statement​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!