subject

This was a quiz that I submitted earlier in the semester but I had not received full points due to a coding mistake. Below, I will provide the instructions and the code that needs to be changed in order for the program to work. Any place that has a "// Student Code Here" or "// Test Your Methods Here" must be changed accordingly. INSTRUCTIONS:Step 1Fill in the doubleOrNothing method, which takes an int as a parameter. If the number is less than 100, return that number doubled. Otherwise, return zero. For example, passing 4 to this method would return 8, but passing 104 to this method would return 0.Step 2Fill in the formatPercentmethod, which takes a double as a parameter that represents a percent value between 0 and 1. This method returns a String that is the percentage between 0 and 100 percent, with one place following the decimal before a '%'.For example, passing the double '.85' would return the string "85.0%".Step 3Fill in the everyOtherChar method, which takes a String parameter called word*. This method returns an int which computes the sum of the ASCII values of *every other* character in the parameter word, starting with the first character. For example, passing the word "yam" into the method would tally the ASCII value of the characters 'y' and 'm', which have ASCII values of 121 and 109 respectively, so the method would return 230.Test Your MethodsTest your methods by calling them within main. You may run your program in Develop mode as many times as you would like, but you may only submit your program once. CODE:public class quiz1 { // Step 1 public static int doubleOrNothing(int num) {e // student code here } // Step 2 public static String formatPercent(double percent) { // student code here } // Step 3 public static int everyOtherChar(String word) { // student code here } public static void main(String [] args) { // test your methods here! }}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:20
Geneva’s manager would like to see some additional information to make sales decisions.enter a formula in cell j4 using the if function to it whether or not the item beaded earrings should go on sale. it will go on sale if its current sales rank (in cell g4) is 8th or lower. (hint: if the cell value is greater than or equal to 8, it will go on sale.)if this condition is true, the item will go on sale. (hint: the if_true value should be “yes”.)if this condition is false, the item doesn’t need to go on sale. (hint: the if_false value should be “-”.)copy the formula created in cell j4 to the range j5: j14
Answers: 2
question
Computers and Technology, 22.06.2019 23:30
Which of the following is not a symptom of chronic fatigue syndrome
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
:you areto design the controller for alight that functions both as an ordinary light and also as a motion activated light and alarm. a.if the manual switch s is on, then the light l is on. b.besides the manual switch, there is a motion detector, m1, which activatesthis light.c.if motion is detected but the light is on anyway because s is on, only then a secondoutput a, an alarm, is turned on. d.the disable switch, d, disables the motion activated light and alarmbut leaves manual control operation of the light using switch s.(i)read the problem statement and clearly identify the inputs and outputs for the circuit you are designing. (ii)create the truth table for this system; include the light, alarm, switch, disable, and the motion sensor.(iii)draw a schematic of this system.
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Me ! evelyn is a manager in a retail unit. she wants to prepare a report on the projected profit for the next year. which function can she use? a. pmt b. round c. division d. what-if analysis
Answers: 2
You know the right answer?
This was a quiz that I submitted earlier in the semester but I had not received full points due to a...
Questions
question
Mathematics, 10.11.2020 22:40
question
Mathematics, 10.11.2020 22:40
question
Mathematics, 10.11.2020 22:40
question
Engineering, 10.11.2020 22:40
question
Mathematics, 10.11.2020 22:40
question
Health, 10.11.2020 22:40
Questions on the website: 13722361