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
Https://forms.gle/eP8F5eKC2AUaCsB67
Deffense [45]

Answer:

NO .THATS NOT A GOOD QUESTIONS.

Explanation:THOSE R PERSONAL

3 0
3 years ago
Under what driving conditions will 2019 Nissan LEAF’s available Rear Cross Traffic Alert (RCTA) warn the driver if a vehicle is
Dmitriy789 [7]

Answer:

When the driver is <em>reversing the car</em>

Explanation:

The Rear Cross Traffic Alert (RCTA) is Nissan's <em>risk  of collision detector</em> that warns drivers if one or more cars are approaching the rear of your car when backing up from a parking space.  

Sensors around the back of the vehicle identify vehicles drawing nearer from the either way. A notice tone and glimmering light will appear and  alert the driver to stop.  

5 0
3 years ago
. Evan is creating a worksheet and needs to copy information in cells A2:A13 into cells B2:B13. Which of the following is the ea
Fantom [35]
Highlight A2 and drag down and select the cells to A13. Then do ctrl+c to copy.
Next Highlight the cell B2 and then do ctrl+v. This will paste all the cells 
4 0
3 years ago
Terry is having a problem with his computer screen. He said the screen looks distorted. When you go to check his monitor, you no
andreyandreev [35.5K]

Answer:

B. Computer's resolution has been set too low

Explanation:

A. Font size has been set too high.

B. Computer’s resolution has been set too low.

C. Refresh rate of the video card is out of sync with the monitor’s refresh rate.

D. ClearType setting is enabled.

From the given options; if the font size has been set too high, the effect is on the texts and not icons. If the video card is out of sync there will be little or no display at all.

So, the correct option is Computer's resolution has been set too low.

3 0
3 years ago
A chemical mixture that is burned to produce thrust. (Jet engine homework)
Goshia [24]

Answer:

its b

Explanation:

its propellant hope I got it to you in time

4 0
3 years ago
Read 2 more answers
Other questions:
  • File formats are linked to certain programs.<br><br> True<br> False
    12·2 answers
  • Technician A says that if a valve is open when a piston rises to the very top of a cylinder, the piston may actually strike the
    13·1 answer
  • The intensity of force acting on a rock body is expressed as
    14·1 answer
  • ____ is a font that resembles the letters that typewriters produced.
    9·1 answer
  • L’Oreal, a manufacturer of personal care and beauty products, has a focus on sustainability. It has developed eco-packaging, eli
    10·1 answer
  • Which of the following STEM discoverers invented an application that uses summarization technology? Fedkiw Hawking D’Aloisio Gat
    7·1 answer
  • Code Problem 2 in Python 2.
    5·1 answer
  • Which is the correct code to declare a catch-all handler?
    13·1 answer
  • Which of the four factors of production are hit the hardest when high unemployment occurs ?
    10·1 answer
  • This was the template given for my assignment: class Login:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!