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
Where is the fill handle located
Ronch [10]
The fill handle will appear as a small square in the bottom-right corner of the selected cell(s). Click, hold, and drag the fill handle until all of the cells you want to fill are selected. Release the mouse to fill the selected cells
4 0
2 years ago
Why do businesses often provide a logo on their web pages?
Nitella [24]
<span>B. They provide viewers with a consistent visual reminder of their company.

This is a prevalent example of branding.</span>
7 0
3 years ago
Lindsay owns a candy store that typically makes all of its sales to tourists visiting a nearby zoo. Why might she decide to set
umka2103 [35]
Social media is so powerful in this generation because it is able to reach many different corners of the world. It is not only used merely for communication but also sometimes or most of the times for business. For Lindsay, the use of social media will allow her to increase the size of the customer base. The answer is letter A. 
4 0
3 years ago
Read 2 more answers
Case Project 2-1: The Differences Between IPv4 and IPv6 You are a network engineer for an IT consulting firm named F1IT. One of
Nadusha1986 [10]

Answer:

Following are the difference to this question:

Explanation:

IPv4:

The IPv_4 is uses the packet changed method, that is a Link Layer networks(like Ethernet).  It has 4.3 billion addresses capacity. It uses the 32-bit logical device address, that written in decimal language. It is divided by 4 bytes E.g. 192.168.1.1  

The host part and network part are 2 parts. For a network, the host part may vary, while for the entire subnet, the network part remains equal. The scheme of 232 addresses is available on application depends on security.

IPv6:

The IPv6 is used in the internet protocoland it is higher than IPv4. It can provide endless number Opf addresses, and use to solves the problem of IPv4 exhaustion and satisfies  the demand for rising networking.

IPv4 Substitutor Built to meet more IP address requirements. In the Logical address of 128-bit Written hexadecimally and with colons divided, and the Space of 128 addresses are required. IPsec is an integrated security feature.

5 0
3 years ago
What are the disadvantages of having too many featuresin a language?
AlekseyPX

Answer:

Disadvantage of having too many features in a language is that:

  • There are many functions with same name but perform different function or task so it will create an issue or problem.
  • Features do not duplicate one another as, there are different possible syntax for the same meaning.
  • In a mathematical function, sometimes user function and mathematical variable name collide with language base features so it will create problem.
4 0
3 years ago
Other questions:
  • What is the purpose of lookup tables in spreadsheet software
    13·2 answers
  • What does rwd stand for?
    8·2 answers
  • What is out put.what is data. what is microprocessor
    14·1 answer
  • Which one is correct?
    7·2 answers
  • Why did latex replace wax?
    7·1 answer
  • ________ is a remote access client/server protocol that provides authentication and authorization capabilities to users who are
    10·1 answer
  • How do i make spaces in python<br> To draw hello world
    15·1 answer
  • 4.11 lesson practice quizz need help on 2 and 3
    5·1 answer
  • Give 3 reasons why it is believed that smart phones precent us from communicating face to face.give three reasons why it is beli
    8·1 answer
  • In “Plugged In,” the author’s purpose is to persuade. Which of the following quotes from the text shows that the author’s purpos
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!