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
Which of the following statement is true for Service Request Floods A. An attacker or group of zombies attempts to exhaust serve
klio [65]

Answer:

The answer is "Option A and Option B"

Explanation:

This is a type of attack, which is mainly used to bring down a network or service by flooding large amounts of traffic. It is a high-rate server from legitimate sources, where an attacker or group of zombies is attempting to drain server resources by creating and disconnecting the TCP link, and wrong choices can be described as follows:

In option C, It can't initiate a single request because when the servers were overloaded with legitimate source links, the hacker may then set up and uninstall TCP links.

7 0
3 years ago
Tasked to install additional RAM in a computer. He unplugs the system from the power source and removes the PC cover. What shoul
Galina-37 [17]

Answer:Put on an ESD(Electrostatic discharge) strap.

Explanation: An ESD wrap which is also known as ground wrap is a sort of a wrap that is tied around the wrist to protect the person electronic equipment's static electricity.  This wrap produces anti static energy which help in not producing any static charge while the technician touches the inner parts of the CPU of other internal parts of the system.

4 0
3 years ago
The concept of taking traffic that’s all aimed at the same node and delivering it to the proper receiving service is known as
Cerrena [4.2K]

Answer:

"Demultiplexing" is the right answer.

Explanation:

  • A procedure for retransferring into genuine distinct, independent signals a transmission combining numerous digital as well as analog components, is considered as Demultiplexing.
  • Lending incoming different segments towards appropriate application-level procedures instead on the positive side of the recipient.
7 0
3 years ago
Compared to EMT, IMC is?​
Soloha48 [4]

Answer:

IMC is typically compared to RMC, but regarding weight it lies between RMC and EMT, or electrical metallic conduit.

EMT is commonly used for branch circuit wiring in homes (where the wiring runs are exposed) and in commercial buildings. EMT is never threaded and is not designed for strong connections like IMC and RMC.

7 0
3 years ago
Your company shares a building with a competitor’s branch office. Recently, you noticed that some computers other than company c
ki77a [65]

Answer:

Disable SSID Brodcasting, Lower Radio Power Levels, Enable MAC Filtering

3 0
3 years ago
Other questions:
  • âwhat service uses a private cloud in conjunction with a web browser or downloaded client software to access desktop software?
    10·1 answer
  • How do I upload a picture in python 3
    7·1 answer
  • The help desk received a call from a user who cannot get any print jobs to print on the locally shared printer. While questionin
    10·2 answers
  • Please help me!! 10 Points are waiting!!
    8·1 answer
  • Which layer includes the physical transmission medium (cables or wireless media) that any network must use to send and receive t
    8·1 answer
  • Differentiate between the broadcasting and telecommunication
    5·1 answer
  • Alan wants to buy camera support equipment that would provide mechanical support to his camera and which could also store extra
    5·1 answer
  • Describe four features of a well designed input screen
    10·2 answers
  • Consider some of the widespread global issues that we face here on Earth and briefly describe them. Then, choose one of the spac
    8·1 answer
  • What Microsoft feature enables you to represent text as colorful visuals
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!