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
yarga [219]
3 years ago
14

2. Create a file with the follow integer/string content and save it as fun.txt. 6 fun. 3 hello 10 <> 2 25 4 wow! Write an

interactive program called PrintStrings that: • Generates file name based on the file path entered by the user • Then read the file fun.txt and produce the following output on the console. fun.fun.fun.fun.fun.fun. hellohellohello <><><><><><><><><><> 2525 wow!wow!wow!wow! Notice that there is one line of output for each integer/string pair. The first line has 6 occurrences of "fun.", the second line has 3 occurrences of "hello", the third line has 10 occurrences of "<>", the fourth line has 2 occurrences of "25" the fifth line has 4 occurrences of "wow!". Notice that there are no extra spaces included in the output. You are to exactly reproduce the format of this sample output. You may assume that the input values always come in pairs with an integer followed by a String (which could be numeric, such as "25" above).

Computers and Technology
1 answer:
Nesterboy [21]3 years ago
8 0

Answer:

see explaination

Explanation:

I made use of python program to solve this.

text file name with fun.txt.

6 fun. 3 hello 10 <> 2 25 4 wow!

Program code:

import re

file = open('fun.txt','r') #for reading file

strings="" #declaring empty string

for k in file:

strings=strings+k #all character in file is storing in strings variable for do operations

pattern = '\s' #for pattern \s is for space

result = re.split(pattern, strings) #split the string with space

for k in range(len(result)): #loop through the list of string

if(k%2) == 0: #checking for integer to time of string

p=int(result[k])

print(result[k+1] *p) #print times of the string(k+1)

Check attachment for output

You might be interested in
Why would a designer choose to use an isometric sketch rather than a perspective sketch to share their idea with a design team m
alexdok [17]

Designers use both isometric and perspective sketches to maintain an object’s visual proportions. Isometric sketches are 3D objects drawn with lines that have no vanishing points while perspective sketches are 3D objects drawn with one or more vanishing points.

Designers choose to use an isometric sketch because it is more accurate than perspective drawings and makes the design look more professional. Isometric sketches are much easier to handle because the length of each measure is same as the plan. This is especially for designers drawing pictures by hand. It is time saving and you do not need to calculate the angle of every edge.

8 0
3 years ago
What do astronomers call a system that is composed of more than two stars?
Nezavi [6.7K]
Nazils system is the anwser
7 0
3 years ago
Read 2 more answers
Which option allows you to customize the order of your data ?
Vladimir [108]

✧・゚: *✧・゚:*    *:・゚✧*:・゚✧

                  Hello!

✧・゚: *✧・゚:*    *:・゚✧*:・゚✧

❖ The correct answer choice is B) sorting. When you sort, you can order your sheet however you'd like.

~ ʜᴏᴘᴇ ᴛʜɪꜱ ʜᴇʟᴘꜱ! :) ♡

~ ᴄʟᴏᴜᴛᴀɴꜱᴡᴇʀꜱ

8 0
3 years ago
Read 2 more answers
Case project 5-1 Network Integration ​
oee [108]

Answer:

You need to explain the entire network layout first.

Explanation:

Bringing on new IT Staff can be time consuming.  But depending on the possession you need to explain to them how the domain lay out is.  

4 0
3 years ago
Which of the following situations best illustrates the process of authentication?a.A Web site sets users' passwords to expire ev
Paladinen [302]

Using an electronic signature on official documentation best illustrates the process of authentication

Further explanation:

The continuous rise of Electronic signatures has made it easier for people to accept signed documents by email or through electronic devices. One good example of electronic signatures is the implementation of digital signatures which broadly encompasses many types of electronic signatures out there. Digital signatures are unique to each signer and follow a standard authentication protocol called PKI. PKI use mathematical algorithms to generate what are known as private and public keys.

A good example is Bob and Jane. Jane sends an eSignature document using her private keys. Bob receives this document with an attached copy of Jane’s public key. The signature will be considered valid if the public key decrypts the signature correctly.

Learn more about eSignatures and electronic signatures.

brainly.com/question/8776017

#LearnWithBrainly

7 0
3 years ago
Other questions:
  • By applying styles formats are being applied ?
    14·2 answers
  • Type the correct answer in the box. Spell all words correctly.
    11·1 answer
  • How do you do this question
    11·1 answer
  • An enterprise system is a packaged software application that helps integrate various ___________ in a company.
    15·2 answers
  • In the United States, everyone is guaranteed work true or false
    13·1 answer
  • Wired network are the most reliable and provide the highest speed?
    7·1 answer
  • The order of precedence is very important when building formulas in Excel. Which of the following formulas will produce 778 as t
    11·1 answer
  • Declare a variable temperature and initialize it to 98.6. Instructor Notes: Note that "initialize" means "declare and assign a v
    5·1 answer
  • The most important task in developing a new computer system/app is to: a) choose the most current technologies such as operating
    5·1 answer
  • 40 points for this question
    7·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!