Write a complete Java program called Rooter that gets a positive integer called "start" from the user at the command line and then finds the squareroot of every number from "start" down to 0. Use a while loop to count down. Print each square root on a separate line. Include data validation to ensure the user provides a positive integer. Assume that the user enters an integer, and for validation, just check to be sure it is positive. If the validation is not passed, provide the user with suitable feedback and stay in the program to let the user try again until valid input is received. Use the Math.sqrt(double a) method to find each square root.

Answers

Answer 1

Answer:

The program in Java is as follows:

import java.util.*;

import java.lang.Math;

public class Rooter{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

 int start;

 System.out.print("Start: ");

 start = input.nextInt();

 while(start<=0){

     System.out.print("Number must be positive\nStart: ");

     start = input.nextInt();  }

 while(start>=0){

     System.out.println(Math.sqrt(start));

     start--;  }

}

}

Explanation:

This declares start as integer

 int start;

This prompts the user for input

 System.out.print("Start: ");

This gets input for start

 start = input.nextInt();

The following is repeated until the user input is valid i.e. positive

 while(start<=0){

     System.out.print("Number must be positive\nStart: ");

     start = input.nextInt();  }

The following while loop prints the square root of each number till 0

 while(start>=0){

     System.out.println(Math.sqrt(start));

     start--;  }


Related Questions

which one of the following is not hardware​

Answers

Firewall is not hardware. It is only software.

Answer:

There r no options

Explanation:

I think the application r not the hardware.

The DuPage Freight Shipping Company charges the following rates: Weight of Package Rate per Pound 2 pounds or less $1.10 Over 2 pounds, but not more than 6 pounds $2.20 Over 6 pounds, but not more than 10 pounds $3.70 Over 10 pounds $3.80 Design a program that does the following: asks the user to enter the weight of a package and displays the shipping charges. 1. Prompt the user for the weight of a package 2. Determines the rate per pound in a getRate module 3. Calculates and displays the total shipping charge in a getTotal module Hint - you may want to use a global variable for this! Please submit three things:

Answers

Answer:

The program in Python is as follows:

def getRate(weight):

   if weight<=2.0:

       rate = 1.10

   elif weight>2 and weight<=6:

       rate = 2.20

   elif weight>6 and weight<=10:

       rate = 3.70

   else:

       rate = 3.80

   return rate

def getTotal(weight,rate):

   total = weight * rate

   print("Total: ",total)

weight = float(input("Weight: "))

rate = getRate(weight)

getTotal(weight,rate)

Explanation:

This defines the getRate function

def getRate(weight):

The following if conditions determine the corresponding rate based on the value of weight passed to the function

   if weight<=2.0:

       rate = 1.10

   elif weight>2 and weight<=6:

       rate = 2.20

   elif weight>6 and weight<=10:

       rate = 3.70

   else:

       rate = 3.80

This returns the rate back to the main method

   return rate

The getTotal module begins here

def getTotal(weight,rate):

This calculates the total charges

   total = weight * rate

This prints the calculated total

   print("Total: ",total)

The main begins here

This gets input for weight

weight = float(input("Weight: "))

This gets the rate from the getRate function

rate = getRate(weight)

This passes values to the getTotal function

getTotal(weight,rate)

define computer network

Answers

Computer network is a group of computers that use a set of common communication protocols over digital interconnections for the purpose of sharing resources located on or provided by the network nodes.

Technology is used today in manufacturing, health care, and the transportation industry, but education has not yet embraced
it.
True
Оr
False

Answers

Answer:

False

Explanation:

Digital learning tools are nowadays used In Education. Countries like Japan, China, India and Korea use computers and internet in their educational system.

Hope it helps!

50 POINTS! PLEASE HELP!
________ is a VMware Network setting that does not put the virtual machine directly on the physical network of the computer.


Host Only

MAT

NAT

VNAT

Answers

Answer:

NAT

Explanation:

The Network Address Translation (NAT) is a Virtual Machine Software which allows organizations to make use of a single Internet Protocol by altering the private network addresses to a private one. It makes it possible to Map multiple network addresses to a public address thereby providing security. The NAT VMware allows a single device such as a router provide an information transfer interface between a private and public network. Hence, it does not use the physical network of the computer.

Answer:

NAT

Explanation:

I took the test :D Hope this helps!

state the use of an x-ray machine​

Answers

Answer:

The use of an x-ray machine is used to take pictures of dense tissues such as teeth or bones. This is because bones absorb the radiation more than the less dense soft tissue. X-rays from a source pass through the body and onto a photographic cassette.

I hope this helps you!

Explanation:

What temperature is most commonly used in autoclaves to sterilize growth media and other devices prior to experimentation

Answers

Answer:

The most effective temparature used in autoclave is 121°C

plz help me to do 4 number

Answers

Answer:

A is an abbaccus.  B is Blaze Pascal.  C is The Jacquard Loom.  D is Charles Babbage.  E is The Manchester Baby.

Explanation:

en que consiste excel

Answers

Answer:

Microsoft Excel es un programa para calcular y simplificar las tareas de administración de datos que forma parte del paquete Microsoft Office de Microsoft Corporation. Microsoft Excel tiene funciones básicas que se pueden usar para trabajar con hojas de cálculo, usando una cuadrícula que consta de celdas. Las funciones también están disponibles para mostrar gráficos y datos visuales similares.

i am doing 7th grade coding 3.02 assignment can anybody help me it says bad input on line 3 and this is what it is can someone help me
grade = int(input("What grade are you in?"))

Answers

Answer:

grade = int(input("What grade are you in?")

if grade == 9:

print ("Freshman")

elif grade == 10:

print ("Sophomore")

elif grade == 11:

print ("Junior")

elif grade == 12:

print ("Senior")

else:

print ("Invalid")

Explanation:

You fail to provide the complete code. So, I will rewrite the code from scratch

The complete question requires that the level is printed based on the input grade.

The code has been added in the answer section.

The explanation is as follows:

[Thus gets input for grade]

grade = int(input("What grade are you in?")

[If grade is 9, this prints Freshman]

if grade == 9:

print ("Freshman")

[If grade is 10, then level is sophomore]

elif grade == 10:

print ("Sophomore")

[If grade is 11, then grade is Junior]

elif grade == 11:

print ("Junior")

[If grade is 12, then level is senior]

elif grade == 12:

print ("Senior")

[All other inputs are invalid]

else:

print ("Invalid")

which one will be the correct answer​
pls tell

Answers

Answer:

option c clean boot. it is correct.

Option c, clean boots is the correct answer

What is the ghosted text or picture behind the content on the page?​

Answers

Answer:

Watermark

Explanation:

This is actually called a Watermark. It is usually used as a way of showing the name or logo of the author who owns the content that is underneath the watermark. This is done so that individuals cannot steal the owner's work and use it as their own. Usually, the owner has the original version of the content without any watermark, as well as individuals that have purchased the content or a licence to use the content for personal or commercial usage.

What type of display allows the user to access a large amount of vocabulary in one device, uses spelling to convey the message, is changeable by the user, depicts language in electronic form, uses context-based pages, and uses conversational pages

Answers

Answer:

Dynamic

Explanation:

As defined by Walter Woltos, DYNAMIC DISPLAY is a type of display that allows the user to access a large amount of vocabulary in one device, uses spelling to convey the message, is changeable by the user, depicts language in electronic form, uses context-based pages, and uses conversational pages.

For example, a dynamic display includes smartphones, laptops, etc. This is the opposite of Static display.

In the context of computer and network security, _____ means that a system must not allow the disclosing of information by anyone who is not authorized to access it.

Answers

Answer:

Confidentiality

Explanation:

Cyber security can be defined as a preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

In Cybersecurity, there are certain security standards, frameworks, antivirus utility, and best practices that must be adopted to ensure there's a formidable wall to prevent data corruption by malwares or viruses, protect data and any unauthorized access or usage of the system network.

In the context of computer and network security, confidentiality simply means that a computer system used for performing certain functions such as exchange of data must not allow the disclosing of information to and by anyone who is not authorized to access it.

Confidentiality refers to the act of sharing an information that is expected to be kept secret, especially between the parties involved. Thus, a confidential information is a secret information that mustn't be shared with the general public.

In conclusion, confidentiality requires that access to collected data be limited only to authorized staffs or persons.

If you set the Decimal Places property to 0 for a Price field, and then enter 750.25 in the field, what does Access display in the datasheet

Answers

Answer:

The answer is "750".

Explanation:

Throughout this question the even though it used to provides the precise decimal which is used as the representation or rounding requirement in software such as billing, it also used to represents only the 750, demonstrating the nearest rounding of the given technique, that's why the solution is 750.

The logical structure in which one instruction occurs after another with no branching is a ____________.

Answers

Answer:

sequence

Explanation:

The logical structure in which one instruction occurs after another with no branching is a sequence.

A computer is assigned an IP address of 169.254.33.16. What can be said about the computer, based on the assigned address?

Answers

Group of answer choices.

A. It can communicate with networks inside a particular company with subnets.

B. It can communicate on the local network as well as on the Internet.

C. It has a public IP address that has been translated to a private IP address.

D. It cannot communicate outside its own network.

Answer:

D. It cannot communicate outside its own network.

Explanation:

Dynamic Host Configuration Protocol (DHCP) is a standard protocol that assigns IP address to users automatically from the DHCP server.

Basically, a DHCP server is designed to automatically assign internet protocol (IP) address to network devices connected to its network using a preconfigured DHCP pool and port number 67.

When a computer that is configured with DHCP cannot communicate or obtain an IP address from the DHCP server, the Windows operating system (OS) of the computer automatically assigns an IP address of 169.254.33.16, which typically limits the computer to only communicate within its network.

Generally, a computer cannot communicate outside its own network when it is assigned an IP address of 169.254.33.16.

Write a python application that allows a user to enter any number of student test scores until the user enters 999. If the score entered is less than 0 or more than 100, display an appropriate message and do not use the score. After all the scores have been entered, display the number of scores entered and the arithmetic average.

Answers

Answer:

This program is as follows

total = 0; count = 0

testscore = int(input("Score: "))

while testscore != 999:

   if testscore < 0 or testscore > 100:

       print("Out of range")

   else:

       total+=testscore

       count+=1

   testscore= int(input("Score: "))

print(count,"scores entered")

print("Arithmetic Average:",total/count)

Explanation:

This initializes total and count to 0

total = 0; count = 0

This gets input for score

testscore = int(input("Score: "))

The following iteration stop when 999 is entered

while testscore != 999:

This prints out of range for scores outside 0 - 100

   if testscore < 0 or testscore > 100:

       print("Out of range")

Otherwise

   else:

The total score is calculated

       total+=testscore

The number of score is calculated

       count+=1

Get another input

   testscore = int(input("Score: "))

The number of score is printed

print(count,"scores entered")

The average of score is printed

print("Arithmetic Average:",total/count)

Write a letter of application to your school as a chemistry teacher​

Answers

Answer:

Dear Mr./Mrs (Employer's name), I am writing this in response to the ad, which you have listed in the newspaper (mention the name here) for the post of a chemistry teacher. I believe my extensive knowledge and writing skills make me an excellent candidate for the post.

John wants to assign a value to the favorite sport variable:

favoriteSport = indoor soccer

However, he gets an error message. What does he need to change in order to make the code work?


Add a space between the words in the variable name

Create a longer variable name

Put quotation marks around the string literal

Omit the symbol in the string

Answers

Put quotation marks around the string literal

Jon wants to assign a value to the favorite sport variable: favoriteSport! = "indoor soccer" but gets an error message by Removing the exclamation mark from the variable name it will fix for the code to work.

In laptop programming, code refers back to the set of instructions, or a machine of rules, written in a selected programming language (i.e., the supply code).

If you've got ever observed an exclamation mark (!) earlier than the variable in a person's JavaScript code the negation operator (!) definitely simply reverses the means of its operand. ! is the logical now no longer operator in javascript.

Learn more about the javascript here:

brainly.com/question/27683041

#SPJ3

Because the bastion host stands as a sole defender on the network perimeter, it is commonly referred to as the __________ host.

Answers

The good answer is: Sacrificial

The process where the programmer steps through each of the program's statements one by one is called

Answers

The process where the programmer steps through each of the program's statements one by one is called [tex]\sf\purple{hand \:tracing}[/tex].

[tex]\bold{ \green{ \star{ \orange{Mystique35}}}}⋆[/tex]

One property of light that makes it possible to record the image of an object with the camera

Answers

Answer:

Reflection

Explanation:

Reflection is the property of light in which when a ray of light hits a smooth surface, it bounces back in the direction in which it came from. If i is the angle between the normal to the surface and the incident ray, and r is the angle between the normal and reflected ray, the law of reflection states that the angle of incidence equals the angle of reflection. That is, i = r.

So, to record the image of an object with a camera, one property of light that makes that possible is reflection because, the incidence rays form an image of the object in the camera, while the reflected rays reflect the image so that it is visible to the eye.

True or False? Using your traffic analytics report, you can see the source of traffic to your website

Answers

Answer:

True

Explanation:

computer can do work very___​

Answers

Answer:

Explanation:

quickly      

Answer:

fast......................

What penetration testing tool combines known scanning and exploit techniques to explore potentially new attack routes

Answers

Answer:

metasploit.

Explanation:

Cyber security can be defined as preventive practice of protecting computers, software programs, electronic devices, networks, servers and data from potential theft, attack, damage, or unauthorized access by using a body of technology, frameworks, processes and network engineers.

Metasploit is a penetration testing tool that combines known scanning and exploit techniques to explore potentially new attack routes. It's officially and formally licensed to Rapid7, a company based in Boston, Massachusetts.

Basically, metasploit is a framework that's mainly focused on availing end users such as ethical hackers, with information about security vulnerabilities in a system, development of intrusion detection system (IDS) signature and modular penetration testing.

Draw a flow chart except the principle, time and date from the user. and display the simple interest and amount as output.​

Answers

Answer:

See attachment for flowchart

Explanation:

The explanation is as follows

1. Start

2. Get input for principal, time and rate

3. Calculate Interest using Interest = Principal * Rate * Time/100

4. Print Interest

5. Stop

Determine whether the phrase below is a sentence or a fragment.

While we were in Greece, we ate a lot of feta cheese.
a.
Sentence
b.
Fragment

Answers

sentence.


i believe it is sentence

Which type of infrastructure service stores and manages corporate data and provides capabilities for analyzing the data

Answers

Answer:

Data management.

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to effectively and efficiently create, store, modify, retrieve, centralize and manage data or informations in a database. Thus, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

Generally, a database management system (DBMS) acts as an intermediary between the physical data files stored on a computer system and any software application or program.

Hence, a database management system (DBMS) is a software that enables an organization or business firm to centralize data, manage the data efficiently while providing authorized users a significant level of access to the stored data.

In conclusion, data management is a type of infrastructure service that avails businesses (companies) the ability to store and manage corporate data while providing capabilities for analyzing these data.

In contrast to data in a database, data in a data warehouse is described as subject oriented, which means that it _____.

Answers

Answer:

focuses on a certain subject

Explanation:

it means that it focuses on that one subject and none others

Hope it helps c:

Other Questions
7. The gravitational potential energy of a body depends on its A speed and position B. mass and volume. C. weight and position D.speed and mass sue has 18 pieces of candytony has 18 pieces of candysue then gives some to tonysue then eats five of herstony eats half of his write the expressions for the number of pieces candy sue and tony now have? You are installing new carpeting in a family room. The room is rectangular with dimensions 2012feet 1318feet . You intend to install baseboards around the entire perimeter of the room except for a 312 -foot opening into the kitchen. How many linear feet of board must you purchase? Who was Abott Suger? a. a well-known French artisan of Gothic style windows b. a German statesman and historian who was the first patron of Gothic architecture c. a French statesman and historian who was the first patron of Gothic architecture d. an apprentice of Pseudo-Dionysius one more question(-8)+___=-17 t=29pi/6 1. find the reference number2. find the point on the unit circle 3. 6 trig functiond PLEASE HELP ME ASAP GIVING 10+ POINTSThe actual height of the building shown in the model is 150 feet What is the actual width of the building shown in the model? Mutations that result in the death of the individual are known as A 190 g glider on a horizontal, frictionless air track is attached to a fixed ideal spring with force constant 160 N/m. At the instant you make measurements on the glider, it is moving at 0.835 m/sm/s and is 4.00 cmcm from its equilibrium point.Required:a. Use energy conservation to find the amplitude of the motion.b. Use energy conservation to find the maximum speed of the glider.c. What is the angular frequency of the oscillations? Please Help Me Quickly, TIME LIMIT, i will give brainliest The purpose of Stalin's Five Year Plans was to A transform the USSR from an agricultural into an industrial economy. B strengthen the Red Army so that it could take back lost territories. C reduce the massive poverty and improve the standard of living. D drastically boost food production to end the widespread famines. Read and choose the option that best answers the question.Mi nombre es Luisa y vivo en San Juan Cotzal, Guatemala.Yo voy a la escuela de lunes a viernes de ocho de la maana a tres de la tarde. En las maanas, me despierto a las seis y cuarto de la maana. El clima en San Juan Coztal a veces es muy fro. En las maanas me pongo un huipil y un corte.Tengo siete clases en la escuela. La clase de espaol es un poco difcil; hablo el Ixil, una lengua maya. Despus de la escuela estoy ocupada: a las 4, hago mi tarea. Despus de mi tarea, a las 5 de la tarde, yo barro mi dormitorio y lavo la ropa. Cenamos a las 6 de la noche.Based on the text, what part of Luisa's day is dedicated to house chores? Late afternoon Late evening The morning The night A client calls to complain that his computer starts up, but crashes when Windows starts to load. After a brief set of questions, you find out that his nephew upgraded his RAM for him over the weekend and couldn't get the computer to work right. What could be the problem Pls help me Extra pointsRepresent each of the following units as a combination of primitivedimensions where M=mass, L=length, T=timeKilometer Quart Pascal Watt Newton Horsepower How do you explain what stearns describes as the two fundamental facts of history Solve for x. Round to the nearest tenth, if necessary. Who was the French military leader in North America during the French and Indian War? A. a highly respected Iroquois tribal chief B. General Edward BraddockC. Colonel George WashingtonD. General Louis de Montcalm In spite of the impact of Chinese influence, a. Korea never came under Chinese political control. b. Japan never adopted either Chinese characters for writing or any of its governmental system. c. Vietnam developed chu nom, which was a writing system for spoken Vietnamese. d. Korea never accepted tributary status under Chinese overlordship. e. Confucianism itself had little influence anywhere outside of China proper. You are on an airplane that is landing. The plane in front of your plane blows a tire. The pilot of your plane is advised to abort the landing, so he pulls up, moving in a semicircular upward-bending path. The path has a radius of 450 m with a radial acceleration of 17 m/s^2.Required:What is the plane's speed? Military leaders in Japan used nationalist propaganda to encourage Japanese people to take which actions? Select three options. produce many childrenbe productive in their livesexercise free-speech rightsserve in the militarysupport the emperor