Programming Report
Programming Report
MBIS4003
UNIT NAME:
Software Development
ASSESSMENT NUMBER:
ASSESSMENT 3 Part A
ASSESSMENT TYPE:
REPORT
SUBMITTED BY:
Himanshu 230983
DATE:
INTRODUCTION................................................................................................................................3
PROGRAM 1: CALCULATOR:........................................................................................................3
Output:............................................................................................................................................5
PROGRAM 2: STRING MANIPULATION......................................................................................5
Output:............................................................................................................................................7
PROGRAM 3: PRODUCT RATING:...............................................................................................8
Output:..........................................................................................................................................10
PROGRAM 4: WORD SCRAMBLE GAME:................................................................................12
Output:..........................................................................................................................................16
PROJECT MANAGEMENT............................................................................................................18
Planning:.......................................................................................................................................19
Development:...............................................................................................................................19
Testing:..........................................................................................................................................19
Integration:...................................................................................................................................19
CONCLUSION..................................................................................................................................19
INTRODUCTION
This report offers a thorough summary of a group effort including four separate
Python applications intended for both instructional and recreational use. Aimed at
improving learning and involvement for elementary school pupils, the programmes
provide a spectrum of features. The project consists of a Calculator for arithmetic
practice, a String Manipulation tool for text analysis and manipulation, a Product
Rating analysis system for statistical insights, and an interactive Word and Number
Arcade Game for fun and skill development. Three people worked on each
programme, working together on the last arcade game to provide a well-rounded and
coherent collection of teaching resources.
PROGRAM 1: CALCULATOR:
from collections import Counter
import string
def analyze_string(s):
s = s.lower()
letter_counts = Counter(s)
alphabet = set(string.ascii_lowercase)
def generate_anagrams(s):
if len(s) <= 1:
return [s]
anagrams = []
return anagrams
def plot_letter_frequencies(letter_counts):
plt.bar(letters, counts)
plt.xlabel('Letters')
plt.ylabel('Frequency')
plt.show()
def main():
print("Letter frequencies:")
print(f"{letter}: {count}")
print("The string has all the letters of the alphabet." if has_all_letters else "The string does not
have all the letters of the alphabet.")
plot_letter_frequencies(letter_counts)
unique_sorted_letters = ''.join(sorted(set(user_input.lower())))
anagrams = generate_anagrams(user_input)
if __name__ == "__main__":
main()
Output:
import string
def analyze_string(s):
s = s.lower()
letter_counts = Counter(s)
alphabet = set(string.ascii_lowercase)
def generate_anagrams(s):
return [s]
anagrams = []
anagrams.append(char + anagram)
return anagrams
def plot_letter_frequencies(letter_counts):
plt.bar(letters, counts)
plt.xlabel('Letters')
plt.ylabel('Frequency')
plt.show()
def main():
print("Letter frequencies:")
print(f"{letter}: {count}")
print("The string has all the letters of the alphabet." if has_all_letters else "The string does not
have all the letters of the alphabet.")
plot_letter_frequencies(letter_counts)
# Sorting letters and removing duplicates
unique_sorted_letters = ''.join(sorted(set(user_input.lower())))
anagrams = generate_anagrams(user_input)
if __name__ == "__main__":
main()
Output:
PROGRAM 3: PRODUCT RATING:
from collections import Counter
import numpy as np
import statistics
def main():
ratings = []
try:
continue
ratings.append(rating)
except ValueError:
rating_counts = Counter(ratings)
print("\nRating Frequencies:")
try:
min_rating = min(ratings)
max_rating = max(ratings)
mean_rating = statistics.mean(ratings)
median_rating = statistics.median(ratings)
mode_rating = statistics.mode(ratings)
variance_rating = statistics.variance(ratings)
stdev_rating = statistics.stdev(ratings)
except statistics.StatisticsError as e:
print(f"Error calculating statistics: {e}")
return
print("\nStatistics:")
print(f"Minimum: {min_rating}")
print(f"Maximum: {max_rating}")
print(f"Range: {rating_range}")
print(f"Mean: {mean_rating}")
print(f"Median: {median_rating}")
print(f"Mode: {mode_rating}")
print(f"Variance: {variance_rating}")
plt.xlabel("Rating")
plt.ylabel("Frequency")
plt.show()
if __name__ == "__main__":
main()
Output:
PROGRAM 4: WORD SCRAMBLE GAME:
import random
import time
def scramble_word(word):
return scrambled
# Word Scramble Game
def word_scramble_game():
word = random.choice(words)
scrambled_word = scramble_word(word)
attempts = 0
start_time = time.time()
while True:
attempts += 1
if guess == word:
break
else:
end_time = time.time()
print(f"You took {attempts} attempts and {time_taken:.2f} seconds to guess the word.")
def number_guessing_game():
attempts = 0
start_time = time.time()
while True:
try:
attempts += 1
else:
break
except ValueError:
end_time = time.time()
print(f"You took {attempts} attempts and {time_taken:.2f} seconds to guess the number.")
def plot_statistics(stats):
plt.figure(figsize=(10, 5))
plt.subplot(1, 2, 1)
plt.xlabel('Game')
plt.ylabel('Attempts')
plt.subplot(1, 2, 2)
plt.xlabel('Game')
plt.ylabel('Time (seconds)')
plt.tight_layout()
plt.show()
def main():
while True:
print("4. Exit")
if choice == '1':
stats["word_scramble"]["attempts"] += attempts
stats["word_scramble"]["time"] += time_taken
stats["number_guessing"]["attempts"] += attempts
stats["number_guessing"]["time"] += time_taken
elif choice == '3':
plot_statistics(stats)
print("Thank you for playing the Word and Number Arcade! Goodbye!")
break
else:
if __name__ == "__main__":
main()
Output:
PROJECT MANAGEMENT
The project was managed efficiently through a collaborative approach, with each
team member focusing on specific tasks. The contributions were divided as follows:
Development:
Every programme was developed under guidelines, coding each according to them.
Code changes were managed and team member cooperation was facilitated via
version control systems.
Testing:
Integration:
CONCLUSION
In conclusion, the project successfully delivered four educational and entertaining
Python programs tailored for elementary students. Program 1 provides interactive
arithmetic practice, Program 2 offers insights into text analysis and manipulation,
Program 3 delivers detailed statistical analysis of product ratings, and Program 4
engages students through a fun and challenging arcade game. The collaborative
efforts of Himanshu, Saema, and Bharti ensured that each program was developed
with attention to detail and educational value. The project demonstrates effective
teamwork and the ability to leverage Python programming for creating impactful
educational tools.