answer.
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
nordsb [41]
2 years ago
7

Write a script named numberlines.py. This script creates a program listing from a source program. This script should: Prompt the

user for the names of two files. The input filename could be the name of the script itself, but be careful to use a different output filename! The script copies the lines of text from the input file to the output file, numbering each line as it goes. The line numbers should be right-justified in 4 columns, so that the format of a line in the output file looks like this example: 1> This is the first line of text
Computers and Technology
1 answer:
ddd [48]2 years ago
4 0

Answer:

See explaination for program code.

Explanation:

inputFileName = input("Input filename: ") outputFileName = input("Output filename: ") inputFile = open(inputFileName, "r") outputFile = open(outputFileName, "w") count = 1 for line in inputFile: newLine = str(count).rjust(4, " ") + "> " + line outputFile.write(newLine) print(newLine) count += 1

You might be interested in
Peter accumulated many photos from his visit to Wisconsin. He wants to upload these photos to a social networking site. Which fi
daser333 [38]

Answer:

JPG / JPEG best choice and work well on websites

Explanation:

JPEGs contains millions of colors, so this type of file is ideal for photographs.

Best choice for posting on social media channels

7 0
2 years ago
As in algebra, you can use brackets to override the order of operations Excel follows to perform formula calculations. True or f
sertanlavr [38]

Answer:

false

Explanation:

parasynthesis is used to change the order of priority.

6 0
2 years ago
3.A customer has a system with a Gigabyte B450 Aorus Pro motherboard. He wants to upgrade the processor from the AMD Athlon X4 9
Burka [1]

Answer:

The upgrade is possible and it will yield a remarkable  increase in performance

Explanation:

It is a newer product, there is tendency of having a better application compatibility/performance

It has much higher multi threaded performance which is around 522% higher. This allows for higher performance in professional applications like encoding and heavy multitasking compared to the previous.

When considering gaming, it has higher performance compared to the previous.

5 0
2 years ago
Given two integers as user inputs that represent the number of drinks to buy and the number of bottles to restock, create a Vend
ivann1987 [24]

Answer:

In C++:

#include <iostream>

using namespace std;

class VendingMachine {

 public:

   int initial = 20;};

int main() {

 VendingMachine myMachine;

   int purchase, restock;

   cout<<"Purchase: ";  cin>>purchase;

   cout<<"Restock: ";  cin>>restock;

   myMachine.initial-=(purchase-restock);

   cout << "Inventory: "<<myMachine.initial<<" bottles";  

   return 0;}

Explanation:

This question is incomplete, as the original source file is not given; so, I write another from scratch.

This creates the VendingMachine class

class VendingMachine {

This represents the access specifier

 public:

This initializes the inventory to 20

   int initial = 20;};

The main begins here

int main() {

This creates the object of the VendingMachine class

 VendingMachine myMachine;

This declares the purchase and the restock

   int purchase, restock;

This gets input for purchase

   cout<<"Purchase: ";  cin>>purchase;

This gets input for restock

   cout<<"Restock: ";  cin>>restock;

This calculates the new inventory

   myMachine.initial-=(purchase-restock);

This prints the new inventory

   cout << "Inventory: "<<myMachine.initial<<" bottles";  

   return 0;}

8 0
2 years ago
12) Suppose you wanted a subroutine to return to an address that was 3 bytes higher in memory than the return address currently
Snezhnost [94]

Answer:

.code

main proc

mov ecx,ebp

mov ecx, 787878

push ecx

call MySe7en

invoke ExitProcess,0

main endp

MySe7en PROC

pop ecx

sub ecx, 3

mov

push ecx

ret

end main

8 0
2 years ago
Other questions:
  • Mary is writing an article about the animal kingdom. She wants to place image below the text. Which menu should Mary choose for
    15·2 answers
  • Where is the Name Manager dialog box found?
    13·1 answer
  • One reason for using social media is to develop social and professional contacts. True or false?
    9·2 answers
  • Ismael would like to insert a question mark symbol in his document. What steps will he need to follow to do that?
    5·2 answers
  • Why would someone need to use tools like IECacheView or MyLastSearch on a system? Do companies have the right to search a workst
    11·1 answer
  • Templates contain common layout and formatting that can save you time by not having to recreate documents from scratch. True or
    10·1 answer
  • Based on virtualization technologies, how many types can we classify them? Please give a brief statement on each of them?
    14·1 answer
  • Write a program that removes all spaces from the given input.
    6·1 answer
  • In C++ the declaration of floating point variables starts with the type name double, followed by the name of the variable, and t
    10·1 answer
  • 4. Word Separator:Write a program that accepts as input a sentence in which all of thewords are run together but the first chara
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!