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
This is a free point thing!! I am giving 100 points!! Anyone wanna talk!!!!
julia-pushkina [17]

Answer:

:)

Explanation:

8 0
3 years ago
Read 2 more answers
How do you think computers have helped to improve documentation, support and services within the healthcare industry.
RideAnS [48]

Computers are the excellent means for storage of patient related data.It is often necessary to maintain detailed records of the medical history of patients. Doctors often require the information about a patient's family history, physical ailments, already diagnosed diseases and prescribed medicines.
8 0
3 years ago
Read 2 more answers
An intranet is a way for a company or organization to protect copyrighted and other important information?
Korolek [52]

If this is true or false, it would be true

Hope this helps

-AaronWiseIsBae

4 0
3 years ago
Read 2 more answers
What are the data types used in C programming with examples
Zepler [3.9K]
I don’t really understand what you are trying to ask. Try posting a picture along with your question
5 0
3 years ago
She wants to sort the list based on the names of the first four gas in ascending order. Which command group dose she navigate to
zubka84 [21]

<u>Best method to sort data:</u>

Best method to sort for data people use excel sheet.  If we have 4 quarter sales data of each select man wise.

1. Open the MS Excel

2. Create blank sheet

3. Create list of salesman and quarter sales in each cells from A1….

4. Select all whole worksheet and paste it the data

5. Once data is copied, custom list is created and select advanced options dialog box, select required field and sorting is achieved.

This is simple’s method for sort the list based on the names of the first four gas in ascending order.

7 0
3 years ago
Read 2 more answers
Other questions:
  • Anna wants to open the Run dialog box to run her program file. Which keys should she press to open the Run dialog box?
    14·1 answer
  • _____ is two or more connected computers.
    8·1 answer
  • The indent buttons on the home tab allow you to increase or decrease paragraph indenting in increments of ____ inches.
    5·1 answer
  • What is not a common purpose for a research report?
    5·2 answers
  • A software process describes the interrelationship among the phases by expressing their order and frequency, but does not define
    14·1 answer
  • Write a function SwapArrayEnds() that swaps the first and last elements of the function's array parameter.
    6·1 answer
  • The average number of entities completed per unit time -- the output rate -- from a process is called ____.
    9·1 answer
  • WILL GIVE BRAINLIEST!!!!!!!
    10·2 answers
  • How would you open the web browser in Linux and still have access to the Linux terminal?
    14·1 answer
  • Numerous engineering and scientific applications require finding solutions to a set of equations. Ex: 8x + 7y = 38 and 3x - 5y =
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!