Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

public class Workout ( private int myCaloriesBurned; private double myMinutes; public Workout (int cals, double min) Missing Code */ public int getcaloriesBurned) return myCaloriesBurned: )

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
public class Workout ( private int myCaloriesBurned; private double myMinutes; public Workout (int cals, double min) Missing Code */ public int getcaloriesBurned) return myCaloriesBurned: ) public double getMinutes() return myMinutes: > public String getWorkoutRating) if (getcaloriesBurnedo) / getminutes() > 1.5 ) return "strenuous"; if ( getcaloriesBurned() / getMinutes() > 0.75 ) return "average" : return "inferior": 3 public class StrengthWorkout extends Workout private double mykilos public Strengthworkout(int cals, double min.) /* Missing Code */ public StrengthWorkout(int cals, double min, double kgas) Missing Code public double getHyunkilos () return mykilos; public String getWorkoutRating() * Missing Code */ ) A Strength Workout is a Workout, therefore the StrengthWorkout class extends the Workout class. A strength workout has a number of kilograms (kgms) lifted. In this problem you are to select the code that correctly completes the getWorkoutRating() method in the StrengthWorkout class. The rating of a Strength workout is determined as follows: if the Strength workout has more than 250 kilograms, the rating is "extreme". if the Strength workout has more than 150 kilograms, the rating is "demanding". if the Strength workout has more than 100 kilograms, the rating is difficult" Otherwise (less than 100 kilograms) the workout rating is the same as a workout. Option 1: if (mykiTas > 258) return "extreme if (mykilos > 150) return demanding": if (trykilos > 100) return difficult Option 1: if (myKilos > 250) return "extreme"; if (myKilos > 150) return "demanding": if (myKilos > 100) return "difficult": return getWorkoutRating: Option 2: if (getMyNumkilos() > 100) return "difficult"; if (getMyNumKilos() > 150) return "demanding": if (getMyNumkilos() > 250) return "extreme": return super.getWorkoutRating(); Option 3: if (getMyNumkilos() > 250) return "extreme"; if (getMyNumkilos() > 158) return "demanding": if (getMyNumKilos() > 100) return "difficult": return super get WorkoutRating(): Which of the options successfully replaces the missing code in the getWorkoutRating method? A. Option 1 B. Option 2 C. Option 3

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

AWS Certified Database Study Guide Specialty DBS-C01 Exam

Authors: Matheus Arrais, Rene Martinez Bravet, Leonardo Ciccone, Angie Nobre Cocharero, Erika Kurauchi, Hugo Rozestraten

1st Edition

1119778956, 978-1119778950

More Books

Students also viewed these Databases questions

Question

LO1 Understand risk management and identify its components.

Answered: 1 week ago