Write an application that determines whether the first two files are located in the same folder as the third one. The program should prompt the user to provide 3 filepaths. If the files are in the same folder display All files are in the same folder, otherwise display Files are not in the same folder.

Answers

Answer 1

Answer:

The program in Python is as follows:

fname1 = input("Filepath 1: ").lower()

fname2 = input("Filepath 2: ").lower()

fname3 = input("Filepath 3: ").lower()

f1dir = ""; f2dir = ""; f3dir = ""

fnamesplit = fname1.split("/")

for i in range(len(fnamesplit)-1):

   f1dir+=fnamesplit[i]+"/"

fnamesplit = fname2.split("/")

for i in range(len(fnamesplit)-1):

   f2dir+=fnamesplit[i]+"/"

fnamesplit = fname3.split("/")

for i in range(len(fnamesplit)-1):

   f3dir+=fnamesplit[i]+"/"

if f1dir == f2dir == f3dir:

   print("Files are in the same folder")

else:

   print("Files are in the different folder")

Explanation:

The next three lines get the file path of the three files

fname1 = input("Filepath 1: ").lower()

fname2 = input("Filepath 2: ").lower()

fname3 = input("Filepath 3: ").lower()

This initializes the directory of the three files to an empty string

f1dir = ""; f2dir = ""; f3dir = ""

This splits file name 1 by "/"

fnamesplit = fname1.split("/")

This iteration gets the directory of file 1 (leaving out the file name)

for i in range(len(fnamesplit)-1):

   f1dir+=fnamesplit[i]+"/"

This splits file name 2 by "/"

fnamesplit = fname2.split("/")

This iteration gets the directory of file 2 (leaving out the file name)

for i in range(len(fnamesplit)-1):

   f2dir+=fnamesplit[i]+"/"

This splits file name 3 by "/"

fnamesplit = fname3.split("/")

This iteration gets the directory of file 3 (leaving out the file name)

for i in range(len(fnamesplit)-1):

   f3dir+=fnamesplit[i]+"/"

This checks if the file directories hold the same value

This is executed, if yes

if f1dir == f2dir == f3dir:

   print("Files are in the same folder")

This is executed, if otherwise

else:

   print("Files are in the different folder")


Related Questions

Software that enables the organization to centralize data is called A. Data Repository B. Data Base Management System C. Data Warehouse D. Data Mart E. Data File

Answers

Answer:

B. Data Base Management System

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to effectively and efficiently create, store, modify, retrieve, centralize and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

Generally, a database management system (DBMS) acts as an intermediary between the physical data files stored on a computer system and any software application or program.

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.

Hence, a software that enables the organization to centralize data, manage the data efficiently while providing authorized users a significant level of access to the stored data, is called a Data Base Management System (DBMS).

A shop will give discount of 10% if the cost of purchased quantity is more than 1000. Ask user for quantity suppose, one unit will cost 100. Judge and print total cost for user. Plz give answer in C++.

Answers

Answer:

The program in C++ is as follows:

#include <iostream>

using namespace std;

int main(){

   int qty;

   float discount = 0;

   cout<<"Quantity: ";

   cin>>qty;

   int cost = qty * 100;

[tex]i f (cost > 1000)[/tex] {        [tex]discount=cost * 0.10[/tex];        }

   cout<<"Cost: "<<cost - discount;

   return 0;

}

Explanation:

This declares the quantity as integer

   int qty;

This declares and initializes discount to 0

   float discount = 0;

This prompts the user for quantity

   cout<<"Quantity: ";

This gets input for quantity

   cin>>qty;

This calculates the cost

   int cost = qty * 100;

If cost is above 1000, a discount of 10% is calculated

[tex]i f (cost > 1000)[/tex] {        [tex]discount=cost * 0.10[/tex];        }

This prints the cost

   cout<<"Cost: "<<cost - discount;

what are different between system and application software?​

Answers

Answer:

System software is meant to manage the system resources. It serves as the platform to run application software. Application software helps perform a specific set of functions for which they have been designed. Application software is developed in a high-level language such as Java, C++, .

Explanation:

Hope it helps ^-^

#CarryOnLearning

Given the following code segment, how can you best describe its behavior? i ← 1 FOR EACH x IN list { REMOVE(list, i) random ← RANDOM(1, LENGTH(list)) INSERT(list, random, x) i ← i + 1 }Required to answer. Single choice.
a. This code replaces everything in the list with random numbers.
b. This code shuffles the order of the numbers in the list by removing them and inserting them back in a random place.
c. This code removes all of the numbers in the list and inserts random numbers in random places in the list.
d. This code errors by trying to access an element at an index greater than the length of the list.

Answers

Based on the code segment, we can deduce: B. This code shuffles the order of the numbers in the list by removing them and inserting them back in a random place.

What is programming?

Programming can be defined as a process through which software developer and computer programmers write a set of instructions (codes) that instructs a software on how to perform a specific task on a computer system.

Based on the given code segment, we can deduce that this code shuffles the order of the numbers in the list by removing each of them and then inserting them back in a random place.

Read more on computer codes here: brainly.com/question/25619349

Scenario: A robot is sitting in a chair with its arms facing down. Write an algorithm, using pseudocode, to make the robot:
1. stand up2. walk forward until it senses a wall3. turn around4. walk back to the chair5. sit down in its original starting positionFinally, output the total number of steps taken.Commands--------In addition to our standard pseudocode commands, you must also use the following robot control commands:sitstandstep (one step forward)raise arms (parallel to floor)lower arms (pointing to floor)sense (only if arms are raised)turn (90 degrees right)Immediately after issuing a sense command, you can check whether the robot is at the wall as follows:if at wallor alternativelyif not at wallAssumptions-----------You must assume the following facts:The robot's initial sitting position is directly facing the target wall.There are no obstacles between the robot and the wall.The wall is 1 or more exact steps from the chair.The wall is sensed when it is less than 1 step from the robot's arms.The length of the robot's arms are slightly less than the length of 1 step.Your solution-------------Your solution must include all of the following:Adequate commentsInitialization and use of at least one variableSequential flow of controlConditional flow of controlIterative flow of controlHandling of any special casesOutput of the total number of steps takenYour solution-------------Your solution must include all of the following:Adequate commentsInitialization and use of at least one variableSequential flow of controlConditional flow of controlIterative flow of controlHandling of any special casesOutput of the total number of steps taken

Answers

Solution :

[tex]\text{Algorithm to}[/tex] stand [tex]$\etxt{up:}$[/tex]

step [tex]1[/tex]: [tex]$\text{stand}$[/tex]

step 2: [tex]\text{raise arms}[/tex]

[tex]\text{Algorithm to}[/tex] walk [tex]$\text{until it senses}$[/tex] a wall:

step [tex]1[/tex]: [tex]$\text{stand}$[/tex]

step 2: [tex]\text{raise arms}[/tex]

step 3: [tex]$\text{wallSensed}$[/tex]=false

step 4: [tex]$\text{numberOfSteps}$[/tex] = 0

step 5: if([tex]$\text{wallSensed}$[/tex]==true) then

[tex]\text{lower arms}[/tex]

step

else

if(sense)

[tex]$\text{wallSensed}$[/tex]=true;

else

step

[tex]$\text{numberOfSteps}$[/tex]++;

step 6: display [tex]$\text{numberOfSteps}$[/tex] to reach the wall

[tex]\text{Algorithm to}[/tex] turn around:

Step [tex]1[/tex]: if([tex]$\text{wallSensed}$[/tex]==true) then

turn

[tex]\text{raise arms}[/tex]

turn

 

[tex]\text{Algorithm to}[/tex] walk back[tex]$\text{ to the chair}$[/tex]:

Step [tex]1[/tex]: [tex]$\text{turn around}$[/tex]

Step 2: for i=[tex]1[/tex] to [tex]$\text{numberOfSteps}$[/tex] do

step

[tex]\text{Algorithm to}[/tex] sit back down:

Step [tex]1[/tex]: sit

Step 2: Lower arms

How can a DevOps team take advantage of Artificial Intelligence (AI)?

Answers

Answer:

AI/ML can help DevOps teams focus on creativity and innovation by eliminating inefficiencies across the operational life cycle, enabling teams to manage the amount, speed and variability of data. This, in turn, can result in automated enhancement and an increase in DevOps team's efficiency.

Explanation:

General purpose application include all the following except

Answers

Answer: Web authoring

Explanation:

Here's the complete question:

General-purpose applications include all of the following except:

Select one:

a. web authoring

b. word processors

c. spreadsheets

d. database management systems

General purpose application refers to the application which can be used for different tasks. Examples of General purpose application are Spreadsheet, Word processors, Presentation software, Database management system etc.

The general purpose applications are quite different from the specialized application which focuses on a particular discipline. Therefore, the option that isn't a general purpose application is the web authoring.

General-purpose applications include all of the following except: web authoring. therefore option A is correct.

General-purpose applications are versatile software programs that can perform various tasks across different domains.

Word processors, spreadsheets, and database management systems are examples of general-purpose applications.

Word processors allow for creating and editing documents, spreadsheets help with organizing and analyzing data, and database management systems handle storing and managing data.

However, web authoring is not a general-purpose application. It is a specialized application focused on creating and designing websites. While it may have some general functionality, its primary purpose is specific to web development.

Therefore, the correct answer is "a. web authoring" as it is not considered a general-purpose application.

Know more about web authoring:

https://brainly.com/question/33531237

#SPJ6

Your question is incomplete, but most probably your full question was,

General-purpose applications include all of the following except:

Select one:

a. web authoring

b. word processors

c. spreadsheets

d. database management systems

A major university develops an assessment that is meant to provide data on whether potential students will be successful at the university level. If there is a relationship between the results of the assessment and student success, that will best indicate that the assessment has:___.

Answers

Answer:

Predictive validity.

Explanation:

A correlation can be defined as a numerical measure of the relationship existing between two variables (x and y).

In Mathematics and Statistics, a group of data can either be negatively correlated, positively correlated or not correlated at all.

1. For a negative correlation: a set of values in a data increases, when the other set begins to decrease. Here, the correlation coefficient is less than zero (0).

2. For a positive correlation: a set of values in a data increases, when the other set also increases. Here, the correlation coefficient is greater than zero (0).

3. For no or zero correlation: a set of values in a data has no effect on the other set. Here, the correlation coefficient is equal to zero (0).

A predictive validity can be defined as a measure of the extent to which a test score on a scale is able to predict scores based on certain criteria. Thus, it's a measure of the degree to which a certain criteria can predict future behavior or performance.

One of the most common area in which predictive validity is used is in university or college admissions such as in how scores on an assessment or test are related to performance based on a standard or criterion.

In this scenario, there exists a statistical relationship between the results of the assessment conducted and number of students who were successful. Thus, this will best indicate that the assessment has predictive validity.

Array unsortedArr contains an unsorted list of integers.
Array sortedArr contains a sorted list of integers.

Which of the following operations are NOT more efficient for sortedArr than unsortedArr? Assume the most efficient algorithms are used.

I. Searching for a given element
II. Finding the minimum
III. Inserting an element

a. Ill only
b. Il only
c. I only
d. I and II
e. I and III

Answers

Answer:

a. Ill only

Explanation:

This is because, for option III, in inserting an element, one only need the array key for the position in which to insert the element and this is irrespective of whether the array is sorted or not.

Whereas, options I and II are easier done in a sorted array than in an unsorted array.

To delete a persistent cookie, you Group of answer choices Use the Clear method of the HttpCookieCollection class Use the Remove method of the HttpCookieCollection class Set the Expires property of the cookie to a time in the past Set the Expires property of the cookie to -1

Answers

Answer:

Explanation:  

To delete a persistent cookie, you a. use the Clear method of the HttpCookieCollection class b. use the Remove method of the HttpCookieCollection class c. set the Expires property of the cookie to a time in the past d. set the …

c. set the Expires property of the cookie to a time in the past

1) SuperFetch is a memory-management technique that a) determines the type of RAM your system requires. b) makes the boot-up time for the system very quick. c) preloads the applications you use most into system memory. d) defragments the hard drive to increase performance.

Answers

Answer:

c

Explanation:

It preloads the apps and softwares that you use most into thr memory so that they can boot up faster.But it consumes more ram.

write a program to input a character (ch)convert the character into its opposite case. print the entered character in the new character the program should reject if the elector entered is not an alphabet A to z or a to z your program should continue as long as the user wants.
[tex]write \: in \: java [/tex]

Answers

Answer:

import java.util.Scanner;  

import java.lang.*;

class Main {

 public static void main(String[] args) {

   boolean exit = false;

   Scanner reader = new Scanner(System.in);

   while(!exit) {

     char c = '?';

     while( !Character.isLetter(c)) {

       System.out.print("Enter a letter or * to exit: ");

       c = reader.next().charAt(0);

       if (c == '*') {

         exit = true;

         break;

       }

       if (!Character.isLetter(c)) {

         System.out.printf("Error: %c is not a letter!\n", c);

       }

     }

     if (Character.isLowerCase(c)) {

       System.out.printf("%c in uppercase is %c\n", c, Character.toUpperCase(c));

     } else if (Character.isUpperCase(c)) {

       System.out.printf("%c in lowercase is %c\n", c, Character.toLowerCase(c));

     }

   }

   reader.close();

 }

}

Explanation:

I decided to use the asterisk (*) as exit character.

what is gradient descent in neural networks?​

Answers

Answer:

radient Descent is a process that occurs in the backpropagation phase where the goal is to continuously resample the gradient of the model's parameter in the opposite direction

Which avenue may utilize video streaming, audio narration, print designs and animation?

The (blank) may utilize video streaming, audio narration, print designs and animation.

Answers

Answer:

Explanation:

Multimedia medium may utilize video streaming, audio narration, print designs and animation as they are all part of it.

Answer:

Explanation:

ans is multimedia as it contains all of 'em

Where do I look for a deep learning mentor who can assist me in my career?​

Answers

The answer:

You have to pay for it man!

Explanation:

You can find a lot of services from Fiverr and Upwork etc. But that would need to pay a lot for it.

Write an algorithm to sum to values

Answers

Answer:

There is no need to make an algorithm for this simple problem. Just add the two numbers by storing in two different variables as follows:

Let a,b be two numbers.

c=a+b;

print(c);

But, if you want to find the sum of more numbers, you can use any loop like for, while or do-while as follows:

Let a be the variable where the input numbers are stored.

while(f==1)

{

printf(“Enter number”);

scanf(“Take number into the variable a”);

sum=sum+a;

printf(“Do you want to enter more numbers? 1 for yes, 0 for no”);

scanf(“Take the input into the variable f”);

}

print(Sum)

Explanation:

hi there answer is given mar me as brainliest

Write a function that accepts a positive random number as a parameter and returns the sum of the random number's digits. Write a program that generates random numbers until the sum of the random number's digits divides the random number without remainder. assembly language

Answers

Answer:

Explanation:

The following Python program has a function called addDigits which takes a number as a parameter and returns the sum of the digits. Then the program creates a loop that keeps creating random numbers between 222 and 1000 and divides it by the value returned from the function addDigits. If the remainder is 0 is prints out a statement and breaks the loop, ending the program. The picture below shows the output of the program.

import random

def addDigits(num):

   sum = 0

   for x in str(num):

       sum += int(x)

   return sum

sum = addDigits(random.randint(222, 1000))

while True:

   myRandomNum = random.randint(2, 99)

   if (sum % myRandomNum) == 0:

       print("No remainder between: " + str(sum) + " and " + str(myRandomNum))

       break

Which model represents any process in general?
O A.
universal
OB.
transactional
O C.
linear
OD.
flowchart
OE.
interactive

Answers

Answer: A. universal

Explanation: correct on Plato

Amy’s new summer job at the pool will put $9 per hour. Which term describes this type of hourly income?
A. Salary
B. Take-home pay
C. Wage
D. All of the above

Answers

Answer:

d

Explanation:

Demonstrate the register addressing mode for the following instructions. Also what addressing mode belongs to these instructions?

1. MOV CX, [BX+DI]
2. MOV AX, ARRAY[CX]
3. MOV BX, [CX+DI+6]

Answers

Answer:

Demonstrate the register addressing mode for the following instructions. Also what addressing mode belongs to these instructions?

1. MOV CX, [BX+DI]

2. MOV AX, ARRAY[CX]

3. MOV BX, [CX+DI+6]

The process of making changes to an information system to evolve its functionality, to accommodate changing business needs, or to migrate it to a different operating environment is known as _____________ maintenance.

Answers

Answer:

Corrective

Explanation:

An information system interacts with the overall system by receiving data in its raw forms and information in a usable format.

Information system can be defined as a set of components or computer systems, which is used to collect, store, and process data, as well as dissemination of information, knowledge, and distribution of digital products.

Generally, it is an integral part of human life because individuals, organizations, and institutions rely on information systems in order to perform their duties, functions or tasks and to manage their operations effectively. For example, all organizations make use of information systems for supply chain management, process financial accounts, manage their workforce, and as a marketing channels to reach their customers or potential customers.

Additionally, an information system comprises of five (5) main components;

1. Hardware.

2. Software.

3. Database.

4. Human resources.

5. Telecommunications.

Corrective maintenance can be defined as the process of making significant changes to an information system in order to evolve or transform its functionality, to accommodate and tolerate continuously changing business needs, or to migrate it to a different (new) operating environment.

This ultimately implies that, a corrective maintenance is performed so as to rectify (repair) faulty equipments or systems and to restore an underperforming resource to an operational or optimum status.

Identify congruent triangles. Justify why these triangles are congruent?

1. Hanger
2. Watermelon
3. Triangle Ruler
4. Pizza
5. Triangle Roof house​

Answers

4 because it’s a triangular ruler

what would be the result of running these two lines of code


Ski

Surf

Jog

Hike

Answers

Answer:

Jog

Explanation:

The variable options is a list containing 5 string values

options = ["ski", "surf", "jog", "bike", "hike"]

Indexing in python starts from 0 ; hence the index values of the list values are :

0 - ski

1 - surf

2 - jog

3 - bike

4 - hike

The statement ;

print(options[2]) means print the string at index 2 in the list named options

The string at index 2 is jog ;

Hence, the string jog is printed.

a) Which two technologies you would suggest to making tolling process fast?

Answers

Phone and computer yea yea lil baby

Describe FIVE distinct features of multi-threaded programming. Your answer should be language independent. g

Answers

Answer:

1) Execution time speed

2) Responsiveness

3) use of multi-processor architecture

4) sharing of resources

5) use of resources

Explanation:

The Distinct features are

1) Execution time speed : The time of execution in a multithreaded programming is lesser than a Non multithreaded programming which means the execution speed is faster

2) Responsiveness : Multithreaded programming languages are more responsive because every thread in the language is independent of others hence they can respond/generate responses based on its execution

3) Multithreaded programming makes use of multi-processor architecture given that each response from the threads are simultaneous

4) Ease in sharing of resources by the multiple threads found in the programming

5) Light weight of threads makes the need for resources by the threads in the programming language to be lesser when compared to other programming languages

The network performance is said to be biased when _________.

a) It performs well on train set but poorly on dev set
b) it performs poorly on train set
c) Both the options
d) None of the options

Answers

Answer:

the answer for the question is B

The network performance is said to be biased when it performs poorly on train set.

What is network performance?

A measurement regarding service or the state of quality of network received by the consumer is known as network performance. Operators can control the upper limit of a network performance.

When network operators or service providers put a cap and lower the speed of a network on a train set, it is said to be a biased network performance.

Hence, option B holds true regarding network performance.

Learn more about network performance here:

https://brainly.com/question/12968359

#SPJ2

What is edge computing?

Answers

Answer:

I basically means something like the cloud, where your data is uploaded to servers and is then processed and transferred back to you when you need it.

Explanation:

Hope this helps :)

A de-centrally-powered, fully accessible IT architecture that always enables mobile computer technology as well as internet technologies, is determined as Edge computing.

Processing is done through edge computing, instead of sent off to the server farm, either by the equipment rather than via a localized server computer system.

Examples of edge computing include:

Smart grid excellent analysis.Oilfield rigs security monitoring.Video streaming.Drone-enabled agricultural management.

Learn more about edge computing here:

https://brainly.com/question/22646214

write down the multiples of three from 474 to 483​

Answers

Answer:

474, 477, 480, 483

hope this helps

have a good day :)

Explanation:

Blank Are input instructions you give to a computer

Answers

Explanation:

A computer is a machine that can be programmed to accept data (input), process it into useful information (output), and store it away (in a secondary storage device) for safekeeping or later reuse. The processing of input to output is directed by the software but performed by the hardware.

what are the process of boots up a computer?​

Answers

Answer:

a boat causes a computer start cutting cs and max contain built in instructions in a rom or flash memory chip that are automatically excited on started up these instructions search for the operating system load it and pass control to it
Other Questions
One of the benefits of Internet reference sites is that the information comes from one place and only focuses on one areaof a given topicPlease select the best answer from the choices providedOF helppppp make your answers clear PLEASE HELPPP! TWO DIFFERENT GRAPHS, TWO DIFFERENT QUESTIONS, #1 Which statement is true? Select all that apply. (There are multiple correct answers, select ALL.) + (This is for the SUBMARINE graph.)A: The relationship is proportional.B: The slope is -6.C: The slope is negative.D: The y-intercept is -3.E: The equation of the line is y=-3x#2 PART A: What is the slope of the line? (Only one is correct.) + (This is for the water in the sink graph)m = 2m = -2m = 1/2m = -1/2#2 PART B: Connor says the graph shows that water is flowing at a rate of 2 gallons per minute. Is he correct? (Yes or no) What is the role of a generator in producing electricity? HELPP i'll give brainliest for the CORRECT answer Jackie And her friends of their favorite organization. Jackie received four times the votes warren received .there were 200 ballots cast how many votes did Jackie receive WILL GIVE BRAINLIEST IF RIGHT IG....PLEASE get it RIGHT....find the volume of a cone with a diameter of 12m and a height of 8m.ANSWER CHOICESoA. 96m^3oB. 384 pi m^3oC. 96 pi m^3oD. 288 pi m^3 Stereotypes affect the way we feel about ourselves.Have you ever been stereotyped? How did it affect you? Identify one factor that led to the downfall of land based empires in the era of 1450-1750. the organelle involved in cell secretion is a. We used this car for our trips.Change it into passive voice What is the measure of BA (the minor arc) in the diagram below?DB72"ACA. 1440B. 216C. 36D. 72helppp plsss how do you estimate 10.43 Task 4: gasoline cost you have $40 to spend on n gallons of gas that costs $3.25 per gallon. determine whether each of the following is an expression or an equation. using the structure, give an interpretation of the practical meaning of each. that is, what do they represent in the real world? 1. 3.25n2.3.25n=263.40-3.25n4. 40-3.25n=1.00 who is a first preisdent of united state Pls help i asked this question earlier and know one helped 4) 9i(5) + 5i(3) 10i The pool at the hotel where Gabriel is staying is symmetrical and shaped like the letter "W" below. A pool is made up of 3 rectangles. One rectangle has a base of 10 yards and height of 10 yards. Another has a base of 20 yards and height of 10 yards. Another has a base of 20 yards and height of 10 yards. The bottom surface of the pool is flat and needs new tile. If each tile covers StartFraction 1 Over 9 EndFraction of a square yard and costs $3, what is the cost of the tiles to retile the bottom of the pool? $1,500 $4,500 $10,800 $13,500 What is an organelle? Give three examples in python write a code to find power (2 & -2)