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]
3 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]3 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
A job placement agency helps match job seekers with potential employers. The agency would like to design a simulation in order t
storchak [24]

Answer:C

Explanation:

The answer is C

6 0
3 years ago
You want high availability for DHCP services, a primary server to handle most DHCP requests, and a secondary server to respond t
babymother [125]

Answer:

The blocking system.

Explanation:

In order to avoid servers to replicate with each other, I should configure the blocking system of the first DHCP.

For example, if the first DHCP fails to respond, the second will get in place, however, I have to configure the first system that immediately that the second DHCP starts working, the first blocks its information and use.

By this way, there won´t be any duplicated actions or reponses.

5 0
3 years ago
How come the scroll bar on the PA emojis only appears sometimes? how do I make it appear?
astraxan [27]
Answer it your own self everybody can't always give u the answers
5 0
3 years ago
Which of the following includes premium content you must pay to use?<br> On word
kotykmax [81]

Some premium contents on Microsoft Word that you must pay before using them include:

  • 1 TB of OneDrive cloud storage
  • Advanced security
  • Expanded technical support
  • Premium templates, among others.

<h3>What are Premium Contents or Features?</h3>

Premium contents or features are exclusive features that have higher quality when compared to the usual quality. In an application like Microsoft Word, there are premium contents or features that can only be used or made available when you subscribe.

Some premium contents on Microsoft Word that you must pay before using them include:

  • 1 TB of OneDrive cloud storage
  • Advanced security
  • Expanded technical support
  • Premium templates, among others.

Learn more about premium contents on:

brainly.com/question/24749457

5 0
2 years ago
Suppose you are given a relation emp(empid, dept, salary) and wish to maintain a materialized view deptsalary(dept, totalsalary)
NeX [460]

Answer:

WITH deptsalary AS (

SELECT dept,  SUM(salary)

FROM emp

GROUP BY dept)

SELCT *

FROM deptsalary

Explanation:

deptsalary is temporary table.

dept and its respective sum of salary is to be displayed

7 0
3 years ago
Other questions:
  • Unit testing:_________. A. provides the final certification that the system is ready to be used in a production setting. B. incl
    8·1 answer
  • Write the definition of a class Clock. The class has no constructors and three instance variables. One is of type int called hou
    13·1 answer
  • Your bluetooth headset is waiting for another bluetooth device to locate its signal. what is this mode known as?'
    8·1 answer
  • A browser is used for creating Web pages. true or false?
    5·2 answers
  • Computers that are close to one another are connected to form a LAN
    7·1 answer
  • What is a good safety precaution to take when opening a computer case?
    9·1 answer
  • What type of error results from an error in the formatting of the program code?
    13·1 answer
  • According to Caroline Heldman, what product was pulled from Abercrombie and Fitch stores based on protests through a blog
    11·1 answer
  • Why is graphics important in multimedia application <br>​
    11·1 answer
  • Calculate the time complexity for the following function in terms of Big O notation. Explain your answer.
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!