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
When you identify the data elements in a new database, you typically subdivide data elements into?
DochEvi [55]
When you identify the data elements in a new database, you typically subdivide data elements into <span>the smallest practical component. 

Thank you for posting your question here at brainly. I hope the answer will help you. Feel free to ask more questions.
</span>
4 0
3 years ago
Write 4 types of viruses , explain them briefly.
wariber [46]

I can help with two.

Web Scripting Virus, A sneaky virus that targets popular websites. What this virus does is overwrite code on a website and insert links that can install malicious software on your device. Web scripting viruses can steal your cookies and use the information to post on your behalf on the infected website.

FILE INFECTOR, targeting executable files (.exe), file infector viruses slow down programs and damage system files when a user runs them.

8 0
3 years ago
What is episodic memory? knowledge about words, concepts, and language-based knowledge and facts information about events we hav
tankabanditka [31]

Answer:

<em>information about events we have personally experienced</em>

Explanation:

Episodic memory is <em>the actual memory of a particular event that a person has, so it will be different from the recall of the same encounter or experience by someone else.</em>

Often, episodic memory is mistaken with autobiographical memory, and while autobiographical memory includes episodic memory, it also depends on semantic memory.

<em>For instance, you might know the city you were born in and the date, though you have no particular birth memories.</em>

3 0
3 years ago
When you listen to a guitar duet and have trouble hearing the melody, which of the following would best explain the problem?
emmasim [6.3K]

Answer:

One of the guitarists is playing too loud.

Explanation:

My dad plays the guitar...?

I'm shocked it's not "not keeping a steady beat", so I'm certain this is it.

3 0
3 years ago
Read 2 more answers
In regard to segmentation, all of the following are examples of a customer's behavior or relationship with a product EXCEPT: a)
scZoUnD [109]

Answer: demographics

Explanation:

Market segmentation refers to the process of dividing the consumers into sub-groups of consumers which are refered to as the segments based on the characteristics shared.

The examples of a customer's behavior or relationship with a product include user status, usage rate and loyalty status.

It should be noted that some examples of market segmentation are behavioral, demographic, geographic, and psychographic. From the options given, demographics is not an example of a customer's behavior with a product.

7 0
3 years ago
Other questions:
  • Write a program that accepts as input the mass, in grams, and density, in grams per cubic centimeters, and outputs the volume of
    14·1 answer
  • When called upon to give an impromptu speech, it is a good idea to do all of the following, except:
    11·2 answers
  • "write a program that reads two floating point numbers and prints their sum difference and product."
    13·1 answer
  • In a database, __________ is used to uniquely identify each record for retrieval or manipulation. answer an attribute or a field
    7·1 answer
  • The code segment below uses the procedure IsPartOf (list, item), which returns true if item appears in list and returns false ot
    13·1 answer
  • You recently discovered that Marketing1 can connect to Admin1, and Admin1 can connect to Marketing1, but neither of these comput
    11·1 answer
  • Elizabeth works for a local restaurant At the end of her shift, she is required
    15·2 answers
  • The entire presentation can be seen at a time in __________
    5·1 answer
  • Java-Script Concept quiz:
    6·1 answer
  • Help pweaseee!! Lloyd has created a validation script for a data entry form. What property should he use to test for a selected
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!