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
Ostrovityanka [42]
3 years ago
8

This program needs to be written in Java. Along with NO For/while loops, and no methods.

Computers and Technology
1 answer:
Umnica [9.8K]3 years ago
6 0
The only way without a while loop and no method I can think of is use switch with every possible variation of the four digit binary which is 15.

Here is the starter code:

import java.util.Scanner;
public class MyClass {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int digit = sc.nextInt();
switch(digit) {
case 0000:
System.out.println("0");
break;
case 0001:
System.out.println("1");
break;
case 0010:
System.out.println("2");
break;
case 0011:
System.out.println("3");
break;
case 0100:
System.out.println("4");
break;

… (fill in other cases)


}
}
}

Use this link: https://www.electronics-tutorials.ws/binary/bin_3.html

There might be a better way, but without loops or methods this is all I got.
You might be interested in
What computer would be good for editing and streaming for less than 600$?
Airida [17]
Hihi!

In my personal expierence with streaming and editing videos a good computer that's less than $600 would be the iBuyPower AM460FX, it has AMD FX-4300 quad-core 3.8GHz processor, 8GB RAM and a 1TB HDD. But I don't know how much those go for now. If it's too expensive I would get the Acer Aspire ATC-280-UR11, it has <span>the AMD A-Series quad-core A10-7800 3.5GHz processor with TurboCore 2.0 technology that can boost the processor up to 3.9GHz for extra speed. Throw in 12GB of RAM, a 2TB hard drive and an integrated AMD Radeon R7 graphics card!

I hope I helped!
-Jailbaitasmr</span>
8 0
4 years ago
A(n) _____ is someone who uncovers computer weaknesses and reveals them to manufacturers or system owners, without exploiting th
Damm [24]

Answer: white hat hacker

Explanation:

Like other forms of hacker, white hat hackers also have wide range of knowledge of breaking into systems, overriding firewalls, bypassing security protocols and can also do all other things hackers do. But what differentiates white hat hackers is the motive behind what they do, in that they carry out all this test not for their personal gain but for the benefit of the owners and also with the approval of the owners. Because after carrying out tests on the ways of exploiting the loop holes in the system they reveal it to the manufacturer or system owners for correction.

4 0
4 years ago
Which type of software should he use to restrict his information from going out to these websites?
Nataly [62]
Please provide question with more information

7 0
3 years ago
Read 2 more answers
On which tab can you find the margins button
insens350 [35]
In the tab key you alwAy use that to center
4 0
4 years ago
Read 2 more answers
Which of the following emerging technologies uses the principle of chromosomes to identify suspects?
Slav-nsk [51]

Answer:

b

Explanation:

they say this on the quiz but because of the irrationality DNA has

4 0
3 years ago
Other questions:
  • In terms of functionality and purpose, how does Nano compare to Server Core?
    10·1 answer
  • One of the disadvantages of Audacity is that it has limited technical support since it is a free program.     true or false
    11·2 answers
  • On the Internet, you can use a(n)______to look for information on any topic, such as books, movies, scholarly articles, news, an
    6·2 answers
  • Two good guidelines for good readability on a website are ______ (choose two)
    14·1 answer
  • Sharon is thinking about opening a bakery. She knows she wants to set her own hours, reduce her stress and make a profit. But sh
    6·2 answers
  • How does a hard drive work?
    5·1 answer
  • The action displayed in the status bar while pointing-
    7·1 answer
  • A column does not consist of
    10·1 answer
  • During the morning of a website launch for a new government sponsored healthcare portal, an unknown political rival, individual,
    15·1 answer
  • ____ is an example of a set of prewritten classes that allows you to access data stored in a database.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!