Question

please fill the tablesWhat kind of Loop Structure is this? iterations evals Notes 16a-int (inputO) 17 b a Step Statement 18 for x in range(a 3, a5,What kind of Loop Structure is this? Step Statement Notes iterations evals 18 19 20 21 iteration-0 evals-0 print(Boolean eva17 #Assume that the first time, the user inputs Nope 18 #Assume that the second time, the user inputs -Better 19 while True:


What kind of Loop Structure is this? iterations evals Notes 16a-int (inputO) 17 b a Step Statement 18 for x in range(a 3, a5, 2): 2 20 21 else: 23 24 print(b) 4 5 6 8 9 10 12 13
What kind of Loop Structure is this? Step Statement Notes iterations evals 18 19 20 21 iteration-0 evals-0 print("Boolean evaluation #:", evals) prin "Iteration #:", iteration! 23 evals1 24 while a 1: 25 4 26 print("current value of a:" a) 27 28 iteration 1 print("Inlteration #:", iteration) 6 30 print( "Boolean evaluation#x", evals-1 evals) 31 32 34 print(InFinal value of a:, a) 35 print("InTotal iterations:", iteration) 36 print( "Total Boolean evaluations:evals) 10 12

17 #Assume that the first time, the user inputs "Nope 18 #Assume that the second time, the user inputs -Better 19 while True: 2 word-input("Enter a word at Least 5 characters Long: 21 f len(word) 5: break Step 1 Statement Notes word len(word) letter 23 24 for letter in word: 25 print (letter) 4 5 6 7 8 9 10 12 13 14
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Considering the solution in JAVA:

Program1:

/*package whatever //do not write package name here */

import java.io.*;

class GFG {
   public static void main (String[] args) {
           int a=7;
   int iteration=0;
   int evals=0;
   System.out.println("Boolean evaluation#"+ evals);
   System.out.println("Iteration#"+ iteration);
while (true)

{ System.out.println("\ncurrent value of a:"+ a);
iteration += 1;
System.out.println("iteration#:"+ iteration);
   evals += 1;
System.out.println("evals#:"+ evals);
if (a <=1)
{break;}
a -=2;
}
   System.out.println("\nfinal value of a:"+ a);
System.out.println("\ntotal iterations:"+ iteration);
System.out.println("\ntotal boolean evaluations:"+ evals);
   }
}

Solution:

Boolean evaluation#0
Iteration#0

current value of a:7
iteration#:1
evals#:1

current value of a:5
iteration#:2
evals#:2

current value of a:3
iteration#:3
evals#:3

current value of a:1
iteration#:4
evals#:4

final value of a:1
total iterations:4
total boolean evaluations:4

adocs.google.com Appla aogla Yahoa Inbax 15751 -lavashkhurana927Ogmail.cam -Gmail To-da ist Gaogle Sherts To-do list Share Fi

Add a comment
Know the answer?
Add Answer to:
What kind of Loop Structure is this? iterations evals Notes 16a-int (inputO) 17 b a Step Statemen...
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
  • What kind of Loop Structure is this? Step Statement Notes iterations evals 8 iteration-8 9 evals-...

    What kind of Loop Structure is this? Step Statement Notes iterations evals 8 iteration-8 9 evals-0 print( "Boolean evaluation #:", evals) print( "Iteration #: .., iteration) 2 2 while True: 4 5 print("Incurrent value of a:, a) iteration1 print( "Iteration #:", iteration) evals +1 print( "Boolean evaluation #:", evals) 7 8 9 10 ifa <-1: 5 print( InFinal value of a:"a) print("InTotal iterations:", iteration) print("Total Boolean evaluations:", evals) 12 13 What kind of Loop Structure is this? Step Statement Notes...

  • In this lab you will convert lab5.py to use object oriented programming techniques. The createList and...

    In this lab you will convert lab5.py to use object oriented programming techniques. The createList and checkList functions in lab5.py become methods of the MagicList class, and the main function of lab6.py calls methods of the MagicList class to let the user play the guessing game.                              A. (4pts) Use IDLE to create a lab6.py. Change the 2 comment lines at the top of lab6.py file: First line: your full name Second line: a short description of what the program...

  • c++ please :) First, ask the user to enter a year (4-digit) and what week day...

    c++ please :) First, ask the user to enter a year (4-digit) and what week day does this year starts with (String) For example, the year 2018 starts with the week day "Friday". In this case, the calendar should start from January 1 which is Friday, 2018 Your program should produce a formatted calendar for the specified year and there should be a blank line after each month. Moreover, the month and the year should be centered over each month....

  • Programming in C. Name this program schwifty.c - This program reads a text file and makes...

    Programming in C. Name this program schwifty.c - This program reads a text file and makes it schwifty, but the user determines the schwiftiness. The user supplies the filename to schwift and a string containing a sequence of the following characters to determine the schwiftiness via command line arguments: L - Left shift each character in a word: hello --> elloh R - Right shift each character in a word: elloh --> hello I - Shift the letters' and digits'...

  • C Thank You for You x Home - OwNet x B Assignment 401 X CPP-A01 -...

    C Thank You for You x Home - OwNet x B Assignment 401 X CPP-A01 - Dynam x ASM-103 - Intege X ASM-A03 - Integex Calculus - Find voll x D (10) Disc method X + -ox + → C onedrive.live.com/view.aspx?resid-322690C11EFFEB37!1631&ithint-file%2cdocxêauthkey-!AOJByR3MAP202A Word Sign in OneDrive CPP-A01 - Dynamic Multiplication Table Accessibility Mode Download Save to OneDrive Print ... When completing this assignment, the student should demonstrate mastery of the following concepts: • Visual Studio Project Creation • C++ Formatted Output...

  • What is the role of polymorphism? Question options: Polymorphism allows a programmer to manipulate objects that...

    What is the role of polymorphism? Question options: Polymorphism allows a programmer to manipulate objects that share a set of tasks, even though the tasks are executed in different ways. Polymorphism allows a programmer to use a subclass object in place of a superclass object. Polymorphism allows a subclass to override a superclass method by providing a completely new implementation. Polymorphism allows a subclass to extend a superclass method by performing the superclass task plus some additional work. Assume that...

  • Questions 1. How to create a comment in python? 2. The way to obtain user input...

    Questions 1. How to create a comment in python? 2. The way to obtain user input from command line 3. List standard mathematical operators in python and explain them 4. List comparison operators in python 5. Explain while loop. Give example 6. Explain for loop. Give example 7. How to create infinite loop? And how to stop it? 8. Explain a built-in function ‘range’ for ‘for’ loop 9. Explain break statement 10. Explain continue statement 11. Explain pass statement 12....

  • pls answer all questions 1) A step-by-step solution to a problem is called a. hardware b....

    pls answer all questions 1) A step-by-step solution to a problem is called a. hardware b. an operating system c. a computer language d. an algorithm 2) separated the programming task from the computer operation tasks. a. Algorithms b. Data processors c. High-level programming languages d. Operating systems 3) is a 16-bit code that can represent symbols in languages other than English. a. ASCII b. Extended ASCII c. EBCDIC d. Unicode 4) When you want to download music to a...

  • so i have my c++ code and ive been working on this for hours but i...

    so i have my c++ code and ive been working on this for hours but i cant get it to run im not allowed to use arrays. im not sure how to fix it thank you for the help our job is to write a menu driven program that can convert to display Morse Code ere is the menu the program should display Menu Alphabet Initials N-Numbers - Punctuations S = User Sentence Q- Quit Enter command the user chooses...

  • Objective : Write a C Shell script which copies all files(*.java and *.class) from your home dire...

    Objective : Write a C Shell script which copies all files(*.java and *.class) from your home directory to a new one, and Analyze the new directory information such as number of files, user permissions, and disk usage. Sample Output:                                                    << CS Directory Analysis >>      Date:   ============================================================ Current Directory: /home/tomss New Directory Created : /home/tomss/pgm01 File information Total Number of files : 22 files Directory files:   0 files Plain text files:   10 files File have read permissions: 3 files File have...

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