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
Gennadij [26K]
3 years ago
13

Consider the classes below:

Computers and Technology
1 answer:
jeka57 [31]3 years ago
7 0

Answer:

Hi!

The correct answer is d. Neither (a) nor (b) is true.

Explanation:

First, you have to know what the scripts intend to do, and they are counting from 1 to 10 in both cases.

Table of results of class TestA at end of each iteration:

[j = 0,  counter =  1]

[j = 10,  counter =  2]

[j = 20,  counter =  3]

[j = 30,  counter =  4]

[j = 40,  counter =  5]

[j = 50,  counter =  6]

[j = 60,  counter =  7]

[j = 70,  counter =  8]

[j = 80,  counter =  9]

[j = 90,  counter =  10]

Table of results of class TestB at end of each iteration:

[j = 10,  counter =  1]

[j = 9,  counter =  2]

[j = 8,  counter =  3]

[j = 7,  counter =  4]

[j = 6,  counter =  5]

[j = 5,  counter =  6]

[j = 4,  counter =  7]

[j = 3,  counter =  8]

[j = 2,  counter =  9]

[j = 1,  counter =  10]

That's why a) and b) are false.

Maybe you want to know why using pre increments on class TestB doesn't affect the loop. The reason is that when enters in a loop, first checks the test condition and takes the decision if true or false, and last executes the incrementation step.

You might be interested in
Twitter, Foursquare, and other real-time media add to or leverage capabilities of smartphones--improving your ability to be well
Sati [7]

Answer: True

Explanation: Twitter is the application that functions online for providing news and communication for connecting people on social network.Foursquare is also an online app that works on the social platform in the smartphones and provide the knowledge about activity of people moving through the real-time world.

Other real world apps that operate in the real time helps in providing information about the activities and incidents happening through the smartphones.This also increases the knowledge of the individual by discovering, reading,sharing of the information.Thus the statement given is true.

7 0
4 years ago
. List down mental health problems that may arises with excessive use of digital social networking Do we ever need to be concern
Snowcat [4.5K]

Answer:

Excessive utilization of digital instant messaging could perhaps lead to numerous mental health conditions.

Explanation:

  • The massive pressure just to preserve a privileged lifestyle the same as peer group and other such influencers.
  • Cyberbullying would also be a key component of the social mainstream press. This might cause stress.

Yes, researchers undoubtedly need to worry about who becomes familiar with the internet. There's a whole number of news items living with the effects of over-using social networking sites. There seemed to be headlines that a teen must have been strongly affected by someone with a man as well as ransacked with real money by encouraging them to stay married to her.

8 0
3 years ago
Write a function `has_more_zs` to determine which of two strings contains # more instances of the letter "z". It should take as
nekit [7.7K]

Answer:

// Method's name: has_more_zs

// Parameters are text1 and text2 to hold the two phrases to be tested

public static String has_more_zs(String text1, String text2) {

 // Create and initialize z1 to zero

 // Use z1 to count the number of zs in text1

 int z1 = 0;

 // Create and initialize z2 to zero

 // Use z2 to count the number of zs in text2

 int z2 = 0;

 

 //Create a loop to cycle through the characters in text1

 //Increment z1 by one if the current character is a 'z'

 int i = 0;

 while (i < text1.length()) {

  if (text1.charAt(i) == 'z' || text1.charAt(i) == 'Z') {

   z1 += 1;

  }

  i++;

 }

 //Create a loop to cycle through the characters in text2

 //Increment z2 by one if the current character is a 'z'

 

 i = 0; //Re-initialize i to zero

 

 while (i < text2.length()) {

  if (text2.charAt(i) == 'z' || text2.charAt(i) == 'Z') {

   z2 += 1;

  }

  i++;

 }

 

 

 //Using the values of z1 and z2, return the necessary statements

 if (z1 > z2) {

  return "The phrase '" + text1 + "'" + " has more occurences of z than the phrase " + "'" + text2 + "'";

 }

 else if (z1 < z1) {

  return "The phrase '" + text2 + "'" + " has more occurences of z than the phrase " + "'" + text1 + "'";

 }

 else if (z1 == z2) {

  return "The strings have the same number of z";

 }

 else {

  return "Neither string contains the the letter z";

 }

}

Explanation:

Explanation to answer has been given in the code as comments. Please refer to the comments for the details of the code.

The source code file has been attached to this response and saved as "NumberOfZs.java"

Hope this helps!

Download java
5 0
3 years ago
Technically a coding question utilizing python how would one calculate a square root
WITCHER [35]

Answer:

import math

math.sqrt( x )

Explanation:

The basic code that can be written to calculate the square root of a number is as follows

import math

math.sqrt( x )

5 0
3 years ago
SaaS supports multiple users and provides a shared data model through _________ model.
Hoochie [10]

Answer:

b) multi-tenancy

Explanation:

Cloud computing can be defined as a type of computing that requires shared computing resources such as cloud storage (data storage), servers, computer power, and software over the internet rather than local servers and hard drives.

Generally, cloud computing offers individuals and businesses a fast, effective and efficient way of providing services.

Cloud computing comprises of three (3) service models which includes;

1. Platform as a Service (PaaS).

2. Infrastructure as a Service (IaaS).

3. Software as a Service (SaaS).

Software as a Service (SaaS) can be defined as a cloud computing delivery model which involves the process of making licensed softwares available over the internet for end users on a subscription basis through a third-party or by centrally hosting it.

Hence, Software as a Service (SaaS) supports multiple users and provides a shared data model through multi-tenancy model. A multi-tenancy model can be defined as a software architecture that provides services to multiple end users through an instance of the software application running on a server. Thus, in SaaS multiple end users can share the software application, a single database, and each user being logically separated from one another.

5 0
4 years ago
Other questions:
  • You are working the 8:00 AM shift at the help desk. An irate user who fails to identify himself calls in claiming that his works
    7·1 answer
  • Teachers in most school districts are paid on a schedule that provides a salary based on their number of years of teaching exper
    7·1 answer
  • Yesterday you installed a new game on your computer. When you ran the computer, you noticed that the application was running ver
    15·1 answer
  • Annalise received financial aid offers from two universities. Financial Analysis for Option A Costs per Year Financial Aid Packa
    8·2 answers
  • 1. Give one reason why data is represented in binary in a computer
    15·1 answer
  • Rita wants to know the size of each image in a folder. Which view will help her find this information quickly?
    13·1 answer
  • Which three factors should be discussed before planning and building a project?
    15·1 answer
  • Energía de movimiento de los átomos o moléculas
    11·1 answer
  • Explains why do we use formulas instead of just using a calculator in Excel?​
    7·1 answer
  • Which of the following security policies can be implemented to prevent removable media from automatically launching potentially
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!