Question
1. Answer the following in JAVA a) Write a function that returns the result of multiplying six by five, adding eighteen, and dividing all of
1. Answer the following in JAVA
a) Write a function that returns the result of multiplying six by five, adding eighteen, and dividing all of that by 8.
b) Write a function that takes ounces and converts them to kilograms. This function has one argument, which is the number of ounces to be converted and should return a float which is the equivalent number of kilograms. There are 0.0283 kilograms per ounce
c) Write a function that checks if a freezer has become so warm that the food within it is spoiled. The temperature is in degrees and is passed to your function via a float called temp. If the temperature is less than -14 degrees, then you should return false (safe). If the temperature is any higher, then return true (alarm).
d) Write a public procedure/function with no arguments. This should then count from 1 to 24, every time calling Assessment5Y2022.loop(n), where n is the loop counter. At the end, it should call Assessment5Y2022.loopEnd() once and only once.
e) Write a public procedure/function that should accept an array of integers that represent a strand of DNA. The function checks to see if there are any errors and returns false if there are and true (OK) if not. An error will occur if there is a value greater than 4 or less than 0 anywhere in the array. For example, the array {0,3,2,3,1} would return true and the array {0,2,4,4,2,1,3,5,4} would return false. Note your function might be called more than once to check it. Your solution should not depend upon the first values given to it.
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