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
Bill needs to make a presentation in which he has to represent data in the form of a pyramid. Which feature or menu option of a
andreyandreev [35.5K]

Answer:If you need to use arrows in a chart, which feature or menu option of a word processing program would you use?

A.  

Picture

B.  

Shapes

C.  

Clip Art

D.  

SmartArt

E.  

Charts

Explanation:

7 0
4 years ago
The _____ approach treats process and data independently and is a sequential approach that requires completing the analysis befo
Solnce55 [7]

Answer:

C. Object Oriented

Explanation:

In Object Oriented approach to development of information systems, processes and data are handled independently and could be tested as separate modules before the actual development begin.

Hope this helps!

4 0
3 years ago
Which of the following tasks requires software? A Writing a paper on the history of Aztec sun godsB Creating a photo collage for
elena55 [62]
All of the above A, look up Info, B, get pictures and print, C, webpage is on the internet or computer hope this helps ~Vanessa
8 0
4 years ago
write an expression taht evaluated to true if and only if the variable s does not contain the string 'end'
natima [27]

Answer:

//check which string is greater

if(strcmp(name1,name2)>0)

//assign name1 to first, if the

    //name1 is greater than name2

    first=name1;

else

    //assign name2 to first, if the

    //name2 is greater than name1

    first=name2;

5)

//compare name1 and name2

    if(strcmp(name1,name2)>0)

   

         //compare name1 and name3

         if(strcmp(name1,name3)>0)

       

             //assign name1 to max, becuase

             //name1 is greater than name2 and name3

             max=name1;

       

Explanation:

7 0
3 years ago
QUESTION: Which is not an example of a video port or cable?
Vikki [24]

Answer:

Radio Corporation of America (RCA)

Explanation:

A corporation is not a video connector.

8 0
3 years ago
Other questions:
  • Suppose we are comparing implementations of insertion sort and merge sort on the same machine. for inputs of size n, insertion s
    10·1 answer
  • You run anti-virus software on your computer; however, you are experiencing symptoms that may be caused by a virus. What should
    13·1 answer
  • What is the purpose for adding images and graphics to a web page?
    5·1 answer
  • How are publishing used
    10·1 answer
  • WILL GIVE BRAINLIEST!!!!!!!!
    6·1 answer
  • What type of network component is Telnet?
    10·2 answers
  • Instructions:Select the correct answer.
    5·1 answer
  • Convert 3BA.25 (base 14) to base 6 ? Show all arithmetic in decimal
    5·1 answer
  • HELP PLEASE!!!
    7·1 answer
  • susan wrote the recursive formula for the sequence represented by the exploit formula An=3+2n. put an C net to any correct state
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!