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
As the performance of PCs steadily improves, computers that in the past were classified as midrange computers are now marketed a
taurus [48]

Answer: PC servers

Explanation: PC(Personal computer) servers are the helps in the utilization of the network services to the software and hardware of the computer. It manages the network resources . In the past time ,Mindrange computers, mini computers etc are present time's PC servers.

Other options are incorrect because laptops ,PDA(Personal digital assistant) or tablets are the modern version of the computer units that are portable and compact with fast processing. Thus the correct option is option PC servers.

5 0
3 years ago
Add Try/Catch error checking To make sure that the user enters valid values in your program. To catch negative values passed to
ryzh [129]

Answer:

int main()

{

 cout<<"Enter the size of array\n";

 int n;

 try{

 cin>>n;//get size of array

 if (n > 0){

 List list;//make object of list class

 try{

     list.init(n);//initialize the list

     list.fillData();//fill the data

     list.print();//print the data

     list.sortData();//sort the  data

     cout<<"\n--- After sorting the data---\n";

     list.print();//print the data

     cout<<"Enter the element to search\n";

     int x;

     cin>>x;//get element to search

     list.searchElement(x);//call the search function

 }

 catch (std::bad_alloc){

   cout<<"Sorry, could not allocate memory for list object.";

 }

 }else{

   throw('Negative Number detected');

 }

 }

 catch (int n){

   cout<<"The number should be a positive integer.";

 }

   return 0;

}

Explanation:

The try and catch keywords come in pairs, as they are used to control exceptions in the C++ source code. The try keyword checks for error in the source code given the condition (if the n integer variable is greater than 0). If the condition is met, the code in the try code block runs otherwise the catch keyword catches the error of a negative number (if the n variable in less than 0).

4 0
2 years ago
To implement the various placement algorithms discussed for dynamic partitioning (see Section 7.2 ), a list of the free blocks o
STatiana [176]

Answer:

Check the explanation

Explanation:

Consider the following data

Let S represent the average number of segments

Let H represent the average number of holes

The probability that there is a hole immediately after the segment is 0,

So, when there are s segments in memory, there must be

s X 0.5 or \frac{s}{2}

Best-fit: this analyses the entire memory partitions available

a. you’ll have to selects the least one which is capable of handling the process exec.. Memo, space wastage .n be reduced In some cases, there will be no memory wastage

The average length a search is \frac{s}{2}

First-fit: This technique assigns Me the first hole that is big enough.

Searching Marts at the starting of Me set of holes.

The searching will be closed immediately a user gets a free hole that is big enough.

On an average it searches half of the set of holes.

The average length of search is Y2

\frac{s/2}{2} = \frac{s}{4}

5 0
3 years ago
I'm curious why I would need to know this on a school learning site.
zhannawk [14.2K]
no idea either lol, I mean school forces you to learn





..
4 0
3 years ago
Given half a chance other people at work will take advantage of you
Damm [24]

have self-control and if you have a problem dont be afraid to speak your mind, show other people you mean buisness, but be polite to aviod starting more problems

3 0
2 years ago
Other questions:
  • According to the partnership for 21st-century learning critical thinking ability includes all the following skills except
    15·1 answer
  • Which windows tool is used to determine if a dynamic disk is corrupted?
    6·1 answer
  • Where do scanned documents go in windows 10?
    11·1 answer
  • List 5 different programming languages calls to print
    8·2 answers
  • In Windows Vista, the Run command can be found in which application?
    6·1 answer
  • What are three ways you cite evedince
    5·2 answers
  • What is f(-3) for the function f(a)=-2a2-5a+4?​
    10·1 answer
  • The complete process for learning through repetition is to read, write, say, rest and revisit the information. Please select the
    12·2 answers
  • Which terms would be found in search for "Mo*”? Check all that apply.
    8·1 answer
  • 5 points)*list all of the data that needs to be kept track of for the scenario above in a 1nf (flat file) table (20 points)*use
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!