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
7nadin3 [17]
3 years ago
10

Plzz help.... i will mark u as brainliest if u answer correct

Computers and Technology
1 answer:
shtirl [24]3 years ago
3 0

Answer:

import java.util.Scanner;

class Main {

 public static void main(String[] args) {

   Scanner scan = new Scanner(System.in);

   while(true) {

     System.out.print("Enter an integer (0 to exit): ");

     int num = scan.nextInt();

     if (num == 0) break;

     if (num%3 == 0 && num%5 == 0) {

       System.out.printf("%d is divisable by both 3 and 5.\n", num);

     }

     else if (num%3 == 0 && num%5 != 0) {

       System.out.printf("%d is divisable by 3 but not by 5.\n", num);

     }

     else if (num%3 != 0 && num%5 == 0) {

       System.out.printf("%d is divisable by 5 but not by 3.\n", num);

     } else {

       System.out.printf("%d is not divisable by 3 or 5.\n", num);

     }

   }

   scan.close();

 }

}

You might be interested in
What is an input and output device? Give examples.​
yanalaym [24]

Answer:

input devices are a piece of equipment used to provide data to the computer examples:  mouse, keyboard, scanner, camera, etc

output devices are any piece of computer hardware equipment which converts information into a human readable form examples: printer, monitor, and others

6 0
3 years ago
50 points!!!!!
prohojiy [21]
I would say a. correcting others' spelling and grammar.
3 0
4 years ago
Read 2 more answers
1. INTRODUCTION In this project, you will gain experience with many of the Python elements you’ve learned so far, including func
yulyashka [42]

Answer:

See Explaination

Explanation:

def process_string(s):

global char#global varibles

char=[]

global count

count=[]

for i in s:

#checking whether i is alphabet or not

if(i.isalpha()):

#converting to lower

i=i.lower()

if i in char:

#if char already present increment count

count[char.index(i)]+=1

else:

#if char not present append it to list

char.append(i)

count.append(1)

#menu

print("1. Enter a string")

print("2. Display the string")

print("3. Reverse the string")

print("4. Append a string to the existing one")

print("5. Slice the string")

print("6. Display the number of occurences of each letter")

print("7. Quit")

op=input("Enter option:")

#as I don't know what you have covered

#I am trying to make it simple

#checking whether input is numeric or not

#you can use try except if you want

while(not op.isnumeric()):

op=input("Enter valid option:")

op=int(op)

global x

while(op!=7):

if(op==1):

x=input("Enter a string: ")

elif(op==2):

print("The string is:",x)

elif(op==3):

x=x[::-1]#reversing the string

print("The string is:",x)

elif(op==4):

y=input("Enter a string: ")

x=x+y #string concatnation

elif(op==5):

a=input("Enter first integer: ")

while(not a.isnumeric()):

a=input("Enter valid first integer: ")

a=int(a)

b=input("Enter second integer: ")

while(not b.isnumeric()):

b=input("Enter valid second integer: ")

b=int(b)

x=x[a:b]#string slicing

#you can also use x.slice(a,b)

elif(op==6):

process_string(x)

for i in range(len(char)):

print(char[i],",",count[i])

else:

#incase of invalid input

print("Invalid option")

print("1. Enter a string")

print("2. Display the string")

print("3. Reverse the string")

print("4. Append a string to the existing one")

print("5. Slice the string")

print("6. Display the number of occurences of each letter")

print("7. Quit")

op=input("Enter option:")

while(not op.isnumeric()):

op=input("Enter valid option:")

op=int(op)

6 0
3 years ago
What is the maximum value for any octet in an ipv4 ip address?
VladimirAG [237]
They're bytes consisting of 8 bits, so the max value is 2^8-1 = 255
3 0
4 years ago
Write an expression to detect that the first character of the userInput matches the firstLetter.
Strike441 [17]
Easy just put ur answrr
8 0
3 years ago
Other questions:
  • What is computer ?how does it work​
    6·2 answers
  • While conducting an IS audit of a service provider for a government program involving confidential information, an IS auditor no
    14·1 answer
  • Formulate it as a tree search problem.
    15·1 answer
  • Which of these statements best compares P waves and S waves of an earthquake?
    5·1 answer
  • "1jaiz4 and 1 more users found this answer helpful" - who the heII is 1jaiz4?
    12·1 answer
  • ______design A plan for the actual implementation of the system.
    9·2 answers
  • What is Mobile Edge Computing? Explain in tagalog.​
    5·2 answers
  • NEED HELP! BRAINLIEST FOR WHOEVER ANSWERS CORRECTLY FIRST!!!
    14·1 answer
  • Select the correct text in the passage.
    15·1 answer
  • ____________________ is the use of an algorithm to scramble data into a format that can be read only by reversing the algorithm.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!