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
Natali [406]
3 years ago
15

Assign True to the variable has_dups if the string s1 has any duplicate character (that is if any character appears more than on

ce) and False otherwise.
Computers and Technology
1 answer:
podryga [215]3 years ago
4 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   string s;

   cin>>s;    //reading string

   int i,j;

   bool has_dups=false;

   int n= s.length();

   for(i=0;i<n;i++)  //to check for duplicate characters

   {

       for(j=0;j<n;j++)

       {

           if(j!=i && s[i]==s[j])  //to check if it is matched with itself

           {

               has_dups=true;  //if true no need to check others

               break;

           }

       }

   }

   cout<<has_dups;

   return 0;

}

OUTPUT :

California

1

Explanation:

Above program finds if a character repeat itself in the string entered by user.

You might be interested in
When you boot up a computer and hear a single beep, but the screen is blank, what can you assume is the source of the problem?
olchik [2.2K]
Either your screen isnt plugged in and synced properly or you have a problem in the automatic boot system 
5 0
3 years ago
Read 2 more answers
What will be the value of x after the following code is executed? int x = 10; do { x *= 20; } while (x &lt; 5); A. 10 B. 200 C.
dezoksy [38]

Answer:

Option B is the correct answer.

Explanation:

  • In the above code, the loop will execute only one time because the loop condition is false and it is the Do-While loop and the property of the Do-while loop is to execute on a single time if the loop condition is false.
  • Then the statement "x*=20;" will execute one and gives the result 200 for x variable because this statement means "x=x*20".
  • SO the 200 is the answer for the X variable which is described above and it is stated from option B. Hence it is the correct option while the other is not because--
  1. Option A states that the value is 10 but the value is 200.
  2. Option C states that this is an infinite loop but the loop is executed one time.
  3. Option D states that the loop will not be executed but the loop is executed one time
6 0
3 years ago
Read 2 more answers
Problem Statement − Suppose the problem statement at hand is to contain the attrition that happens in companies worldwide. High
Tju [1.3M]

Answer:Analysis is derived from the Greek word ‘analusis’, which translates into ‘breaking up’ in English. Analysis is older than the times of great philosophers like Aristotle and Plato. As discussed in the previous section, analysis is the process of breaking down a big single entity into multiple fragments. It is a deduction where a bigger concept is broken down to smaller ones. This breaking down into smaller fragments is necessary for improved understanding.

So, how does analysis help in design thinking? During analysis, design thinkers are required to break down the problem statement into smaller parts and study each one of them separately. The different smaller components of the problem statement are to be solved one-by-one, if possible. Then, solutions are thought for each of the small problems. Brainstorming is done over each of the solutions.

Later, a feasibility check is done to include the feasible and viable solutions. The solutions that don’t stand firm on the grounds of feasibility and viability are excluded from the set of solutions to be considered.

Design thinkers are, then, encouraged to connect with the diverse ideas and examine the way each idea was composed. This process of breaking down the bigger problem statement at hand into multiple smaller problem statements and examining each as a separate entity is called analysis.

Reductionism

The underlying assumption in analysis is reductionism. Reductionism states that the reality around us can be reduced down to invisible parts. The embodiment of this principle is found in basic axioms of analytic geometry, which says “the whole is equal to the sum of its parts”. However, understanding of a system cannot be developed by analysis alone. Hence, synthesis is required following analysis.

Synthesis

Synthesis refers to the process of combining the fragmented parts into an aggregated whole. It is an activity that is done at the end of the scientific or creative inquiry. This process leads to creation of a coherent bigger entity, which is something new and fresh. How does synthesis come into picture in design thinking?

Once the design thinkers have excluded the non-feasible and non-viable solutions and have zeroed-in on the set of feasible and viable solutions, it is time for the thinkers to put together their solutions.

Out of 10 available solutions, around 2-3 solutions may need to be excluded since they may not fit into the larger picture, i.e. the actual solution. This is where synthesis helps.

The design thinkers start from a big entity called the problem statement and then end up with another bigger entity, i.e. the solution. The solution is completely different from the problem statement. During synthesis, it is ensured that the different ideas are in sync with each other and do not lead to conflicts.

Analysis + Synthesis = Design Thinking

Analysis and synthesis, thus, form the two fundamental tasks to be done in design thinking. Design thinking process starts with reductionism, where the problem statement is broken down into smaller fragments. Each fragment is brainstormed over by the team of thinkers, and the different smaller solutions are then put together to form a coherent final solution. Let us take a look at an example.

Analysis Synthesis

Case Study

Problem Statement − Suppose the problem statement at hand is to contain the attrition that happens in companies worldwide. High quality employees leave the organization, mainly after the appraisal cycle. As a result, an average company loses its valuable human resources and suffers from overhead of transferring the knowledge to a new employee. This takes time and additional human resource in the form of a trainer, which adds to the company’s costs. Devise a plan to contain attrition in the company.

Analysis − Now, let’s break down the problem statement into various constituent parts. Following are the subparts of the same problem statement, broken down to elementary levels.

The employees are not motivated anymore to work in the company.

Appraisal cycle has something to do with attrition.

Knowledge transfer is necessary for new employees.

Knowledge transfer adds to the cost of the company.

Synthesis − Now, let's start solving each problem individually. In this step, we will do synthesis. Let's look at one problem at a time and try to find a solution only for that problem statement, without thinking of other problem statements.

Explanation:

6 0
3 years ago
What two devices in a computer should be considered "black boxes," and should never be opened due to risks involving charged cap
NNADVOKAT [17]

The two devices in a computer that should be considered "black boxes," and should never be opened due to risks involving charged capacitors are MONITOR and POWER SUPPLY.

Explanation:

  • Physical contact or close proximity to the open power supply caused a discharge from the capacitor that resulted in an electric shock. Capacitors can discharge current even when not energized because they hold a charge for some time after the power is turned off.
  • To do harm to your body, the voltage across the capacitor's terminals must be high enough to cause a harmful effect on you. There are no hard rules for at what voltage things become harmful, but a common 'rule of thumb' is that DC up to 48 Volt is considered low voltage. So a capacitor charged to a voltage below 48 V is fairly safe.
  • A charged capacitor can be very dangerous, so it's important that you avoid coming into contact with the terminals at all times.
3 0
3 years ago
Attackers have recently launched several attacks against servers in your organization’s DMZ. You are tasked with identifying a s
kari74 [83]

Answer:

Option B is correct.

Explanation:

Well into the DMZ corporation of the user, intruders have currently conducted numerous attempts toward networks. He is associated with finding any response which would provide the greatest opportunity in the future to avoid such threats.  

The in-band IPS becomes the better approach for the required choices. Traffic moves via the IPS, as well as it has a better probability of avoiding inner processes through entering invasion.

4 0
3 years ago
Other questions:
  • Define and test a function myRange. This function should behave like Python’s standard range function, with the required and opt
    11·2 answers
  • Application partitioning gives developers the opportunity to write application code that can later be placed on either a client
    7·1 answer
  • Once the data center routes to the destination server that hosts the website, whats the next step in the internet process?
    10·1 answer
  • Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
    15·1 answer
  • Pick 2 different operating systems and discuss how they can be used in daily operations.
    5·1 answer
  • What was the original motivation for developing the internet?
    7·1 answer
  • What are two major techniques involved in green computing
    14·1 answer
  • Draw a dfd that shows how data will be stored, processed, and transformed in the tims system
    9·1 answer
  • Name two materials that we can burn in order to get energy from biomass
    9·1 answer
  • Where does Reiner take eren after they have a fight?
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!