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, 22.06.2019 18:00
Write a method named addall that could be placed inside the hashintset class. this method accepts another hashintset as a parameter and adds all elements from that set into the current set, if they are not already present. for example, if a set s1 contains [1, 2, 3] and another set s2 contains [1, 7, 3, 9], the call of s1.addall(s2); would change s1 to store [1, 2, 3, 7, 9] in some order. you are allowed to call methods on your set and/or the other set. do not modify the set passed in. this method should run in o(n) time where n is the number of elements in the parameter set passed in.
Answers: 2
question
Computers and Technology, 22.06.2019 18:30
Kto rozmawia z clamentain przez krótkofalówke w the walking dead która śledzi lee w 4 epizodzie
Answers: 1
question
Computers and Technology, 23.06.2019 12:00
3. when you right-click a linked spreadsheet object, what commands do you choose to activate the excel features? a. linked worksheet object > edit b. edit data > edit data c. linked spreadsheet > edit d. object > edit data
Answers: 2
question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
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, 29.03.2020 12:45
question
History, 29.03.2020 12:45
question
Physics, 29.03.2020 12:45
Questions on the website: 13722360