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
podryga [215]
2 years ago
14

Create a script that prompts for the user to input a directory and then prints out the number of sub-directories in the given di

rectory, as well as the number of files (use the numbers only for the directory given, you do NOT need to do this recursively for all sub-directories).
Computers and Technology
1 answer:
laila [671]2 years ago
5 0

Answer:

Below is the required code:

Explanation:

Python Code

import os

import bin

dir = input("Please specify the location to the directory")

list = os.walk(dir)

a = length(list[1])

b = length(list[2])

print "Files: %n , Sub-dirs : %n" % (b,a)

decision = _(" Do you want to continue? (y/n) "))

if(decision):

cls

else :

exit()

You might be interested in
How is the go button on m computer?
bearhunter [10]

<span>Go appears in the menu bar when Finder has focus, not in the Finder window.</span>
7 0
3 years ago
George wants to edit the font of the title text in his presentation. Where can he find the option to edit it?
liberstina [14]
The answer is the answer choice D
4 0
3 years ago
Read 2 more answers
FFFFFFFFFRRRRRRRRRRRRRRRRRREEEEEEEEEEEEEEEEEEEEEEE
telo118 [61]

Answer:

THANKS I NEEDED THIS SOOO MUCH!!!$

6 0
3 years ago
Read 2 more answers
Programming CRe-type the code and fix any errors. The code should convert non-positive numbers to 1.
LUCKY_DIMON [66]

Answer:

Given

The above lines of code

Required

Rearrange.

The code is re-arrange d as follows;.

#include<iostream>

int main()

{

int userNum;

scanf("%d", &userNum);

if (userNum > 0)

{

printf("Positive.\n");

}

else

{

printf("Non-positive, converting to 1.\n");

userNum = 1;

printf("Final: %d\n", userNum);

}

return 0;

}

When rearranging lines of codes. one has to be mindful of the programming language, the syntax of the language and control structures in the code;

One should take note of the variable declarations and usage

See attachment for .cpp file

Download cpp
5 0
3 years ago
Write a copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *thi
Olin [163]

The following cose will be used to copy assignment operator for CarCounter

<u>Explanation:</u>

Complete Program:

#include <iostream>

using namespace std;

class CarCounter

{

public:

CarCounter();

CarCounter& operator=(const CarCounter& objToCopy);

void SetCarCount(const int setVal)

{

 carCount = setVal;

}

int GetCarCount() const

{

 return carCount;

}

private:

int carCount;

};

CarCounter::CarCounter()

{

carCount = 0;

return;

}

// FIXME write copy assignment operator

/* Your solution goes here */

CarCounter& CarCounter::operator=(const CarCounter& objToCopy)

{

if(this != &objToCopy)

 carCount = objToCopy.carCount;

return *this;

}

int main()

{

CarCounter frontParkingLot;

CarCounter backParkingLot;

frontParkingLot.SetCarCount(12);

backParkingLot = frontParkingLot;

cout << "Cars counted: " << backParkingLot.GetCarCount();

cout << endl << endl;

system("pause");

return 0;

}

5 0
3 years ago
Other questions:
  • Musccanic Inc., a company that manufactures microprocessors, updates the technology used in its microprocessors once every four
    15·1 answer
  • To begin importing data from an excel spreadsheet, click on the ____ tab on the ribbon.
    11·1 answer
  • What sends massive amounts of email to a specific person or system that can cause that user's server to stop functioning? mail b
    6·1 answer
  • What is required for real-time surveillance of a suspects computer activity?/p Group of answer choices a. Blocking data transmis
    12·1 answer
  • 3 Points
    9·2 answers
  • In a chassis, the path along which air from a cool air source is conducted, past equipment to cool it, and then out of the rack.
    13·1 answer
  • Sabian que hay una violadora sexuar el nombre de usario es SASHENKAFASION me acaba de decir que hackio en donde vivo,mi nombre c
    5·1 answer
  • Circular errors are caused by adding the cell name of a/an _______ cell to a formula.
    11·2 answers
  • Given an integer n and an array a of length n, your task is to apply the following mutation to an: Array a mutates into a new ar
    5·1 answer
  • How many cubic millimeters are present in 0.0923 m3?​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!