Below you can see stringSize, which is implemented in Java

Below You Can See StringSize, Which Is Implemented In Java

Answers

Answer 1

Answer:

(a): Yes, it is logically correct as the code does a loop through the all characters of the string and outputs the total amount of them within the string.

(b): It is poorly designed because it is not the most efficient way to get the size of the string. There is a much better way in obtaining it through s.length() and it also accounts for spaces as characters as well.

Explanation:

Hello! Let's help you with your question here!

Now, it is split up into two parts so I will explain them both as such.

Part A:

For this part of the question. Yes, it would be logically correct. When the size is returned, it will return the number of characters in s. Let's break down the code step by step:

Code Rundown:int size = 0; (Initializing a size variable of type int and setting it to 0)for (int i = 0; i < s.length(); i++): We create what is known as an index i and have it loop until it reaches the length of the string (This is where we loop through the characters).size++; (For every loop, it'll just add 1 to size, essentially making it a counter).return size; (This returns the number within size after the loop is finished.)

As you can see from the rundown, it initializes a counter and loops through each character of the string and increases the counter as it goes. So for this part, it is logically correct as it does give us the total amount of characters within a string which is considered the string size.

Part B:

It is poorly designed under two reasons, one is more important than the other as the second one isn't really a requirement, it's just quality of life.

Reason 1 (The Important One):

The main reason why this is poorly designed is that it is not optimized. What it does here is going through the entire string and adds 1 to the counter every time there is a character. However, s.length() achieves the same thing. Instead of creating a counter and having it loop through the entire string and adding 1 to the counter for every character and then returning the counter. s.length() is a method that returns the length of a specified string. In this case, it returns the size of the string. To put it simply, the code in the example can be simplified to just:

private static int stringSize(String s) {

      return s.length();

}

This would still give us the same result as the example without having to go through a loop. In programming and algorithms, we learn about time complexity. To put it simply, it is the time it takes for the program to complete. The faster it does without any errors, the more efficient and optimal it becomes. For the code example above, we have time complexity O(n). What this means is that the program needs to run through a loop (multiple checks) before finishing the code, this is the second fastest time. However, with the code I showed you above, it has a time complexity of O(1). For this code, it doesn't need to run any checks, it can just finish the code immediately. Therefore, the code in the example is not efficient.

Reason 2 (Quality of Life One):

While the code does work well and does give you an accurate total size of the string every time, it however accounts for spaces as well. If you were to have a space in your string, it would bump the counter up as in Java, as spaces are considered a character because of this you won't get an accurate string size count if you want letters and symbols only. A way to improve it is to create a check within the loop that tells us if the character we are looking at, in the index, is a space or not. If it is a space, we subtract the size counter by 1 and move on. So the modified code would look like this:

public static int stringSize(String s) {

      int size = 0;

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

            size++;

            char c = s.charAt(i);

            if (c == ' ') {

                 size--;

            }

      }

      return size;

}

Explanation:

In the code, I am still adding 1 to the size counter still. However, in the bold. I create a variable c of type char and take the character of the string where the index is currently and use an if statement to determine if it is a space or not. If it is not, then the code repeats until the loop is done and then returns the size of the string. However, if it is a space, it'll subtract 1 from the size counter and will loop through the entire string doing this check and then returns the size of the string when it is done.

Learn more about time complexity at https://brainly.com/question/28018274


Related Questions

What effect do coworkers have on the socialization of new employees?
O a
Coworkers potentially do all of these things.
Ob
Coworkers provide valuable support and information to newcomers.
Oc
Od
Coworkers have no benefit to the socialization process and should be separated from newcomers as much as possible.
By welcoming the newcomer to the team, coworkers tend to offer more job-related information to the newcomer.
Through social interaction, coworkers reduce the newcomer's stress during socialization.
Oe

Answers

Through social interaction, coworkers reduce the newcomer's stress during socialization. Thus option E is the correct answer.

What is socialization?

Socialization generally refers to the process of social influence through which a person acquires the culture or subculture of their group, and in the course of acquiring these cultural elements, the individual's self and personality are shaped.

Why is socialization important?

Socializing not only staves off feelings of loneliness, but also helps sharpen memory and cognitive skills increases your sense of happiness and well-being, and may even help you live longer.

How will you socialize new employees in your organization?

You can help socialize employees by encouraging after-work gatherings.

Thus, option E is the correct option.

To know more about socialization:
https://brainly.com/question/10455747
#SPJ1

(دانا
Physical appearance
OF Fith generation
computer

Answers

The physical appearance of the fifth-generation computers is VLSI architecture, parallel processing such as data flow control, and logic programming.

What are the generations of computers?

The phrase “generation” refers to a shift in the technology that a computer is/was using. The term “generation” was initially used to describe different hardware advancements.

These days, a computer system's generation involves both hardware and software. 5 Fifth Generation: The period of the fifth generation: 1980-onwards. ULSI microprocessor based.

Thus, fifth-generation computers have knowledge based on a relational database and applied artificial intelligence and pattern processing.

To learn more about Fifth generation computers, refer to the link:

https://brainly.com/question/9354047

#SPJ1

What is output by the following code?

c = 1

sum = 0

while (c < 10):

c = c + 2

sum = sum + c




print (sum)

Answers

It is to be noted that the output of the code given above is Sum = 35.

What is Sum in programming?

The sum() method sums all of the elements in an iterable and returns the total.

sum = sum + inputValue; can be substituted with sum += inputValue; This sentence can be interpreted as "Add up inputValue to total." or "Increase sum by inputValue."

With regard to the above code, when a complier runs this:

c = 1

sum = 0

while (c < 10):  

c = c + 2  

sum = sum + c

print (sum)

Output: 35

The output is 35.

Learn more about codes:
https://brainly.com/question/13013054
#SPJ1

Memory Management - Page fault and Page Thrashing
i) What is page fault?
ii) Describe the steps that take place after a page fault. Include both the actions taken within the handler and those that are taken in hardware before the handler is initiated. How segment defects might be found and treated should be mentioned in your response. Including diagrams may make it easier for you.
iii) What is page thrashing and how might it be avoided?

Answers

1) A page fault is an exception raised by the memory management unit when a process accesses a memory page without making the necessary preparations. To access the page, a mapping must be added to the process's virtual address space.

2) Once the virtual address that produced the page fault is determined, the system verifies that the address is genuine and that there is no protection access problem. If the virtual address is legitimate, the system determines if a page frame is available. If no frames are available, the page replacement procedure is used to delete a page.

3) Thrashing occurs when the page fault and switching occur at a higher frequency, requiring the operating system to spend more time exchanging these pages. This is referred to as thrashing in the operating system. The CPU utilization will be lowered or nonexistent as a result of thrashing.

Eliminating one or more running programs is a temporary remedy for thrashing. Adding extra RAM to the main memory is one of the recommended strategies to minimize thrashing. Another option for dealing with thrashing is to increase the size of the swap file.

What is Memory Management?

Memory management is a type of resource management that is used to manage computer memory. Memory management must include mechanisms for dynamically allocating parts of memory to programs at their request and freeing it for reuse when no longer required.

Management is the method of regulating and coordinating computer memory by allocating parts known as blocks to various operating applications in order to maximize system performance. The primary memory management function of an operating system is the most critical.

Learn more about Page Faults:
https://brainly.com/question/28557805
#SPJ1

GAME DESIGN
If you are designing a video game that will primarily be played on a smartphone or tablet, what considerations about the operation or control methods should you keep in mind?

Answers

If you are designing a video game that will primarily be played on a smartphone or tablet, the considerations about the operation or control methods that you should  keep in mind are:

The Orientation of the device; The processing power of the device; andThe size of the device in relation to the spacing of the controlls.

What are video games?

As a result, there is a growing need for mobile app development services and mobile app development companies. As a result of this demand, various smartphone app development businesses promise to provide excellent services.

Regardless of phone manufacturer improvements, there are still uses for the game design process, such as:

Feature Creep IssueNot Targeting the Correct AudienceGetting the Game NoticedManaging Security ConcernsOperating System Fragmentation.Creating the Monetization ModelUpkeep.

Learn more about video games:
https://brainly.com/question/28060919
#SPJ1

In reference to computers, what is a firewall?

A) letters, numbers, and special characters assigned to unlock accounts and websites
B) email attachments
C) an installed software element that protects and monitors incoming and outgoing data
D) a second copy of files saved to a cloud

Answers

Answer:

C) an installed software element that protects and monitors incoming and outgoing data

Explanation:

4. Answer the following. a. Write the steps to create new presentation from Blank Presentation. How​

Answers

Create new presentation from a Blank Presentation using  PowerPoint by following these steps:

Launch PowerPoint.Select New from the left pane.

Select an option:

Choose Blank Presentation to start from scratch when creating a presentation.Choose one of the templates to use a ready-made design.To see PowerPoint tips, click Take a Tour, and then click Create.

With PowerPoint on your PC or on any device, you can:

Make a presentation from scratch or from a template.Text, images, art, and videos can all be added.Using PowerPoint Designer, choose a professional design.Include transitions, animations, and movement.Save your presentations to OneDrive so you can access them from your computer, tablet, or phone.Share and collaborate with others, no matter where they are.

To learn more about powerpoint presentations, visit: https://brainly.com/question/23714390

#SPJ9

Identification where Information Technology causes a hindrance to business processes

Answers

Identification where Information Technology causes a hindrance to business processes is one that is  Lacking an IT Plan.

Why is planning for information technology so crucial?

The organization's strategic goals and objectives may be achieved with the aid of this planning. The strategic IT plan should take into account how each of the organization's strategic business goals relates to technology as well as any modifications that will need to be made to the organization's information and communications infrastructure.

Note that So much so that a business will find it difficult to run efficiently without fully functional computers and access to emails and data. The consequences of data loss or corruption due to hardware failure, human mistake, hacking, or malware could be disastrous for any organization, it is a basic reality.

Learn more about Technology  from

https://brainly.com/question/25110079
#SPJ1

Find advert in magazines or websites of working desktop computer systems or laptop as well as a monitor, keyboard and software you will also need additional devices such as mouse or printer. Reports outlines and explaining the details of the advertising

Answers

Because of our independence, you have complete control over your data. Your information is your information. Independent, open platform. MRC-accredited metrics Increase the effectiveness of advertising.

How do you write outlines for reports and explain the details of advertising?

Analyze market position information for the product and explain how that position is expected to change. Make a list of suggestions to improve your next advertisement.

Typically, advertising campaigns promote a product or service. A national automaker, for example, may launch a new vehicle model through print advertisements in newspapers and magazines. To reach the vehicle's target market, the company may also place graphics-rich ads on websites. This combined media blitz produces more desirable results than isolated advertisements without a central strategy.

This automobile manufacturer, or any business selling a product or service, evaluates its campaign's effectiveness based on defined criteria. A written report provides an objective campaign analysis, highlights favorable results and identifies areas in which advertising strategy adjustments are appropriate.

To learn more about details of advertising refer to:https://brainly.com/question/1658517

#SPJ1

Write an expression using Boolean operators that prints "Special number" if special_num is -99, 0, or 44.

Answers

A sample expression that uses Boolean operators that prints "Special number" if special_num is -99, 0, or 44 is given below:

The Program

import java.util.Scanner;

import java.io.*;

public class Test

{

   public static void main(String[]args) throws IOException

   {

       File file = new File("SNUMS.INP");

       Scanner inputFile = new Scanner(file);

       int order = 1;

       int i = 1;

      int[] special = new int[1000000+1];

       // Write all 10^6 special numbers into an array named "special"

       while (order <= 1000000)

       {

           if (specialNumber(i) == true)

           {

              special[order] = i;

               order++;

           }

           i++;

       }

       // Write the result to file

       PrintWriter outputFile = new PrintWriter("SNUMS.OUT");

       outputFile.println(special[inputFile.nextInt()]);

       while (inputFile.hasNext())

           outputFile.println(special[inputFile.nextInt()]);

       outputFile.close();

   }

   public static boolean specialNumber(int i)

   {

       // This method check whether the number is a special number

       boolean specialNumber = false;

      byte count=0;

       long sum=0;

       while (i != 0)

       {

           sum = sum + (i % 10);

           count++;

           i = i / 10;

       }

       if (sum % count == 0) return true;

       else return false;

    }

}

Read more about boolean operators here:

https://brainly.com/question/5029736

#SPJ1

What is variable view?

Answers

Answer:

Variable View contains descriptions of the attributes of each variable in the data file. In Variable View, rows are variables. Columns are variable attributes.

Explanation:

Data View is where we inspect our actual data and. Variable View is where we see additional information about our data.

Devision of floating binary
(100.0001)÷(10.1)

Answers

1.101 is the correct answer for floating-point binary (100.0001)÷(10.1).

The sign of a binary floating-point number is represented by a single bit. A 1 bit indicates a negative number, and a 0 bit indicates a positive number.

What is Binary Number System?

One of the four types of number systems is a binary number system. Binary numbers are represented in computer applications by only two symbols or digits, namely 0 (zero) and 1 (one). The binary numbers in this example are written in the base-2 numeral system. [tex]101_{2}[/tex] is an example of a binary number. In this system, each digit is referred to as a bit.

A binary number is defined in digital electronics and mathematics as a number expressed in the binary system or base 2 numeral system. It denotes numerical values with two distinct symbols: 1 (one) and 0. (zero). The positional notation with 2 as a radix is the base-2 system.

Because of its direct implementation in electronic circuits using logic gates, the binary system is used internally by almost all modern computers and computer-based devices. Every digit is known as a bit.

To know more about Binary Number, visit: https://brainly.com/question/8649831

#SPJ1

Write a method that takes two String
parameters, returns the number of times the
second string appears in the first string.
This method must be named
substringCount () and have two String
parameters. This method must return an
integer

Answers

A method that takes two String parameters, returns the number of times the second string appears in the first string.

public static int substringCount(String s1, String s2)
{
  int count = 0;
  int i = 0;
  while ((i = s1.indexOf(s2, i)) != -1)
  {
     count++;
     i += s2.length();
  }
  return count;
}

What is string?
A string is typically a sequence of characters in computer programming, either as a literal constant or as some sort of variable. The latter can either be fixed or its elements and length can be changed (after creation). A string is typically implemented as just an array data structure of bytes (or words) that stores a sequence of elements, typically characters, using some character encoding. A string is generally thought of as a type of data. A string can also represent other sequence(or list) data types and structures, such as more general arrays. A variable declared to be a string may cause memory storage to be statically allocated for just a predetermined maximum length or utilise dynamic allocation to allow this to hold a variable number of elements, depending on this same programming language and specific data type used.

To learn more about string
https://brainly.com/question/28290531
#SPJ13

Describe how smartphones communicate. List and describe four popular types of messages you can send with smartphones. Write one well-written paragraph and answer the above question to earn 10 points.

Answers

The way that smartphones communicate is that people connect with each other and with businesses has been changed by mobile messaging. However, users and businesses can choose from a variety of mobile messaging types.

The Kinds Of Mobile Messaging are:

SMS & MMS MessagingPush Notifications.In-App Messages.RCS.

What is the messaging about?

Brief Message Service (SMS): One of the most popular types of mobile communications is SMS. A basic text message sent via a cellular signal is known as an SMS, or short messaging service.

SMS is completely text-based and has a character restriction of 160. Users in the United States who don't have an unlimited messaging package pay cents per message.

Therefore, in Notifications through Push: It's possible that you mistakenly believe that the thing that's flashing on your cell phone's screen is a text message. Similar to SMS messages, push notifications are pop-up windows that appear while you're using your phone or on the lock screen rather than in your inbox with other texts.

Learn more about Mobile Messaging from

https://brainly.com/question/27534262
#SPJ1

4.what the economic and ideological causes of the American, the French, and the Chinese Revolutions, and to see the larger historical contexts in which these events took place?

Answers

The economic and ideological causes of the American, French, and Chinese revolutions were the imposition of taxes, poor economic policies, and increasing imperialist demand, respectively.

The economic and ideological causes behind the American revolution:

The imposition of taxes on the colonies, which they refused to pay. The primary goal of levying a tax was to recoup the debt incurred by the colonists as a result of the war. The corrupt ideology drove this revolution.

The French revolutions' economic and ideological causes:

Poor economic policies that resulted in bankruptcies and the extravagant spending of France's royals resulted in the imposition of high taxes on the people. The Enlightenment, influenced by the British political system, was the ideological cause.

The economic and ideological causes of the Chinese revolution:

The major reasons for the revolution were increasing imperialist demand from the West and Japan, as well as the desire to see a unified China.

To know more about the American Revolution, visit: https://brainly.com/question/18317211

#SPJ1

Write Java statements to declare an array that will store the total car sales values (int) for each month of the year

Answers

The Java statements to declare an array that will store the total car sales values (int) for each month of the year is given below:

The Statement

int[] months = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};

This given program gives each value for each month of the year and gives them a number from 1 to 12 which signifies the 12 months of the year:

January, February, March, April, May, June, July, August, September, August, October, November, and December.

Hence, for each sale made, it is computed and the total for each month is printed, along with each individual month and listed out as output.

Read more about java programming here:

https://brainly.com/question/18554491
#SPJ1

Which of the following is not used as an Internet security indicator?
A) shield icon
B) handshake icon
C) lock symbol
D) heart symbol

Answers

Internet security is not indicated by the shield icon.

What does "Internet security" mean?

A key element of cybersecurity is online security, which includes controlling risks and dangers posed by the Internet, online browsers, web apps, websites, and networks. Protecting consumers & corporate IT assets against online threats is the main objective of Online security systems.

What are the many methods of Internet security?

Access control, antivirus, security testing, network analytics, various forms of network-related safety (endpoint, online, wireless), firewalls, VPN encryption, and more are all included in network security.

To know more about Internet security visit:

https://brainly.com/question/27730901

#SPJ4

Answer:

it is A.

Explanation:

which search algorithm uses three variables to mark positions within the array as it searches for the searchvalue?

Answers

A binary search algorithm that uses three variables to mark positions within the array as it searches for the searchvalue.

What is a binary search?

In Computer technology, a binary search simply refers to an efficient algorithm that is designed and developed for searching an element (information) from a sorted list of data that are stored on a database, especially by using the run-time complexity of Ο(logn)

Note: n is the total number of elements in a list.

Additionally, keywords and search operators are important variables (elements) that have a significant effect on search results. Therefore, searchvalue is a binary search algorithm that is designed and developed to make use of three (3) variables to mark positions within an array as it perform a searche operation.

Read more on binary search here: https://brainly.com/question/17180912

#SPJ1

1. Write down a brief history about the internet.

Answers

Answer:

The Internet was developed by Bob Kahn and Vint Cerf in the 1970s. They began the design of what we today know as the 'internet. ' It was the result of another research experiment which was called ARPANET, which stands for Advanced Research Projects Agency Network.

Explanation:

Explain the following :Union within structure union

Answers

Answer:

union with union structure

Explanation:

SHOW ALL YOUR WORK. REMEMBER THAT PROGRAM SEGMENTS ARE TO BE WRITTEN IN
JAVA.
• Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
• Unless otherwise noted in the question, assume that parameters in method calls are not null and that methods are called only when their preconditions are satisfied.
• In writing solutions for each question, you may use any of the accessible methods that are listed in classes defined in that question. Writing significant amounts of code that can be replaced by a call to one of these methods will not receive full credit.
A manufacturer wants to keep track of the average of the ratings that have been submitted for an item using a running average. The algorithm for calculating a running average differs from the standard algorithm for calculating an average, as described in part (a).
A partial declaration of the RunningAverage class is shown below. You will write two methods of the RunningAverage class.
*
public class RunningAverage
{
}
/** The number of ratings included in the running average. private int count;
/** The average of the ratings that have been entered. */ private double average;
// There are no other instance variables.
/** Creates a RunningAverage object.
* Postcondition: count is initialized to 0 and average is
* initialized to 0.0.
*/
public RunningAverage()
{ /* implementation not shown */ }
/** Updates the running average to reflect the entry of a new
* rating, as described in part (a).
*/
public void updateAverage (double newVal)
{ /* to be implemented in part (a) */ }
/** Processes num new ratings by considering them for inclusion
* in the running average and updating the running average as
necessary. Returns an integer that represents the number of
*
* invalid ratings, as described in part (b).
* Precondition: num > 0
*/
public int processNewRatings (int num)
{ /* to be implemented in part (b) */ }
/** Returns a single numeric rating.
public double getNewRating()
{ /* implementation not shown */ }
(a) Write the method updateAverage, which updates the RunningAverage object to include a new rating. To update a running average, add the new rating to a calculated total, which is the number of ratings times the current running average. Divide the new total by the incremented count to obtain the new running
average.
For example, if there are 4 ratings with a current running average of 3.5, the calculated total is 4 times 3.5, or 14.0. When a fifth rating with a value of 6.0 is included, the new total becomes 20.0. The new running average is 20.0 divided by 5, or 4.0.
Complete method updateAverage.
/** Updates the running average to reflect the entry of a new
* rating, as described in part (a).
*/
public void updateAverage (double newVal)
(b) Write the processNewRatings method, which considers num new ratings for inclusion in the running average. A helper method, getNewRating, which returns a single rating, has been provided for you.
The running average must only be updated with ratings that are greater than or equal to zero. Ratings that are less than 0 are considered invalid and are not included in the running average.
The processNewRatings method returns the number of invalid ratings. See the table below for three examples of how calls to process NewRatings should work.
Statement
Ratings
processNewRatings
Generated
Return Value
processNewRatings (2)

2.5, 4.5
processNewRatings (1)
-2.0
1
0.0,
-2.2,
processNewRatings (4)
2
3.5, -1.5
Comments
Both new ratings are included
in the running average.
No new ratings are included in the running average.
Two new ratings (0.0 and 3.5) are included in the running
average.
Complete method processNewRatings. Assume that updateAverage works as specified, regardless of what you wrote in part (a). You must use getNewRating and updateAverage appropriately to receive full
credit.
/** Processes num new ratings by considering them for inclusion
* in the running average and updating the running average as
*
necessary. Returns an integer that represents the number of
* invalid ratings, as described in part (b).
* Precondition: num > 0
*/
public int processNewRatings (int num)

Answers

It’s g zzzzzzzzzzzzzzzzzzzzzzzz

how does virtual memory different from main memory and secondary memory​

Answers

A secondary memory device is comparable to a spinning magnetic disk or, in modern times, an SSD. Basically, it moves slowly (even an SSD is slow compared to the main memory). Data is stored there as files.

A software can fool itself into believing it has a collection of linear address blocks that it can use as ordinary memory by creating the illusion of virtual memory.

Except in cases where the total quantity of virtual memory needed by all running processes exceeds the physical memory attached to the computer, it has nothing to do with the idea of secondary storage. In that instance, relatively unoccupied pages will be transferred to secondary storage; nevertheless, this is more of a "side effect" of secondary storage's handy proximity and size compared to main memory.

Learn more about memory at:

https://brainly.com/question/13147674

What is the method for combining permissions from different database objects?
Group of answer choices

1. database level

2. role

3. user

Answers

Database level is the method for combining permissions from different database objects.

What is database?The types of access given to particular secureables are called permissions. Permissions are given to SQL Server logins and server roles at the server level. They are assigned to database users and database roles at the database level.The three sorts of permissions that files and directories can have are read, write, and execute: A file's or directory's contents can be viewed by someone having read permission. The contents of a file can be changed by someone with write rights, including by adding, removing, or modifying file contents.The right or permission to access a named object in the recommended way, such a table access authorization. A specific user's connection to the database may be permitted by privileges.

To learn more about database refer to:

https://brainly.com/question/518894

#SPJ1

Database level is the method for combining permissions from different database objects.

What is database?Permissions are the many sorts of access that are granted to specific secureables. At the server level, permissions are assigned to SQL Server logins and server roles. At the database level, they are assigned to database users and database roles.Read, write, and execute are the three types of permissions that files and directories can have. Anyone with read permission can view the contents of a file or directory. Anyone with write access can edit, add, or remove data from a file, among other file-related operations.the capability or authorization to make a recommended access to a named object, like a table access authorization. Privileges may allow a specific user's connection to the database.

To learn more about database refer to:

brainly.com/question/518894

#SPJ1

Someone gives me the idea to increase this title for my thesis MULTI PURPOSE COOPERATIVE AUTOMATED LENDING MANAGEMENT SYSTEM.

Answers

The way to increase this title for the thesis the negative influence of MULTI PURPOSE COOPERATIVE AUTOMATED LENDING MANAGEMENT SYSTEM in an economy.

What does a research thesis entail?

It is a position or assertion that you will support with research. A compelling thesis statement outlines the subject to be covered, condenses the key points, and persuades the reader to keep reading.

Therefore, The major topics that will be discussed in the essay should be summarized in the thesis. Many thesis statements hint at what will be discussed in the essay in addition to stating the argument to be made.

Learn more about thesis forming from

https://brainly.com/question/876674
#SPJ1

Write a loop that continually asks the user what pets the user has until the user enters stop, in which case the loop ends. It should acknowledge the user in the following format. For the first pet, it should say You have one cat. Total # of Pets: 1 if they enter cat, and so on.


Sample Run


What pet do you have? lemur
What pet do you have? parrot
What pet do you have? cat
What pet do you have? stop

Sample Output

What pet do you have? lemur
You have one lemur. Total # of Pets: 1
What pet do you have? parrot
You have one parrot. Total # of Pets: 2
What pet do you have? cat
You have one cat. Total # of Pets: 3
What pet do you have? stop

Answers

Answer:

#include <iostream>

using namespace std;

int main() {

/*

What pet do you have? lemur

parrot

What pet do you have? cat

What pet do you have? stop

*/

string pet;

int num=1;

while (pet!="stop"){

cin>>pet;

cout<<"What pet do you have?";

if (pet!="stop"){

cout<<"you have one "<< pet<<" total numof # is "<<num++<<endl;

}

else{

cout<<"stop";

}

}

}

Explanation:

you did not specify the language so i went with c++

i used while loop which will keep asking the user for an input until he/she write stop in order to break the loop

first i declared the data type of the input

used it as a conditionin the while loop

then printed the input everytime the loop runs

What should be entered to make the loop below print

55

60

65

x = 50

while (x < 65):

x = x + ____

print (x)

Answers

What should be entered to make the loop below print the output 55, 60, 65 is "5". Hence the complete code is:

x = 50

while (x < 65):

x = x + 5

print (x)

What is a loop in coding?

A loop is a set of instructions in computer programming that is repeatedly repeated until a given condition is met. Typically, a process is performed, such as retrieving and modifying data, and then a condition is verified, such as whether a counter has reached a predetermined number.

Loops are control structures that are used to repeat a segment of code a certain number of times or until a specific condition is fulfilled.

Learn more about loop:
https://brainly.com/question/14390367
#SPJ1

(blank) affects the ability to query a database.

a. i/o performance
b. schema
c. Backup

Answers

Answer:

performance

Explanation:

Consider this program on the picture attached:

(a) In what programming language is this program implemented?
(b) Why is this program correct? In other words, how does it work?
(c) In what way is the program poorly designed?

Answers

Answer:

a) Javascript

b) The program works because it iterates through an array and logs each array element into the console

c) It is poorly designed because depending on the array element value, the program will have to wait that many milliseconds before it logs and move on to the next element. This isn't good because the program may take a long time to execute if the array contains elements with large values.

Looking for similarities between concepts or problems is referred to as
an algorithm
Odecomposition
pattern recognition
abstraction

Answers

Pattern recognition is used  for similarities between concepts or problems in an algorithm.

What is meant by pattern recognition?

Pattern recognition is a data analysis method that uses machine learning algorithms to automatically recognize patterns and regularities in data. This data can be anything from text and images to sounds or other definable qualities. Pattern recognition systems can recognize familiar patterns quickly and accurately.

An example of pattern recognition is classification, which attempts to assign each input value to one of a given set of classes (for example, determine whether a given email is "spam" or "non-spam").

Therefore, Pattern recognition is used.

To know more about Pattern recognition from the given link

https://brainly.com/question/28427592

#SPJ1

with aid of two examples, describe the use of merging of docments

Answers

Answer:

Answer down below

Explanation:

Q's Asked: With the aid of two examples, describe the use of merging of documents.

------------------------------------------------------------------------------------------------------------

Explanation of "merging documents":

What is the use of merging of documents?

Well merging documents is really only used for organization or systems where documents/ data are changed by different users or systems.

Anyway The requirements for "mail merging" is :

(a) Main Document,

(b) Data Source,

(c) Merge Document.

: Meaning of A horizontal merger: A horizontal merger is when competing companies merge—companies that sell the same products or services.

: Meaning of A vertical merger: A vertical merger is a merger of companies with different products. :3

Welp anyway back to the Q's: With the aid of two examples, describe the use of merging of documents.Umm some people that use "merging of documents", are horizontal mergers which increase market share, such as Umm... T-moblie and sprit bc they are both a phone company. vertical mergers which exploit existing synergies.  So like ummm.... a sports drink company and a car company combining together. hope this helps ~~Wdfads~~~
Other Questions
what is the relationship between the s-cis and s-trans forms of 1,3-butadiene? multiple choice constitutional isomers different conformations of the same compound diastereomers resonance forms Quadrilateral TEAM is rotated-180 about the origin.Draw the image of this rotation. If A = (1 , 4) and B = ( 7 , 6), then coordinates of the midpoint of AB are What is the oxidation number of an element on january 1, year 1, zeta corporation issues $100,000 of 8% bonds maturing in 10 years, when the market rate of interest is 9%. market interest rates drop to 7% by december 31, year 1. the company retires the bonds on december 31, year 1 by paying $106,595. the carrying value of the bonds as of this date is $93,920. the journal entry for retirement of the bonds will include a: The school art club at a large high school is in charge of designing school T-shirts and getting them printed this year. A local business charges $35 to set up their T-shirt printing machine with the design and $4.25 in materials per T-shirt to print.1). Create an equation to represent the average cost C(x), in dollars, per T-shirt if x T-shirts are printed by this business.2). what is the average cost per shirt to print 25 shirts? 100 shirts?3). what is the cheapest the average cost per T-shirt will get? Explain or show your reasoning. Part CWhy does Congress want the FDA to regulate UVA labeling as well? Which group of people would be considered public service workers?(1 point)O elected officialsO military personnelO health inspectorsO judges Climate activists in europe again threw food at fine art in protest of fossil fuels. What was splattered on glass protecting a monet painting?. Hannah swims in a swimming pool of 25 metres long.How many laps does she need to complete for a total distance of 0.5 kilometre? Determine the quadratic function of the form f(x)= a(x - h) + k whose graph is given on theright. Look at the figure above. From which winds do most tropical storms start?Question options:A) WesterliesB) Polar easterliesC) Tropical storms form from each type of wind equally. (wrong)D) Trade Explain how the equations 2/3m=-4 and -4m=24 are equivalent? 1. Why does Adle tell Robert to leave Edna alone? Why is he annoyed by this?2. Do you think that Robert is being too friendly with Edna?3. Alcee Arobin is introduced as a character. Why? How does he contribute to the story?4. Where is Vera Cruz? What is its significance?(Kate Chopin; The awakening; Chapter 8) which of the following occurs in participant observation? a.) the researcher deliberately manipulates social customs and mores to record people's behaviors. b.) the researcher conducts an in-depth analysis of a particular person or event. c.) the researcher provides a list of questions that need to be answered by the people being studied. d.) the researcher joins in with the activities of the group of people being studied. how could a government reduce inflationary pressures within an economy? select all that apply: increase taxes reduce taxes increase government spending reduce government spending Find the slope of the line that contains the points named.P(1, 2), Q(3, 4)0-10102 Solve the inequality.3-x-19 or -x 24x> [?] or x x[Enter what would happen to a mammalian heart if the nerves leading to it were severed? the heart muscle would stop contracting. only the atria would be able to contract. the heart muscle would contract randomly. systolic contraction would still occur, but diastolic relaxation could not occur. the heart muscle would continue to contract but its contraction rate may change. what is the haudenosaunee confederacy? group of answer choices a group of native american tribes from the southeast of the united states and the mid-atlantic region a group of native american tribes from the southwestern united states and northern mexico a group of native american tribes from the northeastern united states and the southeastern canada a group of native american tribes from all over the east coast of the united states