Input an int between 0 and 100 and print the numbers between it and 100, including the number itself and the number 100. If the number is less than or equal to 0, or greater than or equal to 100 print "error". Print 20 numbers per line.
Language: Java

Answers

Answer 1

import java.util.Scanner;

public class JavaApplication42 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       int count = 0;

       System.out.println("Enter an integer between 0 and 100");

       int num = scan.nextInt();

       if (num <= 0 || num >= 100){

           System.out.println("error");

       }

       else{

           while(num <= 100){

               if (count == 20){

                   System.out.println("");

                   count = 0;

               }

               else{

                   System.out.print(num+" ");

                   count++;

                   num++;

               }

           }

       }

   }

   

}

I hope this helps!

Answer 2

The pentagonal number is an illustration of loops.

Loops are used to perform repetitive operations

The program in Java where comments are used to explain each line is as follows:

import java.util.*;

public class Main {

   public static void main(String[] args) {

       //This creates a Scanner object

       Scanner input = new Scanner(System.in);

       //This gets input for num

       int num = input.nextInt();

       //This prints error is num is out of range

       if(num <=0 || num >= 100){

           System.out.print("Error");

       }

       else{

       //This initializes counter to 0

       int count = 0;

       //This iterates through num

       for (int i = num; i <= 100; i++) {

           //This prints the current number

           System.out.print((i)+"\t");

           //This increments the counter by 1

           count++;

           //If the counter is 10

           if(count == 10){

               //This prints a new line

               System.out.println();

               //This sets the counter to 0

               count = 0;

}

}

}    

}

}

Read more about loops at:

https://brainly.com/question/19344465


Related Questions

You use the same five shell functions every day and are looking for a way to ensure they are available as soon as you log into your account. What can you do?a. Make them residual system variables.b. Make them permanent environment variables.c. Load them via your login script.d. Make them permanent functions by adding them to the function directory.

Answers

Answer:

.c. Load them via your login script.

Explanation:

Given that using functions in shell scripts enhances programming output and login script comprises the functions and statements required to effectively execute at any given time the user logs into their account.

Hence the moment these functions are formulated, they are then executed through a single command statement thereby reducing the time of re-writing another set of code repeatedly in every program.

Therefore, in this case, what you can do is to "Load them via your login script."

Explain why the expected value of an F ratio is 1.00 when the null hypothesis is true if there is no treatment effect the numerator.

Answers

Answer:

The reason is that the f ratio is balanced due to the numerator and denominator having equal sources of variability.

Explanation:

The expected value of an F ratio is 1.00 when the null hypothesis is true because in a scenario where there is no treatment effect, we have both the numerator and the denominator of the F ratio both measuring equal sources of variability.

Whenever this happens then the F ratio will be balanced and also it will have a value that is near 1.00.

In the program below, which two variables have the same scope?

def rhyme(word):
leftCharacter = word[0]
if leftCharacter != 'd':
return 'd' + word[1:]
else:
return 'f' + word[1:]
def poem():
print("Enter Q to quit.")
userWord = input("Enter a word: ")
while userWord != 'Q' and userWord != 'q':
rhymeWord = rhyme(userWord)
print(rhymeWord)
userWord = input("Enter a word: ")
# the main part of your program that calls the function
poem()
userWord and ____
Fill in the blank Answer options: poem, word, rhymeWord

Answers

Answer:

rhymeWord

Explanation:

correct answer edge 2020

# the main part of your program that calls the function poem() userWord and rhymeWord. Hence, option C is correct.

What is rhymeWord?

Rhyming words all have the same last consonant. Simply put, it is the repetition of similar sounds. When two words have similar sounds, usually those that follow the final stressed syllable of each word, the words are said to rhyme. Cat-hat, rotten-forgotten, and heard-bird are some examples of words that rhyme; they all have similar sounds after the final stressed syllable.

If the last sounds of two or more words are the same or similar, then the words will rhyme. Some words that rhyme are goat, boat, moat, float, and coat. To determine whether two words rhyme, use your ears to listen while you speak the words. If two words have a similar or matching sound, they rhyme.

Thus, option C is correct.

For more information about rhymeWord, click here:

https://brainly.com/question/2398244

#SPJ2

During periods when the internet is not slowed by congestion, the number of internet searches is probably close to the socially efficient number. how can we tell this this is true?

Answers

Answer:

We can this is true because the number of internet searches that are being done at that time is just enough to meet the actual capacity of the internet facility.

Explanation: Socially efficient number is that number that is just enough to meet the actual capacity of a given system such as an internet connectivity or internet facility.

When the number of internet searches are just enough not to cause congestion in the search engines or internet facility,it can be said that the socially efficient number has been achieved.

Find the minimum, maximum, and average grade of final exams in sections taught by Todd Smythe.

Answers

Answer:

A sample of the statement is written below

SELECT MIN(GRADE), MAX(GRADE), AVG(GRAD), FROM TABLE 2 WHERE TEACHER = "TODD SMYTHE"

Explanation:

To find the Minimum, maximum and average grade of final exams in the sections taught by Todd Smythe. we will write a statement

Using the select to get the required data using the functions ; MIN , MAX , AVG and the WHERE clause for the condition

A sample of the statement is written below

SELECT MIN(GRADE), MAX(GRADE), AVG(GRAD), FROM TABLE 2 WHERE TEACHER = "TODD SMYTHE"

Implement a Java program that creates math flashcards for elementary grade students. User will enter his/her name, the type (+, -, *, /), the range of the factors to be used in the problems, and the number of problems to work. The system will provide problems, evaluate user responses to the problems, score the problems, and provide statistics about the session at the end. Functional Requirements

• User enters name at the beginning of a session. • System covers four math operations – addition, subtraction, multiplication, and division – with the user choosing which of the four operations to do in the session. Only 1 type of problem can be done in each session. • User will enter additional session parameters from prompts – number of problems to work and the range of values desired in the problems, e.g., addition with factors ranging from 0 to 12. • System will present problems to the user. • User will respond to problems with an answer and the system will provide im

Answers

import java.util.Scanner;

public class JavaApplication44 {

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       System.out.print("Enter you name: ");

       String name = scan.nextLine();

       System.out.print("Enter your operation (+,-,*,/): ");

       String operator = scan.nextLine();

       System.out.print("Enter the range of the problems: ");

       int ran = scan.nextInt();

       System.out.print("Enter number of problems: ");

       int problems = scan.nextInt();

       int score = 0;

       for (int i = 1; i <= ran; i++){

           int first = (int)(Math.random()*ran);

           int sec = (int)(Math.random()*ran);

           System.out.print("Problem #"+i+": "+first + " "+operator+" "+sec+" = ");

           int ans = scan.nextInt();

           if (operator.equals("+")){

               if (ans == first + sec){

                   System.out.println("Correct!");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first+sec));

               }

           }

           else if(operator.equals("-")){

               if (ans == first - sec){

                   System.out.println("Correct");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first - sec));

               }

           }

           else if (operator.equals("*")){

               if (ans == first * sec){

                   System.out.println("Correct");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first * sec));

               }

           }

           else if (operator.equals("/")){

               if (ans == first / sec){

                   System.out.println("Correct");

                   score++;

               }

               else{

                   System.out.println("Wrong. The correct answer is "+(first / sec));

               }

           }

           

       }

       System.out.println(name+", you answered "+score+" questions correctly.");

   }

   

}

I hope this helps!

Armstrong Numbers Programming challenge description: An Armstrong number is an n-digit number that is equal to the sum of the nth powers of its digits. Determine if the input numbers are Armstrong numbers. Input: Your program should read lines from standard input. Each line has a positive integer. Output: Print out True if the number is an Armstrong number, or False if not. Test 1 Test Input 351 Expected Output False

Answers

Answer:

Written in Python

number = int(input("Enter a number: "))

computesum = 0

lent = len(str(number))

for digit in str(number):

computesum += int(digit)**lent

if number == computesum:

print("true")

else:

print("false")

Explanation:

This line prompts user for Input input

number = int(input("Enter a number: "))

This line initialises the sum of the nth power of the digits to 0

computesum = 0

This line gets the length of input (i.e. number of digits)

lent = len(str(number))

The following iteration iterates through the digit to check for Armstrong numbers

for digit in str(number):

computesum += int(digit)**lent

This checks if the input number equals the computed sum

if number == computesum:

print("true") --- if yes, "true" is printed

else:

print("false") --- if otherwise, "false" is printed

See attachment for complete program in its right format

How is a UDP socket fully identified? What about a TCP socket? What is the difference between the full identification of both sockets?

Answers

Answer:

Following are the solution to this question:

Explanation:

Two tuples were fully identified only with UDP socket.:

< IP address assigned, the port for destination >

Its two tuples have been used in UDP as demux, buttons to identify its UDP socket.

The IP address for the destination:

Its received data is directly provided by the IP address of its port.

Port number of the destination:

The function of the IP address of its port number whenever you obtain a UDP segment would be to control the IP addresses of a segment or send that segment to a port with the same IP address. Its port number for endpoint allows demultiplexing incoming information from its IP.

TCP socket is completely recognized by the following four tuples:

< source IP, port source, IP source, port location >

It tuples are being used to label the sockets by using a demultiplexing (demux) key.

IP address source:

The IP address is being used to identify the unique host that links to. It can assume that perhaps the source IP address shows us all the source Addresses of the sender.

Port number of source:

Its port number amount allows us to identify which section is arriving at which port.

IP address destination:

Its IP address of a destination is the IP address of a port accepting incoming information.

Port number of the destination:

It is port numbers number allows us to identify the facilities or section should be sent to.

Differentiation between TCP and UDP identifier:  

As TCP ports (4 tuples) and UDP ports (2 tuples) are using demux keys to define socks, however, demux keys in UDP are unique from others in TCP for both the following reasons:

TCP uses a separate socket for every contact between both the server and client whereas UDP utilizes its same sockets to process all clients accessed by UDP servers with all communications, it maintains TCP is much more dependable and hence has to hold a different port.

Even so, UDP doesn't accomplish things apart from multicasting and demodulation, but no separate port is necessary by each link. Therefore the TCP socket becomes connection-driven as well as the UDP socket is direct link-free.

There are different ways' to identify the Socket. The presence or absence of a connection needs that the identifier format of each socket are known to be very different.

The TCP socket is identified by the quadruple. This includes;

Source IP addressSource port numberDestination IP addressDestination port number

An UDP socket is identified by the tuple such as

Destination IP addressDestination port number

There are some difference between TCP socket and UDP socket. They are;

TCP is known to be a connection-oriented protocol but the UDP is a connectionless protocol.

Another difference between TCP and UDP is speed. TCP is said to be slower than UDP. UDP is said to be faster, simpler, and efficient protocol than TCP.

Learn more about TCP socket from

ainly.com/question/17387945

A ____ is a a set of presentation rules that control how text should look. It is applied to an XML file to change the collection of text with schema tags into a presentable document that shows data in a way that is pleasant and easily understood.

Answers

Answer: language

Explanation:

Using the programming language of your choice, implement the Binary Search algorithm for a target value = 9 on the Array A: [9, 11, 70, 25, 20, 0, 36, 24]. What is the primary condition to implement a Binary Search Algorithm? Explain the growth rate of the algorithm

Answers

Answer:

myArray  = [9, 11, 70, 25, 20, 0, 36, 24]

myvalue = 20

def binary_search(mylist, value):

   sorted(mylist)  

   mid = mylist[round(len(mylist) / 2)]

   if value == mid:

       return mylist.index(mid)

   elif value < mid:

       for index, s_one in enumerate(mylist[ : (mylist.index(mid))]):

           if s_one == value:

               return index

   elif value < mid:

       for index, s_two in enumerate(mylist[(mylist.index(mid)) : ]):

           if s_two == value:

               return index

   else:

       return "searched value not in list/array"

result = binary_search( myArray, myvalue)

print(f"Index of the searched value {myvalue} is: {result}")

Explanation:

The programming language used above is python. It is used to implement a binary search in a list and finally returns the index of the searched value.

who are the characters in the poem Padre power witness the execution of rizal​

Answers

I MASTURBATE ON WEBCAM FIND ME HERE sex-today.fun

Which statement is true? A. Pseudocode uses shapes such as rectangles and diamonds to plan a program. B. You only use comments for pseudo code. C. A flowchart uses comments that can be kept as a permanent part of a program. D. A comment line begins with # Please hurry also you can only choose one answer so idk which one thank you

Answers

Answer:

D) A comment line begins with #

Explanation:

Comments are used in programming to explain what a line or block of code is doing.

It helps the programmer easily remember what their code was about when they come back to it having left it for a while.

Also comments help other programmers understand code written by one programmer.

A comment or an in-line comment usually begins with #. That way the computer skips it and doesn't regard it as a line of code.

Answer: D. A comment line begins with #.

Explanation:

In the text, it stated, "The easiest way to add a comment is to start the line with the pound sign (#)."

(Comments are notes that allow you to write anything without affecting the code itself. Comments can be utilized to indicate when and how you later changed a program, and provide a description of the changes.)

I hope this helped!

Good luck <3

If process P0 is switched to process P1, state for P0 will be saved into ____, and state from ___ will be reloaded.

Answers

Answer:

1. PCB0

2. PCB1

Explanation:

Given that PCB is often referred to as Process Control Block, is a form of data structure that is applicable and utilized by the computer operating systems to store all the information concerning a process.

This process is carried out in a way that when Process P0 is initialized, the operating system established a related process that takes the computer processing unit from Process P0 and allocates it to Process P1, the Operating System, in turn, will save P0's PCB, and then reload P1's PCB.

Hence, If process P0 is switched to process P1, the state for P0 will be saved into "PCB0" and the state from "PCB1" will be reloaded.

What number will be output by the console.log command on line 5

Answers

Answer:

-2

Explanation:

I have no idea, any help is appreciated.

Answers

Answer:

A

Explanation:

How do I explain it.... well the analogy shows the circle in the middle of the parallelogram, then the next shows the circle bigger than the parallelogram and the parallelogram with lines in it.

So you do the same to the triangle with a square and there you go!

Answer:

A - the first one is correct.

Explanation:

Hope this Helps!

:D

ASAP PLZ!!!. Which command group is used to apply effects and modify color schemes of SmartArt graphics?

Reset Graphics

SmartArt Styles

Graphic Layouts

Create Graphics

NVM!! The answer is B. SmartArt Styles

Answers

Answer:

I think I am wrong but I assume it is C. Graphic Layout Sorry if I am wrong but if I am not please reward me brainlist.

The answer is B. Smart Art styles because your adding a styles to SmartArt

plssss help i will mark u as brainliest plssss ​

Answers

Answer:

Explanation:

<p style="color: red">Random Name 1</p>

<p style="color: blue">Random Name 2</p>

<p style="color: yellow">Random Name 3</p>

<p style="color: green">Random Name 4</p>

<p style="color: gray">Random Name 5</p>

<ol>

   <li>Pen 1<li>

   <li>Pen 2<li>

   <li>Pen 3<li>

<ol>

<ul>

   <li>CPU<li>

   <li>Motherboard<li>

   <li>RAM<li>

   <li>GPU<li>

<ul>

I think is this you need, have a nice day ;)

What kind of skill is persuasion?


neutral skill

hard skill

soft skill

high skill

Answers

Answer:

soft skill

Explanation:

Rachel tries to follow ergonomic principles at work to avoid RSI. Which posture or method chelto prevent Sl while using the
keyboard
Rachel should use an adjustable chair. She should place the chair and keyboard in a way that her elbows bend at ________

Answers

Answer:right angle

Explanation:

plsss help anyone PLSSSSS ​

Answers

Answer:

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

Explanation:

This question is about to write HTML code for the given sub-questions. In each sub-question different scenario is given. So, the answer to these questions is given below in the order they asked.

1. In this question it is asked to write a code of 5 students' name in a paragraph with a different color that make them unique.

<html>

<body>

<p style="color:red;">Student A</p>

<p style="color:blue;">Student B</p>

<p style="color:black;">Student C</p>

<p style="color:orange;">Student D</p>

<p style="color:green;">Student E</p>

</body>

</html>

2. In it, the below is given code show an ordered list of subjects that you're offering.

<html>

<body>

<h2>An ordered HTML list</h2>

<ol>

 <li>Introduction to Computing</li>

 <li>Communication Skills</li>

 <li>Software Designing</li>

</ol>  

</body>

</html>

3. The below-given HTML code shows the unordered list of parts that make up the computer.  

<html>

<body>

<h2>An unordered HTML list</h2>

<ul>

 <li>CPU</li>

 <li>RAM</li>

 <li>Motherboard</li>

 <li>Mouse</li>

 <li>Keyboard</li>

 <li>Monitor</li>

</ul>  

</body>

</html>

What is the primary purpose of a slideshow presentation

Answers

Answer:

to help us to complete all of useless project given by school

Answer:

support the presenter's ideas

Explanation:

mins_by_phone(phone): calculate and return the number of call minutes associated with the given phone line in this plan based on

Answers

Answer:

def mins_by_phone(phone):

   if phone in self.phones:

       min_sum = 0

       for call in calls:

           min_sum += call

           return min_sum

   else:

       return 0

Explanation:

The mins_by_phone function above is the Phone class method. It checks for the presence of the argument value in the self.phones instance variable, which is a list and  sums up and returns the call minutes in the call list.

Assume that d is a double variable. Write an if statement that assigns d to the int variable i if the value in d is not larger than the maximum value for an int.

Answers

Answer:

That's because the value has reached the size limit of the int data type. ... you should use long rather than int , because long can store much larger numbers than int . If ... In other words, a float or double variable can't accurately represent 0.1 . ... If you're using Java to measure the size of your house, you'd need an electron ...

Explanation:

Clyde Clerk is reviewing his firm’s expense reimbursement policies with the new salesperson, Trav Farr. "Our reimbursement policies depend on the situation. You see, first we determine if it is a local trip. If it is, we only pay mileage of 18.5 cents a mile. If the trip was a one-day trip, we pay mileage and then check the times of departure and return. To be reimbursed for breakfast, you must leave by 7:00 a.m., lunch by 11:00 a.m., and have dinner by 5:00 p.m. To receive reimbursement for breakfast, you must return later than 10:00 a.m., lunch later than 2:00 p.m., and have dinner by 7:00 p.m. On a trip lasting more than one day, we allow hotel, taxi, and airfare, as well as meal allowances. The same times apply for meal expenses." Write structured English for Clyde’s narrative of the reimbursement policies. Draw a decision tree.

Answers

Answer:

The answer is described in the image.

Explanation:

The firm is responsible for all expenses made by it's employees, so for a local trip, the cost of gas relative to the mileage covered during the journey is paid for ( 18 cents per mileage).

If it is not a local trip, then it is a one-day trip, so the firm pays for the mileage and the cost of the meals not taken in the company, which depends on the departure and return/arrival time. If the departure and return time is 7am to 10am, the employee is paid for breakfast, if the departure and return is 11am to 2pm then the employee is paid for lunch, and for dinner, 5pm to 7pm.

Which of the following describes the phishing method of information security crime?


physically interacting with the victim and using her computer when she is not looking

rifling through recycling bins to find account information

pretending to be someone else when asking for information

all of these

Answers

Answer:

pretending to be someone else when asking for information

if anyone has a x box and r o b l o x and would like to help me get money please give me your x box name thank you

Answers

Answer:

wait money-!?

Explanation:

Answer:

oh to have a x box ;-;

Explanation:

what product and service type should I choose in quickbooks online if I do not want to track inventory

Answers

Answer:

is that what you're looking for

In QuickBooks Online, it’s easy to track how much you make and spend on each product or service. You can also enter these products and services you sell as items so you can quickly add them to sales forms. This gives you more detailed financial reports and helps you complete transactions faster.

Here's how to add services and products you don't plan to track inventory for (also known as non-inventory items).

Note: If you want to track product quantities, add them as inventory items instead.

Answer:

Non-inventory: Products or items you buy or sell, but don't need to track quantities. For example, nuts and bolts you use for installation jobs but don't sell directly.

how microsoft excel helps students?

Answers

Answer:

FASLE

Explanation:

Write a function that takes in two parallel lists: a list of times (in increasing order), and a list of distance traveled by that point in time. The function should return a new list giving the average velocity between consecutive time measurements. The new list should have length one less than the original lists.

Answers

Below is the function that takes two parallel lists;

List of times in increasing order and that of distance travelled by that point in time.

I put into consideration the instructions given in the question.

ANSWER;

def find_velocity(time, distance):

velocities = []

for i in range(1, len(time)):

velocities.append((distance[i] - distance[i - 1]) / (time[i] - time[i - 1]))

return velocities

times are = [1, 3, 5, 7]

distances are = [25, 29, 35, 70]

print(find_velocity(times, distances))

Write a program (main method) that advises the user on programming language. So if a user for instance enters "Java" the program might say "awesome" or if the user enters "Ruby" it might say "are you sure?" . Make the program comment on at least 5 programming languages.

Answers

import java.util.Scanner;

public class JavaApplication41 {

   

   public static void main(String[] args) {

       Scanner scan = new Scanner(System.in);

       String language = scan.nextLine();

       if (language.toLowerCase().equals("java")){

           System.out.println("Awesome!");

       }

       else if (language.toLowerCase().equals("python")){

           System.out.println("A very simple language!");

       }

       else if (language.toLowerCase().equals("ruby")){

           System.out.println("Are you sure?");

       }

       else if (language.toLowerCase().equals("javascript")){

           System.out.println("Easy enough");

       }

       else if (language.toLowerCase().equals("c")){

           System.out.println("Cool!");

       }

   }

   

}

I hope this helps!

Other Questions
A box is pushed horizontally with constant speed across a rough horizontal surface.Which of the following must be true? write the UNBALANCED chemical equation for photosynthesis. don't forget to include energy Which of the following is a composite number between 20 and 40?A. 37B. 36C. 31D. 29 the question is the picture One of cronos children was not eaten true or false I have a really long assignment I don't understand! please help Mr. Chavez has assets of $250,000 and liabilities of $18,000. He decides to finance the entire amount of the purchase of a car valued at $26,000. Which of the following is true? a. Mr. Chavez increased his assets. b. Mr. Chavez increased his net worth. c. Mr. Chavez increased both his assets and net worth. d. Mr. Chavez did not increase his assets or his net worth. Please select the best answer from the choices provided A B C D what does the prefix dys- mean? in 2-3 sentences covince me to join a potical party IV. Analyze the following sentence patterns. (S-V-D.obj) (S-V-Ind. Obj-D.obj) (S-V-D Obj-OC)(S-V) 6. Did you send the bill to her? A high quality paper is judged by what is written in the content.Please select the best answer from the choices providedTF Suppose there are two circles where the radius of one circle is twice the radius of the other circle. Each circle has an arc where the measures of the corresponding central angles are the same. What is the relationship between the arc lengths in the two circles? Explain. (2 points) Un mol de gas ideal realiza un trabajo de 3000 J sobre su entorno, cuando se expande de manera isotermica a una temperatura de 58C, cuando su volumen inicial es de 25 L. Determinar el volumen final "Can dogs identify colors?" is an example of a scientific question. "Are dogs better pets than cats?" is not. Use complete sentences to explain the difference between these questions and why only one is scientific. (5 points) Your answer: what is the 50th term of the sequence that begins -4,2,8,14,...?A. 290B. 294C. 296D. 300 What type of currents involve the lateral movement of water in the oceans?Group of answer choicesSurface currentsSidewellingsUpwellingsDownwellings Mrs. Alonza ordered 4 x 10 markers for her store. How many markers did she order? I need help here plz Mrs. Martinez uses 1.5 pounds of flour for each loaf of bread she makes. How manycomplete loaves of bread could she make with a 25-pound bag of flour?A 16B 17C 26D 37I feel like its A or B bu idk which.. HELP Does hot water or cold water boil faster