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
Black_prince [1.1K]
3 years ago
5

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
Computers and Technology
1 answer:
Murrr4er [49]3 years ago
6 0

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!

You might be interested in
What are the value and data type (float, int, bool, or str) of this expression:<br><br> 5 % 2
amm1812

Answer: float

Explanation:

This is asking what would the remainder be of 5/2. I am not totally sure what you are asking but float is used with remainders because it could have a decimal like 3.33 that would throw an error for anything other than float.

3 0
2 years ago
Draw a timeline for each of the following scheduling algorithms. (It may be helpful to first compute a start and finish time for
12345 [234]

Answer:

See explanation below

Explanation:

Previos concepts

First Come First Serve (FCFS) "is an operating system scheduling algorithm that automatically executes queued requests and processes in order of their arrival".

Shortest job next (SJN), or the shortest job first (SJF) or shortest "is a scheduling policy that selects for execution the waiting process with the smallest execution time".

Shortest remaining time (SRF) "is a scheduling method that is a preemptive version of shortest job next scheduling'".

Round robin (RR) is an algorithm where the time parts "are assigned to each process in equal portions and in circular order, handling all processes without priority"

Solution for the problem

Assuming the dataset given on the plot attached.

Part a

For this algorithm the result would be:

Job A   0-6

Job B   6-(6+3) = 6-9

Job C   9-(9+1) = 9-10

Job D   10-(10+4) = 10-14

Part b

For this algorithm the result would be:

Job A   0-6

Job C   6-(6+1) = 6-7

Job B   7-(7+3) = 7-10

Job D   10-(10+4) = 10-14

Part c

For this algorithm the result would be:

Job A   0-1  until 14

Job B   2-(2+3) = 2-5

Job C   3-(3+2) = 3-5

Job D   9-(9+5) = 9-14

Part d

For this algorithm the result would be:

Job A   0-2 , 7-9, 12-14

Job B   2-4, 9-10

Job C   4-(4+1) = 4-5

Job D   5-7, 10-12

8 0
3 years ago
What is typeface
Mademuasel [1]
I’m so bored and hungry answer is c 3566
4 0
2 years ago
Read 2 more answers
The Payroll Department keeps a list of employee information for each pay period in a text file. The format of each line of the f
user100 [1]

Answer:

import pandas as pd

filename = input("Enter file name with the extension included: ")

data = {}

with open("filename", "r") as file:

   content = file.readlines()

   for line in content:

       line_list = line.strip().split(" ")

       data[line_list[0]] = line_list[1] * line_list[2]

       del line_list

report = pd.DataFrame(list(data.items()), columns = ["lastname", "wages paid"])

print(report)

Explanation:

The python module prompts the user for the file name and opens the text file to extract the employee data with the python open function. It iterates over the file content and saves the last name and the wages paid to the employees ( the hours worked multiplied by the hourly rate) in the dictionary "data".

The dictionary is converted to a dataframe with the Pandas python package and displays the data in tabular format on the screen.

8 0
2 years ago
Match The Following <br><br> i need more characters to ask a question. Fun
8090 [49]

answer:

1 image

6 transition

7 word art

5 smart art

4 table

3 theme

2 slide

i hope this is whrite and i hope this helped you

4 0
3 years ago
Other questions:
  • 3) An example of interactive web page is<br>​
    11·1 answer
  • Type the correct answer in the box. Spell all words correctly.
    12·1 answer
  • What is the typical educational requirement for a non-entry level software programmer?
    8·2 answers
  • To ____ a public member function of a base class in the derived class, the corresponding function in the derived class must have
    12·1 answer
  • Clasifica los documentos comerciales en activo, pasivo o patrimonial para cada operacion:
    14·1 answer
  • It is a blueprint of a project​
    9·2 answers
  • Draw
    7·1 answer
  • Assume the size of an integer array is stored in $s0 and the address of the first element of the array in the memory is stored i
    10·1 answer
  • Which of the following best describes a balanced reaction
    11·1 answer
  • to provide for ecmascript compatibility in older browsers, you can use group of answer choices javascript shivs javascript shims
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!