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
Re:
aksik [14]

Answer:

A) create new records

B) open and close forms

C) open database forms

F) navigate through records

G) import and export data

Explanation:

5 0
3 years ago
Expressions provide an easy way to perform operations on data values to produce other data values. True False
Papessa [141]

Expressions provide an easy way to perform operations on data values to produce other data values, True.

<h3>What is an Expression? </h3>

An expression is a combination of one or more operands (Constant, Variable, Array element, Function), operators(Multiplication,Division, Subtraction etc) to be interpreted by a programming language following rules of precedence or association to produce other data values.

Three kinds of expressions includes:

  • An arithmetic expression

  • A character expression

  • A logical or relational expression

Therefore, it is true that Expressions provide an easy way to perform operations on data values to produce other data values.

6 0
2 years ago
The digital revolution has affected a. almost all areas of movie-making, except makeup and hairstyling. b. only a small number o
Georgia [21]

Answer:

Option D is correct.

Explanation:

The Digital Revolution applies to technological improvements from optical automated and mechanical machines to that of the digital technology that is currently accessible. The era began well into the year of 1980s, and continues. That Digital Revolution still marked as the start of the Era of Info.

  • It's the evolution of electrical and analog to digital technologies.
  • Its the advent of digital technologies has also altered the manner of people communication.
  • The following things are only done through computers, cellphones, as well as the web.
5 0
2 years ago
A ___ is a type of computer that is small and portable?
geniusboy [140]

Answer:

laptop

Explanation:

laptops are small and they can be taken anywhere.

5 0
2 years ago
Which column and row references are updated when you copy the formula: =F$5+12?
KIM [24]

Answer:

Column F and row 5

7 0
3 years ago
Other questions:
  • In a social networking site your personal information is listed under your inbox. home. status. profile.
    11·1 answer
  • Assume you have a project with seven activities labeled A-G (following). Derive the earliest completion time (or early finish-EF
    15·1 answer
  • True false you cannot fill in a callout​
    14·1 answer
  • [Submit on zyLabs] Please write a function with one input, a matrix, and one output, a matrix of the same size. The output matri
    10·1 answer
  • Why is the cyber community important???
    8·2 answers
  • Mariah was working on a multimedia presentation that included both video and audio files. The file was huge, and she wanted to s
    13·2 answers
  • 10(            )  8(532.2 )                         
    15·1 answer
  • What are the common camera hazards? When might you encounter these hazards in your life, and what do you plan to
    14·1 answer
  • Which of the following makes Super Mario Run unique?
    6·1 answer
  • Difference between hacking and cracking not hackers and crackers ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!