Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please note this is a high school python assignment. Please keep this simple - no arrays Random Joke Generator Instructions In this assignment, you will

Please note this is a high school python assignment. Please keep this simple - no arrays

Random Joke Generator

Instructions

In this assignment, you will write a program that will process data in the jokes.txt (please see contents of file below) and answers.txt (please see contents of file below) files. Set up your program so that it will do the following tasks:

  1. Displays the number of jokes in jokes.txt
  2. Asks the user for the number of a joke
  3. Displays the joke
  4. Displays the requested joke
  5. Displays the requested answer

Use the answers_filepath and jokes_filepath variables to open the files and solve this problem.

Sample Run

There are 10 jokes

Which joke do you want to see? 7

Joke #7

How did the teacher knit a suit of armor?

She used steel wool!

Contents of jokes.txt file:

What did the paper say to the pencil?

What did the computer do at lunchtime?

What does a baby computer call his father?

Two bytes meet. The first byte asks, "Are you ill?"

What did you learn in school today?

Which bet can't be won?

How did the teacher knit a suit of armor?

Why did the boy study on an airplane?

What do you call a pig that knows karate?

Why did the chicken cross the playground?

Contents of answers.txt file:

Write on!

It had a byte

Data

The second byte replies, "No, just feeling a bit off."

Not enough, I have to go back tomorrow!

Alphabet.

She used steel wool!

He wanted to get a higher education.

A pork chop!

To get to the other slide.

python programming language

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions

Question

Factors Affecting Conflict

Answered: 1 week ago

Question

Describe the factors that lead to productive conflict

Answered: 1 week ago

Question

Understanding Conflict Conflict Triggers

Answered: 1 week ago