Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

What will be displayed to the user? int bam(int wow){ wow++; wow = wow * wow; re

ID: 3768575 • Letter: W

Question

What will be displayed to the user?
int bam(int wow){
    wow++;
    wow = wow * wow;
    return wow;
}
int whoosh(int pow){
    int flap = 0;
    flap = bam(flap);
    pow += flap;
    return pow;
}
int main(){
    int c, output = 0;
    for (c = 0; c <= 9; c++) { output += whoosh(c) + 5; }
    cout << output - 6 << endl;
    return 0;
}

12 skydivers need to be seperated into 3 jump groups. It doesn't matter how many are in each group, but because they are fighting over who gets to go first you should determine the groups randomly. Write a program to determine the group each person will be in at random. Store the number of people in each group in an array of size 3. Store the group number assigned to each person in another array. Use a loops to output the number of people in each group and output the group number assigned to each person. The format of your output should match mine (only the number of people in each group and the group each person is assigned to should vary.)
Efficiency is good! Bonus points for code that is less than 20 lines with only one statement per line, double bonus points for code that is less than 14 lines with only one statement per line.
Example output:
group 1 - 2 people
group 2 - 6 people
group 3 - 4 people

person1 - group 3
person2 - group 1
person3 - group 3
person4 - group 2
person5 - group 2
person6 - group 2
person7 - group 3
person8 - group 2
person9 - group 2
person10 - group 1
person11 - group 2
person12 - group 3

Explanation / Answer

The output of the program is 99.

Soution: I am trying to explain it in JAVA.

package com.urbanpro.nancy.solutions;

public class Testing {
  
   //if wow = 0 then this function will always return 1
   static int bam(int wow) {
       wow++;
       wow = wow * wow;
       return wow;
   }

   static int whoosh(int pow) {
       int flap = 0;
       //flap = 1 here.returned value from bam().
       flap = bam(flap);
       //Here pow=1 then ==> pow = pow + flap = 1+0=1
       pow += flap;
       //1 will be returned.
       return pow;
   }

   public static void main(String[] args) {
       int c, output = 0;
       for (c = 0; c <= 9; c++) {
           //Here output = output + (value returned from function) + 5
           //Output values for each iteration of loop 6 13 21 30 40 51 63 76 90 105
           output += whoosh(c) + 5;
           System.out.print(" " + output);
       }
       //FInally 105-6 = 99 is the result
       System.out.println(output - 6);
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote