supppose we already have a list called words, containing all the words(i.e., string).Write code that produce a sorted list with all duplicate words removed. For example, if words ==['hello', 'mother','hello','father','here','i','am','hello'], your code would produce the list ['am','father','hello','here','i','mother'].

Answers

Answer 1

Answer:

I will code in Javascript.

//define and initialize both arrays.

var words = ['hello', 'mother','hello','father','here','i','am','hello'];

var sortedList = [];

 

 for ( var i = 0;  i < words.length ; i++ ){  //loop used to go throght the words

   var duplicated = false;  // boolean used for detect duplicates

   for ( var j = i + 1;  j < words.length ; j++ ) {  //loop used to compare with other words

     if( words[i] == words[j] ) {  //if the word is duplicated, duplicated becomes true.

       duplicated = true;

       break;

     }

   }

   if (! duplicated) {  //if at the end of the loop of each word duplicated is false, then the element is pushed into sortedList.

     sortedList.push(words[i]);    

   }

 }

 sortedList.sort(); //when the loop is finished, use the Javascript method to sort an array.


Related Questions

. Use one command to create a /sales directory with the permissions of 770

Answers

Answer:

mkdir -m 770 sales

Explanation:

The command mkdir is used to create a directory and the attribute or flag

-m is used to  assign permissions on create a folder.

Example:

mkdir -m 770 sales

Create a folder with permissions 770 with name sales

. Within data mining, what it it’s robustness?

Answers

Answer:

Data mining is the extraction/mining of the required/ actual data from the raw data .Rest of the data that is not required is eliminated in this process.It is used in the many field such as research, scientific, etc.

Robustness in the data mining field is for defining the strong nature of the data .This feature is responsible for stability of the data even at the occurrence of the error.The resistance shown by the data towards the problem makes the data robust .

Write a function called reverse() with this prototype:

void reverse(char dest[], char source[], int size);

Your function should copy all the elementsin the array source into the array dest, except in reverse order. The number of elements in the source array is give in the parameter size. Use a for loop to do the copying. Assume that dest is large enough to hold all of the elements. Please be thorough with commenting.

Answers

Answer:

void reverse(char dest[], char source[], int size)

{

   for(int i=0;i<size;i++)//using for loop.

   {

       dest[i]=source[i];//assigning each element of source array to dest array.

   }

   int s=0,e=size-1;//initializing two elements s with 0 and e with size -1.

   while(s<e){

       char t=des[s];             //SWAPPING

       dest[s]=dest[e];            //SWAPPING

       dest[e]=t;                  //SWAPPING

       s++;

       e--;

   }

}

Explanation:

I have used while loop to reverse the array.I have initialize two integer variables s and e with 0 and size-1.Looping until s becomes greater than e.

It will work as follows:

first s=0 and e=0.

dest[0] will be swapped with dest[size-1]

then s=1 and e=size-2.

then des[1] will be swapped with dest[size-2]

and it will keep on going till s is less than e.

Give two separate print statements: one will print your name, the other will print your major. Ensure that both will print on the same line to the screen

Answers

Answer:

// here is code in java.

// import package

import java.util.*;

// class definition

class Main

{

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

      // print the name

       System.out.print("my name is Sam. ");

       // print the major

       System.out.print("my major is CS.");

   }catch(Exception ex){

       return;}

}

}

Explanation:

In java, System.out.print() will print the statement but didn't go to the next line.If there is another System.out.print(), then it will also print into the same line.So here first the System.out.print() will print the name and second will print the major in the same line.

Output:

my name is Sam. my major is CS.

What is pros and cons of Cleanroom Software Engineering Process?

Answers

Answer and Explanation:

Pros of cleanroom software

This helps in confirming the plan detail with the assistance of mathematically based evidence of rightness.This uses incremental development processes.This uses incremental development processes. The realistic expectation is considered as less than 5 failures per KLOC on the first program execution in the project.There are short advancement cycles and longer item life.

Cons of cleanroom software

This exceptionally relies upon the statistical utilization of testing for revealing the high impact mistakes.The software is also not compiled or executed during the verification process hence it would become difficult to find the errors.

While the concept of ____ has well served scientists who share scientific text files and application developers who exchange code, the greater use has been in downloading artistic files, such as music and video files.

VPNs

LANs

point-to-point file protocol

peer-to-peer (P2P) file sharing

Answers

Answer: peer-to-peer (P2P) file sharing

Explanation: Peer-to-peer file sharing is the technique in which networking technology is used for the sharing and distribution of the files digitally. The sharing of the files are in the form of movies, games music etc.

Peer are considered as the nodes which are the end-user so, the end-user to end-user file transfer is done through this technology.

Other options are incorrect because VPN(virtual private network) is the connection between network and client over less secure network,LAN (Local area network) is the network that can be established for single infrastructure to connect  and point to point protocol is protocol for the routers for communication.Thus the correct option is P2P file sharing.

What is the association rule of data mining?

Answers

Answer:

Association rules are usually referred as the if-then statements which help in order to show probability of association and relationships in between data items that are embedded within large data sets in several kinds of databases. Association rule mining also tends to have a several number of applications and thus is widely used in order to uncover sales relation in transactional data.

how to import any csv from internet in phyton 3 and R ?

Answers

Answer:

Jgthj

Explanation:

T to it t urd864rb. I5f. 8rfb 75gj

Writе thе dеclaration of a doublе pointеr namеd avеragе

Answers

Answer:

double *average; //  declaration of a doublе pointеr .

Explanation:

A pointer is a variable that will store the address of another variable of the same datatype. Here average is a pointer type variable that means it will store the address of double datatype variable.  

syntax of declaring double datatype variable  

double *variable_name  ;

double *average;  

For example:

double *average;

//declaration of a doublе pointеr

double r=90.897;

// variable r of double datatype

average=&r;// storing the address of r

What does it mean to 'instantiate' an object?

Answers

Explanation:

Instantiate an object means creating an instance of accessing the property of a class we can create instance or object for that class. The property of class means method and variable with the help of instance we can directly access the method and variable.

For example  

class abc // class abc

{

public:

void sum1() // function definition

{

cout<<" hello "; // display hello

}

};

void main() // main method  

{

abc ob; //  creating an instance  

ob.sum1(); // calling a function sum1  

}

Output:

hello

Here we create a instance of class abc i.e ob which can access the method sum1().

Does Kennesaw State University have any computing ethical policy for computer usage? If so - what is it?

Answers

Answer:

The answer to the questions: Does Kennesaw State University have any computing ethical policy for computer usage? If so - what is it? Would be as follows:

1. Yes, Kennesaw State University, a university in Georgia, does have a computing ethical policy that regulates the proper use of the facilities and computing services within the facilities of the university and the use of computing equipment that belongs to the university. This policy is known as the KSU Computer Usage Policy.

2. As said before this policy establishes that the use of computing services are not the right of a person, but rather a privilege afforded to the students, faculty and other people who are present in the university and who may need to use its computing services. The use of the computing services would be whitin this policy as long as it stays inside the delimitations established by federal, state and University policies.

Explanation:

_________ is used in planning situations that involve much uncertainty, like that of IT in general and e-commerce in particular.
a. Key performance indicators (KPIs)
b. Scenario planning
c. Critical success factors (CSFs)
d. Balanced scorecard

Answers

Answer:b)Scenario planning

Explanation: Scenario planning is the strategy that is made for the generation of long term plan in an organization. It is also known as the scenario analysis . This is flexible technique in which helps the well structured and well managed future of organizations.

This tool considers the uncertainty and uncontrollable events that might happen in future and thus , these situation are analysed and acknowledged.

Other options are incorrect because Key performance indicator are for providing the key factor about the performance of organization, critical success factor are for achieving positive outcome and balanced scorecard is type of management plan framework.Thus the correct option is option(b).

Which one is the fastest? (Points : 4) TTL
CMOS
ECL
They are the same

Answers

Answer: ECL

Explanation:

  ECL is basically stand for the emitter coupled logic and it is the high speed integrated logic circuit. In this ECL logic circuit, the transistor does not enter in the saturation mode.

In the emitter coupled logic, the output resistance are low and the input emitter impedance are high so, the state of the transistor are get changes quickly. Hence, it is fastest device as compared to all other options.

Therefore, ECL is the correct option.

Write a program that will ask the user to enter personal information and then will display it back to the user.

First, the program will ask the user to enter name. Then it will ask the user to enter address. Then it will ask the user to enter phone number. Then it will ask the user to enter email. At the end, it will display the user

Answers

Final answer:

A simple Python program prompts the user to enter personal information such as name, address, phone number, and email, then displays it back. It's essential to handle personal data responsibly and to check privacy policies in real applications.

Explanation:

The question is asking for a simple program that collects and displays personal information. Here is an example of how such a program can be written in Python:

# Ask for personal information
name = input('Please enter your name: ')
address = input('Please enter your address: ')
phone_number = input('Please enter your phone number: ')
email = input('Please enter your email: ')

# Display the information back to the user
print('\nHere is the information you entered:')
print('Name:', name)
print('Address:', address)
print('Phone Number:', phone_number)
print('Email:', email)

This program will prompt the user to enter their name, address, phone number, and email. It will then display this information back to the user. Remember to handle personal information responsibly and refer to privacy policies when handling such data in real applications.

Which of the following is NOT a good idea to do after you change the root password?
(a) Restart the MySQL Service.
(b) Write down the new password in a safe place.
(c) Keep the change password file on the server in case you need to change the password again.

Answers

Answer:

C) Keep the change password file on the server in case you need to change the password again

Which of the following statements is/are true? (Points : 5) A. A default constructor is automatically created for you if you do not define one.
B. A static method of a class can access non-static members of the class directly.
C. An important consideration when designing a class is identifying the audience, or users, of the class.
None of the above
Only A and C

Answers

Answer: Only A and C

Explanation: Default constructor is a constructor that has parameters with the values that are default or has no arguments/parameter present. Default constructor is not declared in the class rather it gets generated by itself when not defined.

Class is defined with data members, functions, objects etc are considered as per the requirement given by the user .It is the user defined concept.

Statement (B) is incorrect because static method is used for accessing the static members of the particular class and manipulate the value of it.

Thus, only statement (A) and (C) are correct.

The parameters needed for a MySQL database connect string are

a

host name

b

user name

c

password

d

All of the above

Answers

Answer:

d. All of the above.

Explanation:

The parameters required to for a MYSQL database connect string are as following:-

Host Name.User Name.Password.New link.Client flags.

So  among  the  given  options all of them  are  required  and  those are host name,user name,password.

Hence the answer to this question is option d all of the above.

To edit a form, use

datasheet view.
design view.
layout view.
layout view or design view.

Answers

Answer: Design view

Explanation:

 We use design view for editing and modifying the forms. The design view is basically used to create the form and then also edit the form structure. It is also capable for reducing the scope in the particular structure.

In the design view, we can use the property sheet for modifying the properties in the form and also control its features in the particular section of the form structure.

It basically provide the wide variety of comprehensive form structure and it basically helped to organize the proper information in the form.  

Answer: layout view

Explanation; on edge

____ coordinates activities related to the Internet’s naming system, such as IP address allocation and domain name management. National Center for Supercomputing Applications (NCSA) Web Consortium (W3C) ICANN (Internet Corporation for Assigned Names and Numbers) Internet Society (ISOC)

Answers

Answer: ICANN (Internet Corporation for Assigned Names and Numbers)

Explanation: ICANN (Internet Corporation for Assigned Names and Numbers) is the a US base government organization which runs on the non-profit scheme. The function of the ICANN is to maintain stability of internet operation and function,process based on consensus ,managing the domain name, naming internet components etc.

Other options are incorrect because National Center for Supercomputing Applications (NCSA) is for supporting and providing powerful computer, Web Consortium (W3C) is for development of standard of web and Internet Society (ISOC) works for internet based standard for development.

"What does the list look like after this code executes?

colors = "red,orange,yellow,green,blue"
s = colors.split(",")

["red", "orange", ""yellow", "green", "blue"]

["red orange yellow green blue"]

[red,orange,yellow,green,blue]

red

Answers

Answer:

The list created by the split method in Python 3 will be ["red", "orange", ""yellow", "green", "blue"]

Explanation:

In Python 3, the split method takes the input string, in this case is colors = "red,orange,yellow,green,blue", and split it into a list and you can indicate the separator that the method will use.

The general syntax for this method is:

string.split(separator,max)

separator indicates the character that will be used as a delimiter of each list member and the max parameter indicates the maximum number of separations to make.  

Since each color in your string is separated by the character "," the code will make a list in which every color is a separated string.

What is TCP/IP's Transport layer's primary duty?

Answers

Answer:

 The TCP/IP is the transmission control protocol and internet protocol and in the TCP/IP model the transport layer is the second layer.

The primary responsibility of this layer is that it is basically used to deliver messages to the host and that is why it is known as end to end layer.

It basically provide the point to point connection between the destination to server host for delivering the various types of the services efficiently and reliably.

In the TCP/IP model the transport layer are basically responsible for transferring the data or service error free between the server to destination host.

Explain what occurs when you synchronize computer and mobile devices.

Answers

Answer: The synchronization of the mobile and computer devices is termed as the merging of the information of the device with the other computer device.Synchronization action takes through the "sync" command .

The synchronization helps in updating the information or data that is present in both the devices .It also sends and receive the files and information from reach other through transferring activity.The act helps in keeping the same updated information in both the system.

What is ‘verification’?

Answers

Answer: Verification in the terms of the computer field is defined as the process which is for testing of the consistency and the accuracy of the information, algorithm, data, etc. Verification is carried out by the approval or disapproval method after the checking process.

This techniques helps in verifying whether the function,algorithm ,data that has been accessed in the system is complete and precise or not so that it can properly function in the operating system.

What is an operating system? What are the main functions of a modern general purpose operating system?

Answers

Answer:

An operating system is a software that allows a user to run other applications on a computing device. The applications generally are not designed to interface directly with hardware, almost all of the applications are written to run on an operating system, in order to become independent of the hardware design.

The main function of an operating system are:

manage the hardware resources of a computer: central processing unit, memory, disk drives, and printers. establish a user interface to facilitate the interaction human-computer. execute and provide services for software applications.

From an IT perspective, which of the following best describes BI and BI apps?
a. Stand-alone
b. Support a specific objective
c. A collection of ISs and technologies
d. Web-based systems designed for for-profits

Answers

Answer:a)Stand-alone

Explanation: Stand-alone application is the application that is found on the system of every client.In accordance with the IT section, Business intelligence can be transferred into stand-alone application .This helps in the development of the essence of the system at an independent level.

Other options are incorrect because supporting a certain factor will not make it independent, cannot act as the group of ISs technology or web system for gaining profit.Thus,the correct option is option(a).

A use case model describes what a system does without describing how the system does it. (Points : 1.5) True
False

Answers

Answer:

The correct answer is true.

Explanation:

By definition, a use case is a list of events that defines the interactions between an actor and a system to achieve a goal. Generally, Use cases are used by functional analysts at a higher level to represent requirements, missions or stakeholder goals.  

In a typical configuration the total RAM capacity is less than total ROM capacity.

True

False

Answers

Answer:

False

Explanation:

The difference between RAM and RAM is as follows

(1) RAM (random access memory) is meant for temporary storage whereas ROM (read-only memory) is meant for permanent storage.

(2) RAM chip is volatile, means once the power is turned off, it loses the previously holding information, where as ROM is non-volatile it doesn't losses any information even though power is turned off.

(3) RAM chip is used in the normal operations of the computer, whereas the ROM chip is used mainly for the startup process of computer.

(4) Generally, A RAM can store several gigabytes (GB) of data that is up to 16 GB whereas a ROM chip can typically store that much data. It only stores several megabytes (MB) of data that is up to 4 MB.

hence, the given statement about RAM is false.

According to the loyalty effect, a five percent reduction in customer attrition can improve profits by as much as __________ percent.
a. 5
b. 10
c. 15
d. 20

Answers

Answer:

d.20

Explanation:

A reduction of five percent  in customer attrition can improve improve the profits of the company by as much as 20 percent.This is according to loyalty effect.

The Loyalty Effect is a book written  by Fredrick Reichheld it is based on customer retention.It is one of the best books on customer retention.

Another ball dropped from a tower A ball is again dropped from a tower of height h with initial velocity zero. Write a program that asks the user to enter the height in meters of the tower and then calculates and prints the time the ball takes until it hits the ground, ignoring air resistance. Use your program to calculate the time for a ball dropped from a 100 m high tower

Answers

Answer:

// here is code in C++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

   // variable

   double height;

   // gravitational acceleration

   double g=9.8;

   cout<<"Please enter initial height:";

   cin>>height;

   // h=ut+(gt^2)/2

   // here u, initial velocity is 0

   // after simplification

   double t=sqrt(2*height/g);

   // print the time

   cout<<"time taken by ball to hit the ground is:"<<t<<" seconds"<<endl;

   

return 0;

}

Explanation:

Read the initial height from user. Declare and initialize the earth gravitational acceleration "g=9.8" .Then the equation is h=ut+(gt^2)/2, here u is initial velocity which is 0.Then after simplify the equation t=sqrt(2*h/g). Put the values in the  equation and find the time taken by ball to hit the ground.

Output:

Please enter initial height:100

time taken by ball to hit the ground is:4.51754 seconds

Final answer:

A Python program calculates the time a ball takes to reach the ground when dropped from a given height, illustrating basic principles of free fall in physics. For a 100 m tower, the time is approximately 4.51 seconds.

Explanation:

A student has asked to write a program that computes the time it takes for a ball to hit the ground when dropped from a tower of height h meters, assuming no air resistance. The formula to calculate the time t is derived from physics: t = √(2h/g), where g is the acceleration due to gravity, approximately 9.81 m/s². Using this formula, we candevelop a program in Python to ask the user for the height h and then compute and print the time t. To demonstrate, if the program is used with a tower height of 100 meters, the calculated time for the ball to reach the ground would be approximately 4.51 seconds.

Example Python Program

import math

def drop_time_from_height(height):
   g = 9.81  # Gravity in m/s²
   time = math.sqrt(2 * height / g)
   return time

height = float(input("Enter the height of the tower in meters: "))
time = drop_time_from_height(height)
print("The ball takes", round(time, 2), "seconds to hit the ground.")

This program illustrates a straightforward approach to solving problems related to free fall and physics calculations, enhancing the understanding of concepts such as gravity and acceleration.

A __________ is an information system that produces all kind of reports and interprets information so it can be used by concerned people to make decisions.

DSS (Decision Support System)
MIS (Management Information system
EIS (Expert Information System)
TPS (Transaction Processing System)
2400

Answers

Answer: Decision support system (DSS)

Explanation:

 Decision support system is the process in which the information model basically support the managers in the process of the decision making.

It is an information system and produces various reports and also interprets the data and information so that it help to make decisions.

The decision support system (DSS) is basically carried out by the management by reviewing all kinds of the report and then generate necessary data or information.

On the other hand, all the other options are incorrect as they are not related to the decision making process. Therefore, DSS is the correct option.

Other Questions
If Tim's top priority is to become famous, his most likely long-term goal is tobecome a(n). A molecule of hydrogen moves at a speed of 115 cm/s. How long will it take to travel the length of a football field (100 yd long)? Which are acceptable reasons for studying history?Select all correct answers.A It shows us what it means to be human.B It promotes a single culture for the world. C It shows that our civilization is better than others.D It makes us better thinkers The legislators of New State institute a law that mothers of children in elementary school, but not fathers, are entitled to seven days off each year in order to attend school events. A lawsuit is brought by a group of fathers challenging the law on equal protection grounds. Which level of scrutiny will be applied to the law?a. intermediate scrutinyb. rational basis scrutinyc. severe scrutinyd. strict scrutinye. legal scrutiny Gabby and Sydney bought some pens and penciled. Gabby bought 4 pens and 5 pencils for $6.71. Sydney bought 5 pens and 3 pencils for $7.12. Find the cost of each. What lands did Spain lose to the British for fighting with the French during the French and Indian War?A)all lands West of the Mississippi River, including FloridaB)all lands East of the Mississippi River, including FloridaC)all lands West of the Mississippi River, including LouisianaD)all lands East of the Mississippi River, including Louisiana when does the tricuspid valve open? What is the value of a stock that you believe will sell in three years for $67 a share and will pay $3.00 in dividends next year, and grow dividends at 4% in year 2, and 5% in year 3 assuming your required return is 15%? Discuss the differences between light and dark reactions of photosynthesis. Simon is factoring the polynomial. x24x12 (x6)(x+______) What value should Simon write on the line? 6 2 2 6 The following data apply to the provision of psychological testing services: Sales price per unit (1 unit = 1 test plus feedback to client) $ 320 Fixed costs (per month): Selling and administration 22,000 Production overhead (e.g., rent of testing facilities) 15,000 Variable costs (per test): Labor for oversight and feedback 160 Outsourced test analysis 21 Materials used in testing 6 Production overhead 8 Selling and administration (e.g., scheduling and billing) 10 Number of tests per month 2,000 tests Required: Calculate the amount for each of the following (one unit = one test) if the number of tests is 2,000 per month. Also calculate if the number of tests decreases to 1,250 per month. (Do not round intermediate calculations. Round your final answers to the nearest whole dollar.) The pH of blood depends on the [HCO3-/H2CO3] balance. ([H2CO3] is equal to the amount of dissolved CO2). Calculate the bicarbonate (HCO3-) : carbon dioxide ratio for a normal blood pH of 7.40. (the pKa1 of carbonic acid is 6.10 at 37oC, body temperature). (A) 20 : 1 (B) 1.3 :1 (C) 2 : 1 (D) 1 : 20 (E) 1 : 0.01 Tobiass closet has 1 red hat and 1 black hat; 1 white shirt, 1 black shirt, and 1 black-and-white-striped shirt; and 1 pair of black pants and 1 pair of blue pants. He is picking an outfit by reaching into his closet and randomly choosing a hat, a shirt, and a pair of pants. What is the probability he picks an outfit containing only black and/or white colors? Need help fast please!!!! Sven is trying to find the maximum amount of time he can spend practicing the five scales of piano music he is supposed to be working on. He has 60 minutes to practice piano and would like to spend at least 35 minutes playing songs instead of practicing scales. So, Sven sets up the following inequality, where t is the number of minutes he spends on each scale, and solves it. You are exploring a planet and drop a small rock from the edge of a cliff. In coordinates where the +y direction is downward and neglecting air resistance, the vertical displacement of an object released from rest is given by y y0 = 1 2 gplanett2, where gplanet is the acceleration due to gravity on the planet. You measure t in seconds for several values of y y0 in meters and plot your data with t2 on the vertical axis and y y0 on the horizontal axis. Your data is fit closely by a straight line that has slope 0.400 s2/m. Based on your data, what is the value of gplanet? An external entity may be: (1 point) (Points : 1.5) a person. another department. another computer system. All of the above. At the time of the Great East-West Schism, both the Pope and the Patriarch of Constantinople claimed the title Ecumenical Patriarch. The BEST synonym for ecumenical is A long arm statute allows one state's court to exercise jurisdiction over a defendant from another state who __________meets the legal requirement for with the state in which the court is located. which of the following describes a non-employee business?