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
TiliK225 [7]
2 years ago
11

Object-Oriented Programming (Using Java Language)

Computers and Technology
1 answer:
Delicious77 [7]2 years ago
3 0

Answer:

import java.util.Scanner;

class Main {  

 public static void main(String args[]) {

       Scanner scan = new Scanner(System.in);

       System.out.print("Enter a decimal value (0 to 15): ");

       int num = scan.nextInt();

       scan.close();

       

       if (num < 0 || num >15) {

           System.out.printf("%d is an invalid input\n", num);

       } else {

           System.out.printf("The hex value is %X\n", num);

       }

 }

}

Explanation:

Hopefully this example will get you going for the other assignments.

You might be interested in
What is a wiki farm?
bagirrra123 [75]

A wiki hosting service or wiki farm is a server or an array of servers that offer users tools to simplify the creation and development of individual, independent wikis.

4 0
3 years ago
Explain how inflation flattens the universe
DIA [1.3K]
They rise to the surface of the earth
8 0
3 years ago
Read 2 more answers
Write a function solution that given an array a of n integers (between -100 and 100), returns the sign (-1,0,1) of product of al
JulijaS [17]

left[0]=a[0];

for(int i=1;i<=n-1;i++)

   left[i]=(left[i-1]*a[i])%M;

right[n-1]=a[n-1];

for(int i=n-2;i>=0;i--)

   right[i]=(right[i-1]*a[i])%M;

for query q

   if(q==0)

       return right[1]%M;

   if(q==n-1)

       return left[n-2]%M;

   return (left[q-1]*right[q+1])%M;

4 0
2 years ago
Explain the difference between true north and magnetic north.
Furkat [3]
Magnetic north is the north a compass points in the direction of. True north, on the other hand, is north based on the earth's axis.
4 0
3 years ago
Write a Java program that reads an 8-bit binary number from the keyboard as a string and then converts it into decimal. For exam
cestrela7 [59]

Answer:

public class Brainly

{

 public static void main(String[] args)

 {

   BinaryConverter conv = new BinaryConverter();

   String binStr = "01001101";

   System.out.print(binStr + " in decimal is "+conv.BinToDec(binStr));

 }

}

public class BinaryConverter

{

 public int BinToDec(String binStr)

 {

   int d = 0;

   while(binStr.length() > 0)

   {

     d = (d << 1) + ((binStr.charAt(0) == '1') ? 1: 0);

     binStr = binStr.substring(1);

   }

   return d;

 }

}

Explanation:

The program "eats" the string from left to right, and builds up the integer representation in variable "d" on the go. While there are digits left, it shifts the previous result to the left and sets the least signficant bit to 1 only if the corresponding string character is a 1.

5 0
3 years ago
Other questions:
  • Jim is in the market for a car that will last for the next 10 years and has saved up some money for the purpose of a car. What’s
    6·1 answer
  • Give me give me keyboard on this phone please provide nice I can't type where is the keyboard.Give me give me keyboard on this p
    6·2 answers
  • What is the relationship between ionic bonds and cleavage
    13·1 answer
  • What should you remember when using the thesaurus to replace words?
    8·2 answers
  • Who can provide you with a new password when you have forgotten your old one?
    14·2 answers
  • Computer networks allow computers to send information to each other. What is the term used to describe the basic unit of data pa
    14·1 answer
  • Word templates include pre-made flyers which may be edited and saved only if permission is obtained from the Microsoft Office te
    11·1 answer
  • In which situation is coauthoring of presentations primarily utilized?
    9·1 answer
  • Calculate the heat energy required to raise the temperature of 5 kg of water from 20℃ to
    5·1 answer
  • state an application that would be better to write c++ than java and give a rationale for your answer
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!