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
belka [17]
3 years ago
12

Write a program that produces the following output (where the user may enter any positive integer under 10):______

Computers and Technology
1 answer:
Mekhanik [1.2K]3 years ago
3 0

Answer:

// The Scanner class is imported to allow the program receive user input

import java.util.Scanner;

// The class is defined called Solution

public class Solution {

   // The main method is defined which begin program execution

   public static void main(String args[]) {

     // Scanner object 'scan' which receive user input from the keyboard

     Scanner scan = new Scanner(System.in);

     // the userInput variable is initially set to 1 (true) to allow the program continue prompting the user for input

     int userInput = 1;

     // while loop which continue execution as long as the userInput is greater than 0 and less than 10

     while (userInput > 0 && userInput < 10){

         // Prompts is displayed to the user to enter number below 10

         System.out.println("Enter a positive integer under 10:__________");

         // the next input is assigned to userInput

         userInput = scan.nextInt();

     }      

   }

}

Explanation:

The above code continue prompting the user to input an integer as long as the input is greater than 0 and less than 10.

You might be interested in
when a picture is downloaded off the internet and then posted to social media, can the social media platform tell it was downloa
Nataly_w [17]
Short answer yes. kinda long answer people can scan the photo and easily see or they can just look up the same image
4 0
3 years ago
Write a basic program that performs simple file and mathematical operations.
Ostrovityanka [42]

Answer:

Explanation:

I have written the Python program based on your requirements.

Just give the path of the input file and the path for the output file correctly where you want to place the output file.

In, my code - I have given my computer's path to the input and output file.

You just change the path correctly

My code works perfectly and I have tested the code with your inputs.

It gives the exact output that you need.

I have attached the Output that I got by running the below program.

Code:

month_list={ "january":"1","february":"2", "march":"3","april":"4", "may":"5", "june":"6","july":"7", "august":"8", "september":"9","october":"10", "november":"11", "december":"12"} input_file=open('C:\\Users\\Desktop\\inputDates.txt', 'r') output_file=open('C:\\Users\\Desktop\\parsedDates.txt','w') for each in input_file: if each!="-1": lis=each.split() if len (lis) >=3: month=lis [0] day=lis[1] year=lis [2] if month.lower() in month_list: comma=day[-1] if comma==',': day=day[:len (day)-1] month_number=month_list[month.lower()] ans-month_number+"/"+day+"/"+year output_file.write (ans) output_file.write("\n") output_file.close() input_file.close()

- O X parsedDates - Notepad File Edit Format View Help 3/1/1990 12/13/2003

- X inputDates - Notepad File Edit Format View Help March 1, 1990 April 2 1995 7/15/20 December 13, 2003 -1

cheers i hope this helped !!

7 0
3 years ago
Which type of network topology is the most common and easiest to use?
Airida [17]
<span>A network layout or topology that is the most common, the most simple and easiest to use out of the four network topologies is the Bus topology, one cable is used for installation so it is also the cheapest network type.</span>
5 0
3 years ago
When performing forensics on an Apple computer, what operating system are you the most likely to encounter QUIZLET
lidiya [134]

When performing forensics on an Apple computer, the operating system are you the most likely to encounter is iOS.

<h3>What is operating system forensics?</h3>

A Operating System Forensics is known to be a method used for the retrieving of any useful information from the Operating System (OS) of the computer or any kind of mobile device.

Note that the reasons for collecting this information is so as to get all the empirical evidence against any kind of perpetrator.

Learn more about operating system from

brainly.com/question/1763761

3 0
2 years ago
What to do when microsoft word is eating your words?
Aloiza [94]
Update it so it wont do that
4 0
3 years ago
Other questions:
  • What determines the method of controlling motor speed?
    5·1 answer
  • Write a program with total change amount as an integer input that outputs the change using the fewest coins, one coin type per l
    6·1 answer
  • Among the web programming languages, css is used to define _____ of the web page
    5·1 answer
  • Identify possible advantages and disadvantages of using automatic withdrawal to pay bills
    12·2 answers
  • Which of the following are not deducted on a typical pay stub
    12·1 answer
  • If you will be giving your presentation to an audience, you can practice your presentation by using View, ___________, to rehear
    14·1 answer
  • Which of these is a requirement for developing game applications on devices running Apple’s iOS operating system?
    6·2 answers
  • Please choose the correct option please tell fast​
    9·1 answer
  • What is meant by versatility in terms of features of computer?​
    9·2 answers
  • Subscribe to my you tube channel to get all your questions answered
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!