1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
GalinKa [24]
3 years ago
7

Here is a nested loop example that graphically depicts an integer's magnitude by using asterisks, creating what is commonly call

ed a histogram: Run the program below and observe the output. Modify the program to print one asterisk per 5 units. So if the user enters 40, print 8 asterisks.num = 0while num >= 0: num = int(input('Enter an integer (negative to quit):\n')) if num >= 0: print('Depicted graphically:') for i in range(num): print('*', end=' ') print('\n')print('Goodbye.')
Computers and Technology
1 answer:
bogdanovich [222]3 years ago
7 0

Answer:

Please find the code in the attached file.

Output:

Please find the attached file.

Explanation:

In this code a "num" variable is declared that use while loop that check num value greater than equal to 0.

Inside the loop we input the "num" value from the user-end and use if the value is positive it will define a for loop that calculates the quotient value as integer part, and use the asterisks to print the value.

If input value is negative it print a message that is "Goodbye".

Please find the code link:   https://onlinegdb.com/7MN5dYPch2

You might be interested in
This function returns the length of a string:
Anna71 [15]

Answer:

The strlen() function calculates the length of a given string.The strlen() function is defined in string.h header file.

Explanation:

It doesn’t count null character ‘0’. Syntax: int strlen(const char *str); Parameter: str: It represents the string variable whose length we have to find. Return: This function returns the length of string passed.

4 0
2 years ago
What is the reason that friction is present in surface to surface contact?
Andrej [43]
One surface is larger than the other surface
3 0
3 years ago
As it turns out, the scale of this chart is higher than all of these; it’s “exponential.” What does this imply for the difficult
Oksanka [162]

Answer:

no meme

Explanation:

[...]

8 0
3 years ago
Types in java are divided into two categories. the primitive types are boolean, byte, char, short, int, long, float and double.
Rudik [331]
Types in java are divided into two categories. the primitive types are boolean, byte, char, short, not, long, float, and double. all other types are REFERENCE types
4 0
2 years ago
The power relationship on a transformer states that O Power in = power out + loss O Power in = 1/2 power out (Power in = 2 x pow
lions [1.4K]

Answer:

D

Explanation:

5 0
3 years ago
Other questions:
  • You’ve received a tarball called data79.tar from a colleague, but you want to check the names of the files it contains before ex
    15·1 answer
  • Which type of software-generated problems can indicate that a software bug is causing a memory error?
    11·1 answer
  • Write a function max arguments. write a program that reads three floating-point numbers, uses the max function, and displays the
    5·1 answer
  • "where is a cookie that is created during a web site visit​ stored?"
    9·1 answer
  • The data in a database management system that identifies the names of​ tables, fields in each​ table, and the properties of each
    13·2 answers
  • Write a programme with C++ language wich print the biggest number in between three numbers , whith INT
    14·1 answer
  • How do I delete my brainly account?<br> I don't need anymore.
    13·2 answers
  • time to throw poggers xqc time to throw pogchamp time to throw pogchamp time to throw pogchamp time to throw pogchamp time to th
    5·2 answers
  • Bukod sa nakasulat na impormasyon ay makakakita rin ng larawan sa internet.​
    9·1 answer
  • How does Accenture help companies harness the power of data to achieve optimal business outcomes?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!