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
ANTONII [103]
3 years ago
6

Linux would be a good example of?

Computers and Technology
1 answer:
Snezhnost [94]3 years ago
7 0
Open source software
You might be interested in
Anybody play apex legends? I need somebody to climb with in comp (I main octane)
Verdich [7]

Answer:

yes

Explanation:

my profile pic tho add me jujubi1988

6 0
4 years ago
Write a program to take in a time-of-day on the command-line as 3 integers representing hours, minutes, and seconds, along with
nexus9112 [7]

Answer:

In Python:

hh = int(input("Hour: ")) * 3600

mm = int(input("Minutes: ")) * 60

ss = int(input("Seconds: "))

seconds = int(input("Additional Seconds: "))

time = hh+ mm + ss + seconds

hh =  int(time/3600)

time = time - hh * 3600

mm = int(time/60)

ss = time - mm * 60

while(hh>24):

   hh = hh - 24

print(str(hh)+" : "+str(mm)+" : "+str(ss))

Explanation:

We start by getting the time of the day. This is done using the next three lines

<em>hh = int(input("Hour: ")) * 3600</em>

<em>mm = int(input("Minutes: ")) * 60</em>

<em>ss = int(input("Seconds: ")) </em>

Then, we get the additional seconds

<em>seconds = int(input("Additional Seconds: "))</em>

The new time is then calculated (in seconds)

<em>time = hh+ mm + ss + seconds</em>

This line extracts the hours from the calculated time (in seconds)

hh =  int(time/3600)

time = time - hh * 3600

This line extracts the minutes from the calculated time (in seconds)

mm = int(time/60)

This line gets the remaining seconds

ss = time - mm * 60

The following iteration ensures that the hour is less than 24

while(hh>24):

   hh = hh - 24

This prints the calculated time

print(str(hh)+" : "+str(mm)+" : "+str(ss))

6 0
3 years ago
To create an identical version of a slide you would click
Tresset [83]
You would click clone
3 0
4 years ago
Read 2 more answers
Which of the following behaviors is considered ethical? copying another user’s password without permission hacking software to i
Svetlanka [38]

Answer:

using a limited acess public computer to watch movies

Explanation:

it is the only thing that could not get you in trouble

6 0
4 years ago
Read 2 more answers
Write a simple command-line calculator with an exception handler that deals with nonnumeric operands. Your program should displa
alexira [117]

Answer:

Here is the JAVA program:

import java.util.InputMismatchException;  // exception that is thrown when input does not match the expected type

import java.util.Scanner;  //used to take input from user

public class Main {

public static void main(String[] args) { //start of main function

   Scanner input = new Scanner(System.in);  // creates Scanner class object

   double num1=0.0;  // double type operand 1

   double num2=0.0;  // double type operand 2

   System.out.println("Please enter 2 operands");  //prompts user to enter two operands

   try {  //defines a chunk of code to be tested for non numeric operand error

      num1 = input.nextDouble();  //reads operand 1 value

      num2 = input.nextDouble(); //reads operand 2 value

         

   } catch (InputMismatchException  ex) {  //code chunk executed when exception occurs in program

     System.out.println("wrong operand type, re-input " + input.next() + " to finish the calculation.");  //displays wrong operand type if user enters non numeric operands

     System.exit(1);  }//exits the program    

   System.out.print("Enter an operator (+, -, *, /): ");  //prompts user to enter an operator

       char operator = input.next().charAt(0);  //reads the input operator

       double result;  // to store the result of the operation

       switch(operator)         {  //decided operation on basis of input operator

           case '+':  // if user enters + operator

               result = num1 + num2;  //adds two operands

               break;

            case '-':  // if user enters - operator

               result = num1 - num2;  //subtracts two operands

               break;  

           case '*':  // if user enters * operator

               result = num1 * num2;  //multiplies two operands

               break;  

           case '/':  // if user enters / operator

               result = num1 / num2;  //divided two operands

               break;  

           default:  //if user enters wrong operator

               System.out.printf("wrong operator!");  //displays wrong operator

               return;          }  

       System.out.printf("%.1f %c %.1f = %.1f", num1, operator, num2, result); }} //displays the result of the operation

Explanation:

The program is well explained in the comments mentioned with each line of program. The user is prompted to enter the values of two operands num1 and num2. The try block is used to test for non numeric operand error and throws InputMismatchException when any of the input operands (num1 or num2) is non numeric. InputMismatchException is thrown by Scanner class. This informs that the token retrieved (which is the num1 or num2 operand) does not match the expected type (which is type numeric). When this error occurs in the program, catch block is used to execute a code chunk, which is the print statement in this program. The print statement informs the user of the wrong operand type before exiting. It also asks the user to re-input the number to finish the calculation and the wrong input type is also mentioned in the output that is to be re-input.

If you want the program to take the input again from user after throwing this exception then you can alter the above program by using two try catch blocks separately for the two operands:

//for operand 1 i.e. num1

System.out.println("Please enter operand 1: ");

   try {

      num1 = input.nextDouble();        

   } catch (InputMismatchException  ex) {

     System.out.println("wrong operand type, re-input " + input.next() + " to finish the calculation.");

      num1 = input.nextDouble();  }  //reads input of operand 1 again from user

//for operand 2 i.e. num2

          System.out.println("Please enter operand 2: ");  

      try {

      num2 = input.nextDouble();  

   } catch (InputMismatchException  ex) {

     System.out.println("wrong operand type, re-input " + input.next() + " to finish the calculation.");

     num2 = input.nextDouble();  } //reads input of operand 1 again from user

The program and its output is attached.

8 0
4 years ago
Other questions:
  • Help me!!!!! This is the last question! HELP ME! I REPEAT: HELP ME!!!! I AM SO IN NEED!!!
    12·2 answers
  • When creating a new user in linux, after entering the name, the username box:?
    9·1 answer
  • To what does the term computer hacking refer?
    10·2 answers
  • Where could an identity theft access your personal information?
    9·2 answers
  • SONET: is a standard for optical transmission that currently operates at Terabit per second speeds is almost identical to the IT
    7·1 answer
  • Strobe lights can become more yellow as they age true or false
    8·1 answer
  • Which scenario describes unethical lab behavior?
    9·1 answer
  • Design a for loop that gets 6 integer numbers from a user, accumulates the total of them, then displays the accumulated total to
    9·1 answer
  • What is the easiest way to defeat ganon in BOTW?
    11·2 answers
  • Why do relational databases use primary keys and foreign keys?.
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!