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]
2 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]2 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
Mateo could not find the undo command or shortcut. He should _____.
mr Goodwill [35]
Mateo should click on help.
5 0
3 years ago
Read 2 more answers
I plugged my headphones into my computer, but the sound still came out of the speakers. help!
VARVARA [1.3K]

If you mean speakers. You should remove them or if you mean the speakers in the PC. Perhaps you put the headphones in the wrong one. Theres usually too one in the front and the other one in the back of the desktop.





Hope this helps.


Regards. Shaggy


Enjoy your music!

3 0
3 years ago
Read 2 more answers
Which ie tab is used to configure how to manage cookies?
Virty [35]
Hmm I think it's the favorite bar
4 0
3 years ago
A = 250; B = 325. which of the following statements is true? A ==B A>B A =B
Ivanshal [37]

Answer:

lollol

Explanation:

7 0
3 years ago
Even though the Pizza Hut corporation understood the need to make use of the Web, the franchise owners were skeptical. From an I
Gelneren [198K]

Answer:

Franchise owners are essential stakeholder group whose opinions are directly related to the company's success.

Explanation:

Franchise owners are essential stakeholder groups. A stakeholder is a person, organization, social group. A stakeholder can be internal or external to the business. Stakeholders affected by business and affect the business.

Different type of stakeholder is

  • Customer
  • Employees
  • Investors
  • Suppliers
  • Owners

Pizza Hut corporation owner is a stakeholder whose opinions are related to the company's success.

8 0
4 years ago
Other questions:
  • In an open computer network such as the internet, hipaa requires the use of _____. in a closed system such as a local area netwo
    7·1 answer
  • Ms. Rogers wants to see the names of all the students who scored below 25 on the test. Which of these custom options will help h
    5·1 answer
  • What does nntp stand for?
    12·2 answers
  • Is it more beneficial to have many folders or is it better to " nest subfolders? Explain your response
    5·1 answer
  • In your memo, give three new employees directions for starting the computer and opening a word-processing document.
    9·1 answer
  • What are the two types of computers
    15·2 answers
  • Which is not a key factor a programmer uses in selecting the language for a project?
    9·1 answer
  • Definition: This modern-day country was one of the most advanced ancient civilizations. Human
    8·1 answer
  • Describing Report Tools Functions
    9·1 answer
  • Mobile cameras are now of a higher quality than when they first arrived on the market. Describe the difference in
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!