Answered step by step
Verified Expert Solution
Question
1 Approved Answer
i cant seem to get this code working without messing with the main class function Task 5 (10 pts.) The program task5.java given below is
i cant seem to get this code working without messing with the main class function
Task 5 (10 pts.) The program task5.java given below is an incomplete program. Complete that program, by defining a sphere_volume function, and by modifying the existing user_double function, so as to satisfy the following specs: . Function sphere_volume takes one argument, called radius. . Function sphere_volume returns the volume of a sphere with the specified radius, using the formula: .volume (4/3)* T* radius . Function user_double takes one argument, called message, which is a string. . Function user_double prints out the message, and then enters a loop, where: o The program waits for the user to enter a double number that is greater than or equal to 0. o If the user enters an invalid number, the function prints that what the user entered "is not a o If the user enters a negative number, the function prints that what the user entered "is not o If the user enters "q" or "Q", then the program exits (the code provided already takes care of o If the user enters indeed a valid double number 0, the function returns that number valid double". positive" that) IMPORTANT: you are NOT allowed to modify in any way the main function This is an example run of the complete program Please enter a radius>-0, or q to quit: what? what? is not a valid double
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started