Write a program to display the following image. a. Request an integer from the console. b....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Write a program to display the following image. a. Request an integer from the console. b. If the integer is -1 then exit the program, otherwise stay in a loop asking for input c. If the integer is not odd repeat the request and wait for an odd number. d. If the integer is odd then output the image shown below using a nested loop. After you have output the image go back to the top and request another integer e. Your code must produce the same image (of varying size) for any odd numbers entered. Example Output Enter an odd integer or -1 to quit: 8 Must enter an odd integer, try again. Enter an odd integer or -1 to quit: 9 Enter an odd integer or -1 to quit: 5 Enter an odd integer or -1 to quit: -1 End of program. Write a program to display the following image. a. Request an integer from the console. b. If the integer is -1 then exit the program, otherwise stay in a loop asking for input c. If the integer is not odd repeat the request and wait for an odd number. d. If the integer is odd then output the image shown below using a nested loop. After you have output the image go back to the top and request another integer e. Your code must produce the same image (of varying size) for any odd numbers entered. Example Output Enter an odd integer or -1 to quit: 8 Must enter an odd integer, try again. Enter an odd integer or -1 to quit: 9 Enter an odd integer or -1 to quit: 5 Enter an odd integer or -1 to quit: -1 End of program.
Expert Answer:
Answer rating: 100% (QA)
Heres a Python program that follows your requirements to display the image when a... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
5. (15 Pt.) 4-bit carry look-ahead adder a. (10 Pt.) Show the Boolean algebra of Carry-propagate(P=P3P2P1Po) function and Carry- generate(G=93929190) function, and draw a logic gate of 4-bit carry...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
Heating oil futures contracts are traded on the New York Mercantile Exchange (NYM), a division of the CME Group. The standard contract size for heating oil futures is 43,600 gallons per contract. You...
-
Medical research has shown that between heartbeats, the pressure in the aorta of a normal adult is a function of time in seconds and can be modeled by the equation P = 95e-0.491t (a) Use the...
-
Why does accounting rely on inexact or approximate measures?
-
Answer the following questions about normal curves: a. What are the characteristics of the normal curve? b. What human behavior, trait, or characteristic can you think of that is distributed normally?
-
Outdoor Recreation Products Inc. had 50,000 shares of common stock outstanding at the end of 2010. During 2011 and 2012, the following transactions took place. 2011 Mar. 31 Sold 10,000 shares at $24....
-
A ball is released from rest at the top of an inclined plane, whose length is d = 140 cm. It takes the ball t = 0.70s to roll down to the bottom of the plane. (a) What is the ball's acceleration down...
-
The Walton Toy Company manufactures a line of dolls and a sewing kit. Demand for the company's products is increasing, and management requests assistance from you in determining an economical sales...
-
"Facebook said that it paid $19 billion to buy messaging company WhatsApp. Shares rose 2.3%to $69.93 on Thursday. Facebook options trading volume was running at nearly three times its daily average...
-
You are the owner of a mid-sized insurance company. You have 25 agents who travel throughout the country, making presentations to small groups of 1020 people. You want to create a template that all...
-
Stella can work up to 16 hours per day at her job. Her wage rate is $8.00 per hour for the first 8 hours. If she works more than 8 hours, her employer pays time and a half. Draw Stellas daily budget...
-
Create a data type Universe3D to model three-dimensional universes. Develop a data file to simulate the motion of the planets in our solar system around the sun.
-
Combining Enterprise Fund statements in the CAFR are required to include at a minimum: a. each individual Enterprise Fund. b. each individual major Enterprise Fund. c. each individual nonmajor...
-
The room shown in Figure 7.34 has a heater with heat flow rate input of \(q_{0}\). The thermal capacitances of the heater and the room air are \(C_{1}\) and \(C_{2}\), respectively. The thermal...
-
Consider an economy inhabited by H households, which are identical in every respect so that we can talk in terms of a representative household. The household has a single inifnitely-lived member. He...
-
Prove that if Σ an is absolutely convergent, then a. an
-
Determine the support reactions at and . Take E = 29(10 3 ) ksi, I = 300 in 4 , A = 10 in 2 for each member. 2 k/ft A7 42 (2 6. 2 (3 3 20 ft 10 ft 8.
-
Determine the force in each member. AE is constant. 4 kN 6 kN 4 m. Prob. 9-25 D C. B 3 m 3 m
-
Determine the vertical displacement of point A. Assume the members are pin connected at their ends. Take A = 100 mm 2 and E = 200 GPa for each member. Use the method of virtual work. 10:00 tal TON...
-
What is thermodynamics?
-
An astronaut weighs \(800 \mathrm{~N}\) on the earth's surface where the acceleration of gravity is \(g=9.83 \mathrm{~m} / \mathrm{s}^{2}\). The mass and the radius of the moon are \(7.4 \times...
-
Explain the scope and limitations of thermodynamics.
Study smarter with the SolutionInn App