Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Videos

Question
Book Icon
Chapter 1, Problem 5PE
Program Plan Intro

chaos program

Program Plan:

  • Declare a main function. Inside the main function,
    • Print the statement
    • Get the value from the user
    • Traverse the value of “x” through “for” loop until “x” reaches “20”.
      • Evaluate the value of “x”.
      • Print the value of “x”.
  • Call the main function.

Blurred answer
Students have asked these similar questions
Write a program that reads in numbers from the user and outputs the information specified below. Part One: Get Valid Input  Read in two integers from the user: a lower end of a range and an upper end of a range. Check if the numbers are valid (lower cannot be greater than upper).  If the numbers are invalid, use a loop to ask for new numbers. Continue looping until you get two valid values. Part Two: Calculate the Sum  Use a loop to calculate the sum of all values from lower (inclusive) to upper (inclusive). Output the sum to the user. Part Three: Analyze the Sum  Determine if the sum is even or odd. Determine if the sum is positive, negative, or zero. Output this information to the user. Part Four: Calculate the Average  Calculate the average of all numbers in the range from lower (inclusive) to upper (inclusive). Style and Additional Coding Requirements  code should compile properly space and indent your code follow Java naming conventions for variables (lower camel case with no…
Write a program that will print the message “I love computer science” 12 times. Use a while loop. Instead of printing 12 times, ask the user how many times the message should be printed. You will need to declare a variable to store the user’s response and use that variable to control the loop. Number each line in the output, and add a message at the end of the loop that says how many times the message was printed. So if the user enters 3, your program should print this: _____________________________________   1 I love computer science 2 I love computer science 3 I love computer science   This message is printed 3 times.
Write a program that will print the message “Computer Science is cool” 10 times. Use a while loop. Instead of printing 10 times, ask the user how many times the message should be printed. You will need to declare a variable to store the user’s response and use that variable to control the loop. Number each line in the output, and add a message at the end of the loop that says how many times the message was printed. So if the user enters 3, your program should print this: _____________________________________ 1 Computer Science is cool 2 Computer Science is cool 3 Computer Science is cool This message is printed 3 times. _____________________________________
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education
Java random numbers; Author: Bro code;https://www.youtube.com/watch?v=VMZLPl16P5c;License: Standard YouTube License, CC-BY