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
Harlamova29_29 [7]
3 years ago
15

PLEASE HELP ASAP (answer is needed in Java) 70 POINTS

Computers and Technology
1 answer:
8_murik_8 [283]3 years ago
6 0

import java.util.Scanner;

public class MyClass1 {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     int smallest = 0, largest = 0, num, count = 0;

     while (true){

         System.out.println("Enter a number (-1 to quit): ");

         num = scan.nextInt();

         if (num == -1){

             System.exit(0);

         }

         else if (num < 0){

             System.out.println("Please enter a positive number!");

         }

         else{

             if (num > largest){

                 largest = num;

                 

             }

             if (num < smallest || count == 0){

                 smallest = num;

                 count++;

             }

             System.out.println("Smallest # so far: "+smallest);

             System.out.println("Largest # so far: "+largest);

         }

     }

   }

}

I hope this helps! If you have any other questions, I'll do my best to answer them.

You might be interested in
6. According to camp policy, staff members need to be at least 23 years old to transport students. Dean now wants to determine h
Kamila [148]

Answer:

This seems to be related to MS Excel, here we will discuss the related formula:

<u>=IF(VLOOKUP("Adam Moriarty",$B$3:$C$5,2)>23,"Yes","No")</u>

the name can also be written in adjacent to J2 cell i.e. I2 and its reference to be used in vlookup primary key as follows:

<u>=IF(VLOOKUP(I2,$B$3:$C$5,2)>23,"Yes","No")</u>

Explanation:

We have used simple IF function combined with VLOOKUP function to reference this formula to the table of names and ages of the members (here the table is $B$3:$C$5 and ages are mentioned in 2nd column of the table)

please find attached screenshot for clarification

6 0
3 years ago
Find every number from 1 to n (inclusive) that is a palindrome which starts with the digit 3. Do not user a helper function.
Mkey [24]

Answer: Following code is in python

n=input()

num='1'

while int(num)<=int(n):    //loop from 1 to n

   flag=1   //if an unequal element will be found it will be 0

   l=len(num)

   if num[0]=='3':

       j=0

       k=l-1

       while j<k:    //loop till middle of number

           if num[j]==num[k]:

               j+=1     //from beginning

               k-=1    //from end

           else:

               flag=0

               break

       if flag==1:

           print(int(num))

   num=str(int(num)+1)    //number will be incremented as integer

INPUT :

1000

OUTPUT :

3

33

303

313

323

333

343

353

363

373

383

393

Explanation:

In the above code, a loop is executed till num is equal to n which is entered by the user. num is treated as a string so that to ease the process of checking first character is 3 or not. If it is 3 then another loop executes which checks if an element from starting is equal to the corresponding element from the end. If an element is not equal then the flag is changed and then we break out of the loop and prints the number if the flag isn't changed.

7 0
3 years ago
Which type of loop is best if you do not know how many times you need the loop to run?
Alex
While: <span> the loop must repeat until a certain "condition" is met.  If the "condition" is FALSE at the beginning of the loop, the loop is never executed.  The "condition" may be determined by the user at the keyboard.  The "condition" may be a numeric or an alphanumeric entry.  <span>This is a good, solid looping process with applications to numerous situations. 
</span></span><span>while:<span>int ctr = 1;
while (ctr < = 20)
{
     cout<< ctr++ <<"\n";
}

</span><span>
</span><span>
</span><span>HOPE i HELPED! brainliest? :D </span></span>
5 0
3 years ago
Database accessibility DBA writes subschema to decide the accessibility of database.
Crank
The answer would be true
8 0
3 years ago
Read 2 more answers
which option of the AutoCorrect tool enables you to add and delete words that do not follow abbreviation rules?
quester [9]

The replace text as you type is an option in the AutoCorrect tool that enables the user to add or delete words that do not follow abbreviation rules. Moreover, this is a convenient way to use especially if you are dealing with long string of words that only needs abbreviation.

3 0
3 years ago
Read 2 more answers
Other questions:
  • The essence of strategy is ____, so competitive advantage is often gained when an organization tries a strategy that no one has
    15·1 answer
  • What tab must you click on to view any previously read messages from instructors in the message center?
    14·2 answers
  • How are a cell's content and format related?
    12·2 answers
  • What adds the element carbon to the environment
    10·2 answers
  • _____ provides vital protection and maintenance services for system hardware and software, including enterprise computing system
    12·1 answer
  • Kim is creating a PowerPoint
    13·1 answer
  • Kim would like to have a simple method for entering data into a database. She should create a _____.
    14·2 answers
  • What is a file type and why is it important? Give at least three examples of file
    7·1 answer
  • Explain the following buttons as used in emails:compose,inbox and Draft.<br>​
    10·1 answer
  • You text file begins with the following rows. The pattern is a description of the item to be repaired, its color, and the issue.
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!