Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

5.5.7 Im not sure how to get started, please answer every part with the given format,thank you! Exercise 5.5.7: Weekly Routine point Let's Go! In

5.5.7 Im not sure how to get started, please answer every part with the given format,thank you!
image text in transcribed
image text in transcribed
image text in transcribed
Exercise 5.5.7: Weekly Routine point Let's Go! In this exercise, you will write a class that represents how you spend your time during the week. The class should have four double 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 setsleep(double hours Sleep) public void setFun(double hoursFun) public void setSchool(double hoursSchool) public void set Sports(double hours Sports) public void printTotal The constructor should initialize all of the instance variables 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 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 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 Total if steep - 8. school. Fun2, and sports - 3 g Of MacBook Pro F C codes.com/student/2087860/section/14866/assignment/5896128/ Sandbox My Section Practice Status: Not Submitted o Save Suite & FILES Routine ja Routine Testejava 5.5.7: Weekly Routine 1 public class Routine Tester 2-1 3 public static void main(String[] args) 4- f 5 Routine myWeek = new Routine: 6 7 myWeek.setSchool(8): 8 myWeek, set Sports(3), 9 my Week.setSleep(8): myneek. setFun(2): 11 12 // Prints the totals for the WHOLE WEEK 13 myWeek.print Total: 14 1 15 )

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Knowledge Discovery In Databases

Authors: Gregory Piatetsky-Shapiro, William Frawley

1st Edition

0262660709, 978-0262660709

More Books

Students also viewed these Databases questions