Question

loops a.Create a For loop with a variable i that is type integer. It is equal...

loops

a.Create a For loop with a variable i that is type integer. It is equal to 0 . Evaluate if i is less than three, then increment i. Statement should be to trace

b. Create a For Loop with a variable i equal to 3. If I is greater than 0, decrement i. The statement should be to trace i

c. Declare a variable for i to be an integer with a value of 0. While it is less than 5, trace i and then increment i

d. Declare a variable for i which is an integer and set the value to 0. Create a do while loop for it to trace “test “+i and increment i while I is less than 10.

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
loops a.Create a For loop with a variable i that is type integer. It is equal...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • // Group Names: // Date: // Program Description: //   Import required packages //--> //   Declare class...

    // Group Names: // Date: // Program Description: //   Import required packages //--> //   Declare class (SwitchDoLab) //--> {    //   Declare the main method    //-->    {        //   Declare Constant integers SUM = 1, FACTORIAL = 2, QUIT = 3.        //-->        //-->        //-->        //   Create an integer variable named choice to store user's option.        //-->        //   Create a Scanner object        //   Create...

  • Evaluate Exponent: Declare a double variable called result and initialize it to 1.0; Ask the user...

    Evaluate Exponent: Declare a double variable called result and initialize it to 1.0; Ask the user for two values - one for the base, and the other for the exponent. If the exponent parameter is 0, give the user an error. You do not need to handle a negative exponent value. Otherwise, declare an integer variable called loop and initialize it to 0 Write a do while loop as follows: Inside the loop: Multiply the results times the number Increment...

  • java code please 14. Next we'll complete the setValues() method. Instead of giving you exact code...

    java code please 14. Next we'll complete the setValues() method. Instead of giving you exact code I'll tell you what to do. Use other code as a guide.  Start with a for loop with a start of int i = 0  Set the ending point of when i is less than the length of the arr array.  Set the incrementation to increase i by 1 using the unary operator ++.  Within the loop set the arr...

  • What is wrong with the following pseudocode? Declare Count As Integer Declare TheNumber As Integer Set...

    What is wrong with the following pseudocode? Declare Count As Integer Declare TheNumber As Integer Set TheNumber = 12 For (Count = 10; Count>TheNumber; Count--) Write TheNumber + Count End For A) The limit condition in a For loop cannot be a variable B) The loop will never be entered since the initial value of Count is less than the test condition C) The loop will never end since the test condition will never be met D) A counter must...

  • #include<stdio.h> int main() { int i; printf("Type an integer value: "); scanf("%d",&i); evaluate(i); return(0); } void...

    #include<stdio.h> int main() { int i; printf("Type an integer value: "); scanf("%d",&i); evaluate(i); return(0); } void evaluate(int x) { if(x > 10) printf("Value entered by you is greater than 10"); else if(x < 10) printf("Value entered by you is less than 10"); else printf("Value entered by you is equal 10"); } _______________________________________ report for this in hr ?

  • I should use the array and loop to create a java program according to the instruction,...

    I should use the array and loop to create a java program according to the instruction, but I have no idea how to do it. Introduction This lab assignment continues to give you practice using loops, particularly loops with variable termination conditions, and it also provides you an opportunity to use one-dimensional arrays. Recall that an array is used to store a collection of data. The data can be values of Java primitive data types or else objects (for instance,...

  • in c++ language 1.Re-write the following for loop statement by using a while loop statement: int...

    in c++ language 1.Re-write the following for loop statement by using a while loop statement: int sum = 0; for(int i=0;i<=1000;i++){                 sum+=i; } 1 (b). Following is the main () function of a program. The program asks a user to enter 150 integers and print the largest integer user entered. int main() {    int score, highest;             //missing portion of the program             return 0;    } 1(c). Find the missing portion of the following code, so the...

  • Python Write the definition of a class Counter containing: An instance variable named counter of type...

    Python Write the definition of a class Counter containing: An instance variable named counter of type int An instance variable named limit of type int. A constructor that takes two int arguments and assigns the first one to counter and the second one to limit A method named increment. It does not take parameters or return a value; if the instance variable counter is less than limit, increment just adds one to the instance variable counter. A method named decrement....

  • Write a program that: program starts; declares and initializes to 10 an integer variable i; uses...

    Write a program that: program starts; declares and initializes to 10 an integer variable i; uses a do loop; print on new line “loop pass # “ and i; if i = 4 break default decrement i by 1 by stating i once; test condition i > 0; just before ending print on new line “Program finished!” then terminate program.

  • Answer each of the following questions about loops in C++. In each question, LABEL the three...

    Answer each of the following questions about loops in C++. In each question, LABEL the three parts of the loop. a.) Write a while statement that will ask the user for integers until the user enters the sentinel value of -1. Declare all needed variables. b.) Write a for statement that will print out all the multiples of 3 between 1 and 200. Declare any needed variables. c.) Write a do while loop that will ask the user for characters...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT