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
algol [13]
4 years ago
14

Write a JAVA program containing a method called hasEight(), which takes an int as input and returns true if the number contains

the digit 8 (e.g., 18, 808). Your program must implement the method and take input from the user. Please upload only your .java file for full credit. Any other file type and programs without the hasEight() method will not receive any credit.
Computers and Technology
1 answer:
skelet666 [1.2K]4 years ago
7 0

Here's my code for that, consider it under the WTFPL (http://www.wtfpl.net/). Here is a pastebin of the code, as to avoid text formatting. (Link: https://pastebin.com/S3BDGxqm Raw: https://pastebin.com/raw/S3BDGxqm)

package javaapplication6;

import java.util.Scanner;

public class JavaApplication6 {

   

   public static void main(String[] args) {

       

       Scanner myScanner = new Scanner(System.in);

       

       boolean a;

       int s;

       System.out.println("Enter an int");

       s = myScanner.nextInt();

       a = hasEight(s);

       System.out.println(a);

       

   }

   private static boolean hasEight(int s)

   {

       String str = String.valueOf(s);

       return str.contains("8");

   }

   

}

You might be interested in
How are envelopes and letterheads different
choli [55]
Envelope - a flat paper container with a sealable flap, used to hold a small letter or document.

letterhead - a printed heading on stationery stating a person's or organization's name and address. A letterhead is very important when it comes to businesses.

Hope this helps! =D
8 0
4 years ago
What is the advantage of using plenum cable for twisted-pair cable?
adell [148]

The advantage of using plenum cable for twisted- pair cable  is it is "Fire resistant"

<u>Explanation:</u>

Plenum cable is a cable that is used in plenum spaces of buildings. These cables have fire resistance characteristic with low smoke. These cables are self extinguishing, and never re-ignite. They require less space for installation and allows space for air circulation to be used by the HVAC system. Twisted-pair, coaxial, HDMI and DVI variants of cable are manufactured in the plenum version. Plenum cable is mandatory to be fixed in any "air handling" area.

7 0
3 years ago
Which is an example of an incremental approach to solving a problem?
zvonat [6]

Explanation:

One of the things I’ve been writing and talking about a lot lately is the fact that solving problems collaboratively is an incremental process. In fact, in my book, Lost at School, I made mention of the fact that the model could just as easily have been called Incremental Problem Solving or Progressive Problem Solving. I thought the collaborative aspect of the model was the most important to emphasize, but that doesn’t mean that the incremental component isn’t almost as crucial. Often people who are new to the model enter the process of resolving a problem as if it’s a one-shot deal. If you have experience in using Plan B, you already know that most problems require more than one visit to Plan B to resolve. In other words, longstanding, complicated problems aren’t likely to be resolved the first time you try to discuss them. There’s a lot of information to be processed before a given problem can be solved. You need to gather information so as to achieve the clearest possible understanding of the kid’s concern or perspective on the problem (for the unfamiliar, that’s called the Empathy step). Then, you need to be clear about and articulate your own concern (that’s the Define the Problem step). Then, you’ll want to brainstorm with the kid so as to consider the array of potential solutions that could be applied to the problem and consider whether each solution truly addresses the concerns of both parties (that’s the Invitation). There’s a good chance you won’t even make it through all three steps of Plan B in the first attempt on a given unsolved problem (nor should you necessarily even try). If Plan B were a “technique,” then disappointment over not making it through all three steps in one conversation would be understandable. But Plan B is not a technique, it’s a process. As I’ve often emphasized, if you only make it through the Empathy step in the first attempt at Plan B on a given problem but you emerge with a clear sense of a kid’s concern or perspective on a problem that’s been causing significant angst or conflict, that’s quite an accomplishment. You’ll get back to the remaining steps at your earliest opportunity. There’s also an excellent chance the first solution you and the kid agree on won’t solve the problem durably. As you may know, this is usually because the original solution wasn’t as realistic and mutually satisfactory as the two parties first thought. But it could also be because the concerns weren’t as clear or simple as it first seemed. If a solution doesn’t stand the test of time, your goal is to figure out why, which means gathering additional information about the concerns of the two parties and why the solution may not be working so well. Plan B should always conclude with both parties agreeing to return to the problem if the solution being agreed upon doesn’t solve the problem durably. So if your enthusiasm for Plan B waned because your first solution didn’t stand the test of time, take heart: that’s not unusual. Many people enter Plan B with great hope, eager to see their new approach to helping a challenging kid pay quick dividends. In fact, Plan B may well pay quick dividends…not necessarily because the problem is yet durably solved, but because of the relationship- and communication-enhancing that occurs. And while the occasional problem – often simple ones – can be resolved with one visit to Plan B, now you know that several repetitions of Plan B may be necessary on each unsolved problem. Thanks for reading.

8 0
3 years ago
Compute the approximate acceleration of gravity for an object above the earth's surface, assigning accel_gravity with the result
Zepler [3.9K]

Answer:

The summary of the given query would be summarized throughout the below segment. The output of the question is attached below.

Explanation:

Given values are:

  • G = 6.673e-11
  • M = 5.98e24
  • accel \ gravity = 0
  • dist\ center=float(inp())

here,

inp = input

By utilizing the below formula, we get

⇒ \frac{GM}{d^2}

Now,

⇒ accel \ gravity=\frac{G\times M}{dist \ center**2}

⇒ print("Acceleration of gravity: {:.2f}".format(accel_gravity))

6 0
3 years ago
Which of the following occupations is least likely to involve use of a computing device on a day-to-day basis?
aliya0001 [1]

Answer:

Janitorial duties

Explanation:

7 0
3 years ago
Other questions:
  • The _______ valve protects the air pump from reverse-exhaust pressure.
    11·1 answer
  • [Edhesive] 4.1 Code Practice
    5·2 answers
  • ________ employs state-of-the-art computer software and hardware to help people work better together.
    13·1 answer
  • How can we get the number of records or rows in a table using MySQL? *
    8·1 answer
  • How to learn how to use computers
    9·1 answer
  • Write a function named max that accepts two integer values as arguments and returns the value that is the greater of the two. Fo
    12·1 answer
  • Corinne is on a project team and they are in the project execution phase. She gets a call from a stakeholder to make a change to
    6·1 answer
  • Hey Yo, i need some help, Whats 2+2?
    7·2 answers
  • If I am working in a document and wish to follow a hyperlink, what should I do?
    7·1 answer
  • Write a program in Java to input a letter. If it is an uppercase letter then
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!