Computers and Technology

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! }}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 04:31, hargunk329
Q13 what function does a security certificate perform? a. creates user accounts b. scrambles data c. identifies users d. creates password policies e. provides file access
Answers: 1
image
Computers and Technology, 23.06.2019 09:00, 19youngr
Which company provides a crowdsourcing platform for corporate research and development? a: mtruk b: wiki answers c: mediawiki d: innocentive
Answers: 2
image
Computers and Technology, 23.06.2019 11:00, la200564
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
image
Computers and Technology, 24.06.2019 11:20, brittanybyers122
Print "censored" if userinput contains the word "darn", else print userinput. end with newline. ex: if userinput is "that darn cat.", then output is: censoredex: if userinput is "dang, that was scary! ", then output is: dang, that was scary! note: if the submitted code has an out-of-range access, the system will stop running the code after a few seconds, and report "program end never reached." the system doesn't print the test case that caused the reported message.#include #include using namespace std; int main() {string userinput; getline(cin, userinput); int ispresent = userinput. find("darn"); if (ispresent > 0){cout < < "censored" < < endl; /* your solution goes here */return 0; }
Answers: 3
Do you know the correct answer?
This was a quiz that I submitted earlier in the semester but I had not received full points due to a...

Questions in other subjects:

Konu
Mathematics, 14.12.2021 06:20
Konu
Mathematics, 14.12.2021 06:20
Konu
Mathematics, 14.12.2021 06:20