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
kompoz [17]
3 years ago
13

Input an int greater than 0 and print every multiple of 5 between it and 0 inclusive in descending order. If the number is not g

reater than 0 print "error". Print all numbers on one line with single spaces in between.
Example:
Enter a positive integer:
42
40 35 30 25 20 15 10 5 0
Computers and Technology
1 answer:
Alexus [3.1K]3 years ago
8 0

import java.util.Scanner;

public class JavaApplication42 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.println("Enter a positive integer:");

       int num = scan.nextInt();

       if (num < 0){

           System.out.println("error");

       }

       else{

           while(num >=0){

               if (num %5 == 0){

                   System.out.print(num+" ");

               }

               num--;

           }

       }

   }

I hope this helps!

You might be interested in
Your brother is starting 9th grade next year and is thinking about going to college. What step would you recommend he take?
postnew [5]
I would say D. Usually students aren't expected to fill out the FAFSA till junior or senior year, this is because it is based on household income which may change every year. Also, guidance counselor's can help students on the right track to go to classes. Clubs and/or sports teams look really good on college applications and are usually preferred by colleges. 
4 0
3 years ago
When determining the statement of purpose for a database design, what is the most important question to ask?
mamaluj [8]
D how many tables will be in the database
3 0
3 years ago
Read 2 more answers
A group of computers that are interconnected order to share information or document is called a
Shkiper50 [21]
Group of computers that are interconnected in order to share information or documents is called <span>Computer network.



                                                            
Hope this helps.
</span>
5 0
3 years ago
Read 2 more answers
Write a function get_initials(the name) that takes a string of a name and returns the initials of the name, in upper case, separ
spayn [35]

Answer:

Following are the code to this question:

def get_initials(the_name): #defining a method get_initials

   name = the_name.split(" ") #defining name variable that splits value

   val = ''#defining a string variable val  

   for n in name:  #defining loop to convert value into upper case and store first character

       val = val + n[0].upper() + "."  # use val variable to hold value

   return val # return val

print(get_initials("Gloria kind of a big deal Tropalogos"))#call method and print return value

print(get_initials("Homer J Simpson"))#call method and print return value

print(get_initials("John Q Public")) #call method and print return value

Output:

J.Q.P.

H.J.S.

G.K.O.A.B.D.T.

Explanation:

In the given code, the last is incorrect because if we pass the value that is "Gloria kind of a big deal Tropalogos" so, will not give G.O.O.D. instead of that it will return G.K.O.A.B.D.T.  So, the program description can be given as follows:

  • In the given python code, a method "get_initials" is declared, that accepts "the_name" variable as a parameter, inside the method "name" variable is declared, which uses the split method that splits all values.
  • In the next step, a string variable "val"  and for loop is used, in which the "val" variable converts the first character of the string into the upper case and stores its character with "." symbol in "val" variable and return its value.
  • In the last step, the print method is used, that passes the string value and prints its sort value.
3 0
4 years ago
One advantage of a PAN​
drek231 [11]

Answer:

advantage is:

Data can Synchronize between different devices.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Most input/output devices communicate with components inside the computer case through a wireless connection or through cables a
    8·1 answer
  • How do u change the level of education on Brainly. cuz i just finished elementry
    9·2 answers
  • What table element represents a field within a record in powerpoint A column B Row C header D footer
    14·1 answer
  • Write a program that will manipulate Rectangle objects for which you will create a Rectangle class.
    5·1 answer
  • Which custom configuration is most likely to include a raid array?
    14·1 answer
  • Which of the following are breach prevention best practices?Access only the minimum amount of PHI/personally identifiable inform
    11·1 answer
  • Write a function to prompt the user to enter the information for one movie (title, release date, mpaa rating and number of stars
    8·1 answer
  • A photographer is reading about how to ensure a high-quality photographic print. Which statements convey the best way to ensure
    5·1 answer
  • Draw and implement of an organization which have 125 employees. use the following features 1.email services 2.lan communication
    8·1 answer
  • Let A and B be regular languages. Is the set of strings of odd length from A beginning with 0 concatenated with the set of strin
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!