CSC/BIF 243 Introduction to Object Oriented Programming Lab 09 solved

$25.00

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (5 votes)

Problem 1

 

  1. Create a text file (Notepad) containing the below and name it flanders.txt.

 

 

 

  1. Write a python program that reads flanders.txt and creates a text file containing in addition to what is written in the file, a report on the file.

The report should include the following:

  • Number of lines
  • Number of words
  • Number of characters
  • Number of occurrences of every alphabetic character in the file

 

 

 

 

 

 

 

Problem 2

 

 

Design and write a complete Application program that ask the user to enter an integer N and simulates the roll two dies N times (N being a large number such 10000 times). Your program should count and output the number and percentage of occurrences of each

 

  • Implement and use a function roll that simulate the rolling of a Die:

Def roll():

   # () -> int

   # returns a random number between 1 and 6

 

  • Include in the application a prompt for re-running the simulation.

 

 

 

 

Problem 3

 

Hangman Game:  Write a program that prompts the user to guess a word. The program starts by displaying dashes for each character in the word. Then, the user starts by inputting characters. If the character is in the word, it replaces the dash and the program proceeds. The user is allowed a number of attempts equal to double the length of the word.

Hint: Store the words in a list and then have the program pick one randomly.

 

 

 

 

 

Deliverable: ?

 

  • Your programs in a python file.
  • Sample Runs.