60 POINTS
IN JAVA

In this exercise, you will need to write a program that asks the user to enter different positive numbers.

After each number is entered, print out which number is the maximum and which number is the minimum of the numbers they have entered so far.

Stop asking for numbers when the user enters -1.

Possible output:

Enter a number (-1 to quit):
100
Smallest # so far: 100
Largest # so far: 100
Enter a number (-1 to quit):
4
Smallest # so far: 4
Largest # so far: 100
Enter a number (-1 to quit):
25
Smallest # so far: 4
Largest # so far: 100
Enter a number (-1 to quit):
1
Smallest # so far: 1
Largest # so far: 100
Enter a number (-1 to quit):
200
Smallest # so far: 1
Largest # so far: 200
Enter a number (-1 to quit):
-1

Answers

Answer 1

import java.util.Scanner;

public class JavaApplication75 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       int num = -2, largest = -1, smallest = -1;

       while (true){

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

           num = scan.nextInt();

           while (num < 0){

               if (num == -1){

                   System.exit(0);

               }

               num = scan.nextInt();

           }

           if (num > largest){

               largest = num;

           }

           if (num < smallest || smallest == -1){

               smallest = num;

           }

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

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

           

       }

   }

   

}

I hope this helps!


Related Questions

PLS HURRY!
Look at the image below
Answer choices are:
if
for
while

Answers

The missing word is if.

For statements are used to iterate through objects, there is no object to iterate through with the code provided.

If you put while in the blank, an infinite loop will be created and there will be no output.

the if statement only makes sense.

Isabela completes her presentation and delivers it during class.
Which view does Isabela use to give her presentation?
Which key(s) does she use to start her presentation?

Answers

Answer:

Slide show view and F5

Explanation:

Answer:

Which view does Isabela use to give her presentation?

 

Answer: ✔ Slide Show view

--------------------------------------------------------------------------------------

Which key(s) does she use to start her presentation?

 

Answer: ✔ F5

Explanation:

Which step in the software development life cycle analyzes the scope of work?

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

There are different steps in the software development life cycle such as:

Requirement Gathering Designing Coding Testing and Deployment

These are the main steps or procedures used in the software development life cycle. The first steps that is requirement gathering in the software development life cycle analyzes the scope of work. Because requirement gathering and analysis is the first and the most basic steps in the software development life cycle. At this stage, you gather requirement from user or client that will use the software, after gathering the requirements of your client, then you will analyze the user needs and product feasibility, envision development and improvements that can be made, and investigate new, better ways to create the product.

The step in the software development life cycle that analyzes the scope of work is typically the "Requirements Gathering" or "Requirements Analysis" phase.

During this stage, the development team works closely with stakeholders, clients, and end-users to identify and document their specific needs, expectations, and desired functionalities for the software project.

This includes understanding the project's objectives, defining user requirements, and determining the features and functionalities that the software should include.

By analyzing the scope of work in the early stages, the development team can set clear project goals, define the project's boundaries, and establish a solid foundation for the rest of the development process.

Know more about software development:

https://brainly.com/question/30459165

#SPJ6

6.Which of the following is the primary factor driving growth in the telecom technician career field?


fiber optic cabling

broadband connections

satellite internet

lower quality devices

Answers

Answer:

A

Explanation:

The primary factor driving growth in the telecom technician career field is the  fiber optic cabling.

What is career field?

Any one of an occupation serials or group of the jobs considered to have a next activity tie and categorized as such by the Division of State Civil Service is called as a career field.

Fiber optic cabling is the key reason driving growth in the telecom technician industry.

Therefore, option A is correct.

Learn more about the career field, refer to:

https://brainly.com/question/1802560

#SPJ2

How do I give an answer brainliest?

Answers

I’m wondering this to!!!

Answer:

when two people answer there would be a white crown at the bottom right corner (of the answer) when you click on it it turns yellow/gold which means that you have marked that answer brainliest.

Pick the better answer (in your opinion) and then mark it brainliest.

Match the job roles with their appropriate qualifications.
business analyst
multimedia artist
network and computer systems administrator
software quality assurance engineer

Answers

Answer:

business analyst:  degree in business administration

multimedia artist : training in 2D and 3D modeling

network and computer systems administrator: master's course in management information systems

software quality assurance engineer: knowledge of the software life cycle process

Explanation:

What the other person said they where right

please help me!
When you know ahead of time how many passes you will make through a loop, a(n) ____(definite/indefinite) loop is best. Such a loop uses ____. (while/for)

Answers

Answer:

Choose what you think based on this.

Explanation:

with a for loop:

>>> students = 3

>>> for student in range(students):

>>> print(student)

would output

>>> 0

>>> 1

>>> 2

with a while loop now:

>>> students = 3

>>> student = 0

>>> while student < students:

>>> student = student + 1

>>> print(student)

the for loop is more compact than the while loop. But there may be some times when a you cant do a for loop. The first question is more than likely definite but I don't know the second answer.

Answer:

The answers are:

definite

for

Explanation:

proof:

A list of sources used for in-text citations that appears at the end of a document is called:
Autobiography
Editor's reference
Works Cited page
Content Review

Answers

The correct answer is Works cited page

Secondary technology skills are skills that may be improved as the online class progresses.

Answers

Answer:

yes

Explanation:

it helps in the future

Answer:

yes

Explanation:

Troy wants to list his technical skills on his résumé. What formatting would be best for that?
A)Block Format
B)Chronological Order
C)Bullet Form
D)Bold Text

Answers

Bullet form because your listing his skills not putting them in order and bold text brings something out. Block format shouldn’t be used in this scenario especially since it’s for troys resume

What is the difference between coding and programming your own system?

Answers

Answer:

The answer to this question is given below in the explanation section.

Explanation:

Coding and programming are the two most terms used in software development industries. Though, these terms are often used interchangeably. Coding refers to the process of translating and writing codes of one language and even from one language to another lanaguage. In the simplest term, it means writing code for an application.

Whereas programming refers to the process of developing an executable program that can produce output to a specific problem. In short words, we can say that programming finds solutions to the problems step by step and determine how should be solved.

When you write a simple code that just takes the name as input and print output on the screen. When you write a complete code to solve a problem, you are doing programming.

What's my favorite song by Maluma

Answers

Answer:

hawai

Explanation:

80x+90=170 x=1 hope this helps for any future reference plz mark brainliest:D

Answer:

Hawaii Remix by Maluma and The Weekend

Explanation:

plz give brainliest

Please complete the following questions. It is important that you use complete sentences and present the questions and answers when you submit your work.

How do you make sure your ideas are original and not copied directly from other video games? Explain.
Explain how the four game mechanics mentioned in the unit (reward, risk/loss, levels, and feedback) could work together to create an interesting sports video game.
You’ve learned that video games use rewards to keep players coming back for more. Can you think of an example in real life that uses rewards to keep people coming back for more? How is this similar to video game rewards? Explain.
The unit says this about levels: “As the levels get harder, the environment might also change, the music might get more intense, and the colors might change shades for a completely different mood.”
Imagine that you are working on a game, and with each level that they progress to, the player encounters a greater risk to their health and life. How would you alter the music, colors, and other aspects of the environment to reflect this risk? Describe and explain. Why do you feel these environment choices and changes reflect increasing risk?
When designing a video game, it is important to make sure that the game offers a balance of risk and reward to keep your players challenged but not frustrate them so much that they do not want to continue playing. How would you assess and test your game before completing it to ensure that you had the right balance of risk/reward? Is there any way to know that you have achieved that balance for every player?

Answers

Answer:

well... i came for the same answer

Explanation:

This is what I have so far

Designing a video game takes tons of creativity. What inspires your personal creativity and ideas for video games? Explain and give several specific examples. How do you make sure your ideas are original and not copied directly from other video games? Explain.

What inspires my personal creativity is all the indie games I have played in the past, and they have always amazed me with their design, video games have always been a part of me from the Mario games I played when I was little to AAA titles. My ideas are original because I’ve seen so much, that I know when something is unique and original.

Explain how the four-game mechanics mentioned in the unit (reward, risk/loss, levels, and feedback) could work together to create an interesting sports video game.

Every 10 levels is a new sport and each level is harder, but at the end of each level you earn money to buy better gear, (like a system from simple rpg,) but if you lose, you also lose money. Also, you would need to use feedback that you would get from players to improve the game.

You’ve learned that video games use rewards to keep players coming back for more. Can you think of an example in real life that uses rewards to keep people coming back for more? How is this similar to video game rewards? Explain.

When a person works 1 job for many years, they may get burnt out, but if they get a raise or a promotion every once and awhile, then they will be more motivated and come back for more. This is similar to games in a few ways, like if you play a single game for years, it will get boring, but if that game receives an update, then it will motivate people to play.

Explain how to find the last file you worked on, if you Can’t remember The name of it or where you saved it

Answers

Answer:

You can look for the dates on when you worked on it or the hard way is is click on each file and look for it.

Explanation:

Which type of chart or graph uses vertical bars to compare data? a Column chart b Line graph c Pie chart d Scatter chart

Answers

Answer:

Column Chart

Explanation:

In this screenshot, the circled item is the

Answers

Answer:

Favorites tab/bar

Explanation:

Answer:

Explanation:

The star means quick Access

PLS HURRY!!!
Look at the image below

Answers

The output is 20.

The for loops adds the value of count to numA until the count variable reaches 8.

please help if you answer correcly i will give you brainelst!!!!!!!!!!!!!!!!!!

Answers

Answer: She uses the same characters, she is not crediting the original authors, and she takes pictures from the original comic.

Explanation: Hope this helps!

Answer:

She did not reference to the original person that created the idea

Explanation:

he did not reference to the original person that created the idea. I say that because she used the exact same characters in her story without giving credit to the people who made them up

. Aisha’s supervisor asks her to create an aspect of a program that will hold data and make it easy to access. What does Aisha need to create? a flowchart a variable a data structure a syntax algorithm

Answers

Answer:

A Data Structure

Explanation:

Edge 2020

Answer:

C, a data structure

Explanation:

I mainly did this for the 50 pts lol

In five to ten sen
sentences, describe the procedure for sending an e-mail message.

Answers

Answer:

Explanation:

Pre-Steps: Click the "Compose" button near the top left corner of your screen. Then a window titled "New Message" should pop up.

1. Type who you are sending it to in the "To ____ column."

2. Type the subject - make it as specific as possible. I use the following template for writing a subject:

Event - Reason for sending - How you know them

EX: If you are sending a email to your teacher you could put:

Per 6 Biology - Help for homework - Student.

3. Next, type the message. This step varies depending on why you are sending the message. I say formality is always a should in any case. Sound crisp and mature

4. Send it. Be sure you read over the email before sending and make sure the email makes sense. Use proper grammar and the editor tool for spelling.

5. Click the blue send button. You can also click the down arrow key to schedule send, which makes the email send automatically at a specific time. If you click it, a window will pop up, in which you can pick the date and time for the email to send.

6. Once you are finished sending, your sent email and the replies (if any) from the recipients should appear in the "Sent" folder in the toolbar near the left of your screen.

Hope this helped!

When two or more computers can communicate together they are connected by a

Answers

they form a network. When two or more computers are connected together so they can communicate with one another, they form a network. The largest computer network in the world in the Internet.
Hope this helps

What is your favorite cool math games game?

Answers

Answer:

Explanation:

me cars 3 to like 7

Answer:

my favorite game is there is no game

Explanation:

Edhesive 1.3 code practice question 1

Answers

Answer:

print ("Welcome to Computer Science!")

Explanation:

Hope this helps lovely :)

Which of the following is the most reliable way to check the accuracy of a website? Examine the sources cited by the website.

Answers

Answer: It looks like you only have one answer choice that was added in your question, but that is the correct answer.

In the following nested loop structure, which loop does the program EXIT first?

for (initialization 1; condition 1; loop variable 1 increment;)
for (initialization 2; condition 2; loop variable 2 increment;)
for (initialization 3; condition 3; loop variable 3 increment;)
for (initialization 4; condition 4; loop variable 4 increment;)
{ statement block;}


A.
for (initialization 1; condition 1; loop variable 1 increment;)
B.
for (initialization 2; condition 2; loop variable 2 increment;)
C.
for (initialization 3; condition 3; loop variable 3 increment;)
D.
for (initialization 4; condition 4; loop variable 4 increment;)

Answers

Answer:

C

Explanation:

PLEASE HELP!!
Would you ever try and get famous off of social media? Why or why not?

Answers

Answer:

Yes because u could gain a lot of money from it

Explanation:

With more money you have, the more you can give to charity, and the more you can relax

The list listOne is a sorted list of numbers that contains 700 elements. The list listTwo is a sorted list of numbers that contains 900 elements. Let x represent the maximum number of list elements that will need to be examined when performing a binary search for a value in listOne, and let y represent the maximum number of list elements that will need to be examined when performing a binary search for a value in listTwo. Which of the following statements about x and y is true?

A) The value of x is approximately equal to the value of y.

B) The value of x is approximately 10 less than the value of y.

C) The value of x is approximately 13 less than the value of y.

D) The value of x is approximately 200 less than the value of y.

Answers

Answer:

I am pretty sure the answer is A

Explanation:

The statement that asserts a true claim regarding x and y would be:

A). The value of x is approximately equal to the value of y.

Given that,

Number of elements in list One [tex]= 700[/tex]

Number of elements in the list Two [tex]= 900[/tex]

In order to perform a binary search in list One where y describes the maximum amount of list elements to be looked in list two,

The value of x needs to be almost equivalent to the y's value so that the research could successfully take place.

Thus, option A is the correct answer.

Learn more about 'Binary' here:

brainly.com/question/7960132

Once an illustration has been decomposed, you can change the color of different items in that illustration.
True
False

Answers

Answer:

its true

Explanation: took the quiz

Jason wants to play a DVD. His Mac doesn't have a DVD drive, but his friend's Mac has one. Which Mac feature can Jason use to access his friend's DVD player? A. Remote Disk B. Boot Camp C. Gestures D. iCloud

Answers

Answer:

he could use his mac book and let his friend use his mac book

Explanation:

Which of the following algorithmic efficiencies would be considered LEAST efficient?



Constant

Polynomial

Exponential

Linear

Answers

Answer:

It is definitely exponential

Explanation:

Think of it from an input perspective. When an input is put in in a linear, constant and polynomial function, it remains constant. The one wildcard of these choices is exponential. Exponential will initially be efficient, but as the input increases it will jump wildely unlike the rest of the options. This is hands down the right answer! Good luck on the rest of the test!

The algorithmic efficiency which would be considered LEAST efficient is:

C. Exponential

According to the given question, we are asked to show the algorithmic efficiency which would be considered LEAST efficient when making calculations.

As a result of this, we can see that when a programmer or a random user is making an input and uses either a constant, polynomial or linear function, then there would be a constant value, but an exponential is least efficient because of how quickly it builds up numbers.

Therefore, the correct answer is option C

Read more here:

https://brainly.com/question/19756668

Other Questions
Waiting in the ParkI was jogging through the park the other day and noticed a girl sitting on a bench by the pond. She had bright red hair that was sticking out of a baseball cap. She was wearing a green baseball uniform. On the bench next to her were a silver baseball bat and a glove. She kept checking her watch and then looking around the park.From what you have read in the text, what can you predict about the girl on the bench? Give me a text about it RHETORICAL ANALYSIS: One reason that "Letter from Birmingham Jail" remains one of the best-known texts of the civil rights era is because of the powerful rhetoric that Dr. Martin Luther King, Jr. Uses to advocate for nonviolent resistance to racism. Write a response in which you delineate and evaluate King's argument, his specific claims, his rhetorical appeals, his use of sources, and his argument's conclusion. Support your analysis with evidence from the text. Who does Ralph think is going to rescue them from the island? can yall help me out its due today !! It takes Carlos and Jeffrey 2.25 hours to shovel snow the snow off 3 driveways in there neighborhood. How long does it take them to shovel 1 driveway 4. Levi bought two Rescue Bots for $7.50 each and three DVDs for $5.25each. How much money did he spend? *A. $12.75B. $25.50C. $30.75D. $39.38 Maria went to the store to buy new shirts for school. Each shirt cost $8.79. Maria buys 12 shirts for school. How much will Maria spend on all of the shirts? I need help, cuz idk where they go What ia the problem with paying only your minimum credit card balance each month PLSSSSSSSSSSS HELPMaya has 5 over 6 cup of ice cream. how many 1 over 4-cup servings are in 5 over 6 cup of ice cream?1 and 3 over 22 and 1 over 33 and 1 over 34 and 1 over 2 Help please thank you Use the commutative property of multiplication to rewrite 10 5 12. Which expression is equivalent?A.10 5 (5 + 5)B.10 + 5 + 12.C.(10 5) + 12D.10 12 5 1. Compare the direction of the currents in the North Pacific Ocean with those of the South Pacific Ocean. How are they alike and similar? Explain the reason for the similarities and differences. Please explain to get Brainliest. :D The population of California is 3.7 x 107 people. The population of Colorado is 5.0 x 106 people. What is the difference in size between these two populations? Express the answer in scientific notation. Who was at the top of Japanese social hierarchy?artisans and farmersmerchants and tradersmilitary officials and noblesthe emperor, empress, or regent if you answer were friends now. Can you answer this please 6. A cash register contains $10 bills and $50 bills with a total value of $1080. If there are 28 bills total, then how many of each does the register contain? (HELP ASAP) ILL GIVE BRAINIEST Find the slope of the line.(in pic) -6(1+8a)=36-6a. anybody know this answer ? Developing Alice Through Her Thoughts What do Alice's thoughts reveal about her character? O She doesn't like insects because they sting. "What kind of insect?" Alice inquired a little anxiously. What she really wanted to know was, whether it could sting or not, but she thought this wouldn't be quite a civil question to ask. Through the Looking-Glass, Lewis Carroll O She is curious and wants to know what kind of insect she is talking to. 0 She is afraid of getting stung but doesn't want to hurt the insect's feelings. She thinks she was uncivil toward the insect. Done Intro