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
kakasveta [241]
3 years ago
11

PLEASE HURRY!!!

Computers and Technology
1 answer:
nalin [4]3 years ago
3 0

Since conditionB is true, the if statement will run. numX will be 5

You might be interested in
Matt is a senior developer for Cyber Protect, a company that helps secure management information systems. Matt's new task is to
Len [333]

Answer:

white-hat hacker

Explanation:

The white-hat hacker is also called as ethical hacking. The white hat hacker is the security of the computer in an ethical manner by some experts it specializing in system testing and other test modules of computer is to ensure the security of the information security of an organization.

As Matt is a  developer for protecting the Cyber in a company The Matt creates secure management information systems. it divides the new task into the computer So Matt is a white-hat hacker in that organization

4 0
3 years ago
Complete the getNumOfCharacters() method, which returns the number of characters in the user's string. We encourage you to use a
photoshop1234 [79]

Answer:

The Java code is given below with appropriate comments

Explanation:

//Program

//Import the necessary libraries

import java.util.Scanner;

//Define the class

public class CountStringCharacters

{

//Start the main method

public static void main(String[] args)

{

//Prompt the user to enter the input line

Scanner scan = new Scanner(System.in);

System.out.println("Enter a sentence or phrase: ");

String s = scan.nextLine();

 

//Take the number of characters and keep the count

int numOfCharacters = getNumOfCharacters(s);

System.out.println("You entered: "+s);

System.out.println("Number of characters: "+numOfCharacters);

 

//Call the method outputWithoutWhitespace

outputWithoutWhitespace(s);

}

//The method getNumOfCharacters

public static int getNumOfCharacters(String s)

{

int numOfCharCount = 0;

for(int i=0; i<s.length();i++)

{

numOfCharCount++;

}

return numOfCharCount;

}

//Definition of the method outputWithoutspace

public static void outputWithoutWhitespace(String s)

{

String str = "";

for(int i=0; i<s.length();i++)

{

char ch = s.charAt(i);

if(ch != ' ' && ch != '\t')

str = str + ch;

}

System.out.println("String with no whitespace: "+str);

}

}

5 0
3 years ago
Write a function called count_occurrences that takes two strings. The second string should only be one character long. The funct
iVinArrow [24]

Answer:

Here is the Python function:

def count_occurrences (string1 , string2):  # method that takes two strings as parameter and returns how many times second string occurs in first

   count = 0  #counts number of occurrence of string2 in string1

   for word in string1:  #iterates through each word of the string1

       for character in word:  #iterates through each character of each word in string1

           if character == string2:  # checks if the character in string1 is equal to the character of string2

               count = count + 1  #adds 1 to the count of string2 in string1

   return count  #returns number of times the string2 occurs in string1

#in order to check the working of the function add the following lines to the code:    

first_str = input("Enter the first string: ")  #prompts user to enter first string

second_str = input("Enter the second string (one character long): ") #prompts user to enter second string which should be one character long

occurrence = count_occurrences(first_str,second_str)  #calls count_occurrences method by passing both strings to it

print(second_str,"occurs",occurrence,"times in",first_str) #prints how many times the second_str occurs in the first_str on output screen

Explanation:

The program is well explained in the comments added to each statement of the above code. I will explain the program with an example:

Suppose

string1 = "hello world"

string2 = 'l'

So the method count_occurrences() should return how many times l occurs in hello world.

count is used to count the number of occurrences of l in hello world. It is initialized to 0.

The first loop iterates through each word of string1. The first word of string1 is "hello"

The second loop iterates through each character/letter of each word. So the first letter of "hello" word is 'h'.

The if condition if character == string2: checks if the character is equal to string2 i.e. l.

character = "h"

string2 = "l"

The are not equal so the program moves to the next character of word hello which is e. The if condition again evaluates to false because e is not equal to l. So the program moves to the next character of word hello which is l.

This time the if condition evaluates to true because

character = "l"

string2 = "l"

character == string2

l == l

So the if part is executed which has the following statement:

count = count + 1

So the count is added to 1. count was 0 previously. Now

count = 1

Next the program moves to the next character of word hello which is l. This time the if condition evaluates to true because the character l matches with string2. So count is again incremented to 1. count = 2.

Next the program moves to the next character of word hello which is o. The if condition evaluates to false as o does not match with string2 i.e. l. So the count remains 2.

Next the first loop moves to the next word of the string1 = "world". The inner (second) for loop iterates through each character of "world" from "w" to "d" and checks if any character is equal to string2. Only one character is equal to string2 in "world". So count is incremented to 1. Hence count = 3

After the loop ends the statement return count returns the number of times string2 occurs in the string1. So the output is:

l occurs 3 times in hello world  

8 0
3 years ago
Which is an example of a zero-point perspective?
kap26 [50]

i think its b sorry if  wrong

4 0
3 years ago
Word Online works exact same as the downloaded Office 2016 version.<br>True<br>False​
melisa1 [442]

Answer:

The Answer is false. They work similarly but quite differently on a lot of offerings from them. Office 365 and office.com are online version, and Office 2016 is a desktop version.

Explanation:

I am not going very deep into this but the facts I am mentioning will clarify your doubts.

Office 2016 offers so many ways to share a file even though we work offline on it We can email the document, share on social media as well as store on One drive. However, Office 365, and especially Word online does not allow any other sharing options than sending an invitation or sharing a link.

For Word Online you will need internet all the time, though you can work from anywhere, and even on any device. Word 2016 does not require internet, but provide a lot of analytics features and even data mining facilities when it is connected to the internet.

Watch out for Word online 2019 version, and office 2019 desktop version. They are awesome and provides AI features, and a lot more than 2016 versions, both desktop and online.

3 0
3 years ago
Other questions:
  • Which statement is true? Group of answer choices Variables cannot be assigned and declared in the same statement Variable names
    5·1 answer
  • The ___ is the primary storage device of a personal computer. hard drive RAM ROM compact disc
    6·1 answer
  • What type of lights are necessary for silhouettes?
    12·2 answers
  • This toolbar can be used to change the way the text in your presentation looks. Drawing
    5·2 answers
  • It's better to create tables just by starting typing in the data that you want the table to store. There is no need to name fiel
    6·1 answer
  • Help, please!! A file named "games.txt" exists and has 80 lines of data. You open the file with the following line of code. aFil
    6·1 answer
  • If the physical memory size is doubled without changing any of its other parameters, the number of entries in the page table
    5·1 answer
  • Write a function stats that takes an array and the number of elements in the array. Then, it computes and prints the minimum val
    8·1 answer
  • A recommended cleaner for the bowls of coffee brewers is
    7·1 answer
  • Is y0utube an example of unsupervised learning or supervised learning?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!